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