Archiviert
1
0

Fix double announcements + chat messages refinement

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-07-25 11:23:49 +02:00
Ursprung e1c021a562
Commit 492dcff64d
5 geänderte Dateien mit 19 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -46,7 +46,7 @@ public class MsgCommand extends BasicCommand {
}
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append("§8").append(player.getName()).append("»").append(target.getName()).append(" §r§7");
msgBuilder.append("§e").append(player.getName()).append("§8»§e").append(target.getName()).append(" §r§7");
for (int i = 1; i < args.length; i++){
msgBuilder.append(args[i]).append(" ");
}

Datei anzeigen

@ -41,7 +41,7 @@ public class RCommand extends BasicCommand {
}
StringBuilder msgBuilder = new StringBuilder();
msgBuilder.append("§8").append(player.getName()).append("»").append(target.getName()).append(" §r§7");
msgBuilder.append("§e").append(player.getName()).append("§8»§e").append(target.getName()).append(" §r§7");
for (String arg : args){
msgBuilder.append(arg).append(" ");
}

Datei anzeigen

@ -126,6 +126,7 @@ public class ChatListener extends BasicListener {
String name = sender.getDisplayName();
String chatsuffix = "§7» ";
message = message.replace('§', '&');
if(sender.hasPermission("bungeecore.group.admin")){
chatsuffix = "§7» §e";
message = ChatColor.translateAlternateColorCodes('&', message);

Datei anzeigen

@ -19,8 +19,7 @@ import net.md_5.bungee.api.event.ServerDisconnectEvent;
import net.md_5.bungee.api.event.ServerKickEvent;
import net.md_5.bungee.event.EventHandler;
import java.util.Collection;
import java.util.Iterator;
import java.util.*;
public class ConnectionListener extends BasicListener {
@ -29,6 +28,12 @@ public class ConnectionListener extends BasicListener {
public static final String CHECK_PERMISSION = "bungeecore.check";
private static final String YOUTUBER_MODS = "bungeecore.youtubermods";
private static final Set<UUID> newPlayers = new HashSet<>();
public static void newPlayer(UUID player){
newPlayers.add(player);
}
@EventHandler
public void onPostLogin(PostLoginEvent event) {
ProxiedPlayer player = event.getPlayer();
@ -38,28 +43,28 @@ public class ConnectionListener extends BasicListener {
case "Admin":
player.addGroups(ADMIN_GROUP, TEAM_GROUP);
player.setPermission("bungeecore.group.admin", true);
player.setPermission("bungeecore.check", true);
player.setPermission(CHECK_PERMISSION, true);
player.setPermission(YOUTUBER_MODS, true);
player.setDisplayName("§4Admin " + player.getName() + "§r");
break;
case "Developer":
player.addGroups(ADMIN_GROUP, TEAM_GROUP);
player.setPermission("bungeecore.group.developer", true);
player.setPermission("bungeecore.check", true);
player.setPermission(CHECK_PERMISSION, true);
player.setPermission(YOUTUBER_MODS, true);
player.setDisplayName("§3Developer " + player.getName() + "§r");
break;
case "Moderator":
player.addGroups(ADMIN_GROUP, TEAM_GROUP);
player.setPermission("bungeecore.group.moderator", true);
player.setPermission("bungeecore.check", true);
player.setPermission(CHECK_PERMISSION, true);
player.setPermission(YOUTUBER_MODS, true);
player.setDisplayName("§bModerator " + player.getName() + "§r");
break;
case "Supporter":
player.addGroups(TEAM_GROUP);
player.setPermission("bungeecore.group.supporter", true);
player.setPermission("bungeecore.check", true);
player.setPermission(CHECK_PERMISSION, true);
player.setPermission(YOUTUBER_MODS, true);
player.setDisplayName("§1Supporter " + player.getName() + "§r");
break;
@ -91,6 +96,9 @@ public class ConnectionListener extends BasicListener {
}
}
}
if(newPlayers.contains(player.getUniqueId()))
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7Begrüßt alle mal §e" + player.getName() + " §7auf dem Server§8!");
}
/** To redirect players to the lobby in case of server closure. */

Datei anzeigen

@ -2,6 +2,7 @@ package de.steamwar.bungeecore.sql;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.commands.WebregisterCommand;
import de.steamwar.bungeecore.listeners.ConnectionListener;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.PendingConnection;
@ -62,7 +63,7 @@ public class SteamwarUser {
user = dbInit(SQL.select("SELECT * FROM UserData WHERE UUID = ?", connection.getUniqueId().toString()));
if(user == null)
throw new SecurityException("user == null");
BungeeCore.broadcast(BungeeCore.CHAT_PREFIX + "§7Begrüßt alle mal §e" + connection.getName() + " §7auf dem Server§8!");
ConnectionListener.newPlayer(user.uuid);
}
return user;