diff --git a/src/de/steamwar/bungeecore/listeners/ChatListener.java b/src/de/steamwar/bungeecore/listeners/ChatListener.java index b632ef1..df006f9 100644 --- a/src/de/steamwar/bungeecore/listeners/ChatListener.java +++ b/src/de/steamwar/bungeecore/listeners/ChatListener.java @@ -82,11 +82,10 @@ public class ChatListener extends BasicListener { } public static void sendChat(ChatSender sender, Stream receivers, String format, ChatSender msgReceiver, String message) { - if(chatFilter(sender, message)) - return; - SteamwarUser user = sender.user(); - String coloredMessage = (user.getUserGroup() != UserGroup.Member || coloredTeams.contains(user.getTeam())) ? ChatColor.translateAlternateColorCodes('&', message) : message; + final String coloredMessage = (user.getUserGroup() != UserGroup.Member || coloredTeams.contains(user.getTeam())) ? ChatColor.translateAlternateColorCodes('&', message) : message; + if(chatFilter(sender, coloredMessage)) + return; AtomicBoolean noReceiver = new AtomicBoolean(true); receivers.filter(ChatSender::chatShown).forEach(player -> { @@ -132,6 +131,11 @@ public class ChatListener extends BasicListener { return true; } + if(message.replace("§[a-f0-9klmno]", "").trim().isEmpty()) { + sender.system("CHAT_EMPTY"); + return true; + } + SteamwarUser user = sender.user(); UserGroup group = user.getUserGroup(); if(!group.isTeamGroup() && (message.contains("http:") || message.contains("https:") || message.contains("www."))){ diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 7dfaa7c..58633d2 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -521,6 +521,7 @@ CHAT_RECEIVE=§cTo be able to send chat messages, you must also receive them! CHAT_NO_LINKS=§cYou may not send links. CHAT_BC_USAGE=§8/§7bc §8[§emessage§8] CHAT_NO_RECEIVER=§cNobody receives your message +CHAT_EMPTY=§cDon't write meaningless empty messages. CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2} CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2} diff --git a/src/de/steamwar/messages/BungeeCore_de.properties b/src/de/steamwar/messages/BungeeCore_de.properties index 6fc780b..0c93d45 100644 --- a/src/de/steamwar/messages/BungeeCore_de.properties +++ b/src/de/steamwar/messages/BungeeCore_de.properties @@ -500,6 +500,7 @@ CHAT_RECEIVE=§cUm Chatnachrichten versenden zu können, musst du auch welche em CHAT_NO_LINKS=§cDu darfst keine Links versenden. CHAT_BC_USAGE=§8/§7bc §8[§eNachricht§8] CHAT_NO_RECEIVER=§cNiemand empfängt deine Nachricht +CHAT_EMPTY=§cSchreibe keine inhaltslosen Nachrichten. CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2} CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}