src/main/java/net/viper/status/modules/globalchat/GlobalChatModule.java aktualisiert
This commit is contained in:
@@ -74,7 +74,7 @@ public class GlobalChatModule implements Module, Listener {
|
||||
loadConfig();
|
||||
|
||||
if (!isChatEnabled) {
|
||||
plugin.getLogger().info("§eGlobalChat ist in der verify.properties DEAKTIVIERT.");
|
||||
plugin.getLogger().info("§eGlobalChat ist in der verify.properties DEAKTIVERT.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class GlobalChatModule implements Module, Listener {
|
||||
|
||||
serverDisplayNames.clear();
|
||||
groupFormats.clear();
|
||||
manualRanks.clear();
|
||||
manualRanks.clear(); // NEU
|
||||
|
||||
for (String key : props.stringPropertyNames()) {
|
||||
// 1. Manuelle Overrides laden (Höchste Priorität!)
|
||||
@@ -253,15 +253,10 @@ public class GlobalChatModule implements Module, Listener {
|
||||
// ===========================
|
||||
private void broadcastGlobal(TextComponent component) {
|
||||
if (!isChatEnabled) return;
|
||||
|
||||
String jsonMessage = ComponentSerializer.toString(component);
|
||||
for (ServerInfo server : plugin.getProxy().getServers().values()) {
|
||||
if (server.getPlayers().isEmpty()) continue;
|
||||
try {
|
||||
server.sendData(CHANNEL_CHAT, jsonMessage.getBytes(StandardCharsets.UTF_8));
|
||||
} catch (Exception ex) {
|
||||
plugin.getLogger().warning("Konnte Nachricht nicht an " + server.getName() + " senden.");
|
||||
}
|
||||
|
||||
// Korrektur: statt PluginChannel-Relay senden wir System/Plugin-Nachrichten an alle Spieler.
|
||||
for (ProxiedPlayer p : plugin.getProxy().getPlayers()) {
|
||||
p.sendMessage(component);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +345,7 @@ public class GlobalChatModule implements Module, Listener {
|
||||
// Formatierung aus verify.properties nutzen
|
||||
String[] ps = getPrefixSuffix(player);
|
||||
String prefix = ps[0];
|
||||
String playerColor = ps[2];
|
||||
String playerColor = ps[2]; // Namefarbe aus Properties
|
||||
|
||||
String displayTag = "";
|
||||
if (!prefix.isEmpty()) displayTag = prefix;
|
||||
@@ -373,7 +368,7 @@ public class GlobalChatModule implements Module, Listener {
|
||||
// Formatierung aus verify.properties nutzen
|
||||
String[] ps = getPrefixSuffix(player);
|
||||
String prefix = ps[0];
|
||||
String playerColor = ps[2];
|
||||
String playerColor = ps[2]; // Namefarbe aus Properties
|
||||
|
||||
String displayTag = "";
|
||||
if (!prefix.isEmpty()) displayTag = prefix;
|
||||
@@ -437,7 +432,7 @@ public class GlobalChatModule implements Module, Listener {
|
||||
|
||||
String[] ps = getPrefixSuffix(player);
|
||||
String prefix = ps[0];
|
||||
String playerColor = ps[2];
|
||||
String playerColor = ps[2]; // Namefarbe aus Properties für den Switch
|
||||
|
||||
String displayTag = "";
|
||||
if (!prefix.isEmpty()) displayTag = prefix;
|
||||
@@ -697,7 +692,7 @@ public class GlobalChatModule implements Module, Listener {
|
||||
if (sender instanceof ProxiedPlayer) {
|
||||
return isStaff((ProxiedPlayer) sender);
|
||||
}
|
||||
return sender.hasPermission("globalchat.clear");
|
||||
return sender.hasPermission("globalchat.clear"); // Console hat meist Rechte, aber sicher ist sicher
|
||||
}
|
||||
|
||||
// ===========================
|
||||
@@ -857,4 +852,4 @@ public class GlobalChatModule implements Module, Listener {
|
||||
sender.sendMessage(new TextComponent("§aChat wurde geleert."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user