mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Properly integrate lang values into chat spamming
This commit is contained in:
1 parent
753858d238
commit
8404ca0986
3 files changed
+5
-8
No files matched your search
@@ -158,7 +158,7 @@ public class PlayerListener extends EventListener
|
||||
event.setCancelled(b);
|
||||
if (b)
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Please do not spam.");
|
||||
player.sendMessage(ChatColor.RED+config.getLang().getChatWarning());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1124,10 +1124,6 @@ public class Backend
|
||||
|
||||
private void checkChatLevel(Player player, int amount)
|
||||
{
|
||||
if (amount >= magic.CHAT_WARN_LEVEL)
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + lang.getChatWarning());
|
||||
}
|
||||
if (amount >= magic.CHAT_KICK_LEVEL)
|
||||
{
|
||||
String name = player.getName();
|
||||
@@ -1151,8 +1147,9 @@ public class Backend
|
||||
}
|
||||
else if (event.equalsIgnoreCase("KICK"))
|
||||
{
|
||||
player.kickPlayer(ChatColor.RED+lang.getChatKickReason());
|
||||
String msg = ChatColor.RED + lang.getChatKickBroadcast().replaceAll("&player", name);
|
||||
String msg = kick <= magic.CHAT_BAN_LEVEL ? ChatColor.RED + lang.getChatKickReason() + " ("+kick+"/"+magic.CHAT_BAN_LEVEL+")" : ChatColor.RED + lang.getChatBanReason();
|
||||
player.kickPlayer(msg);
|
||||
msg = kick <= magic.CHAT_BAN_LEVEL ? ChatColor.RED + lang.getChatKickBroadcast() + " ("+kick+"/"+magic.CHAT_BAN_LEVEL+")" : ChatColor.RED + lang.getChatBanBroadcast();
|
||||
if(!msg.equals(""))
|
||||
{
|
||||
Bukkit.broadcastMessage(msg);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class Language
|
||||
kickBroadcast = getString("kick.kick_broadcast", "[AntiCheat] &player was kicked for hacking.");
|
||||
chatWarning = getString("chat.warning", "Stop spamming the server or you will be kicked!");
|
||||
chatKickReason = getString("chat.kick_reason", "Kicked for spamming");
|
||||
chatBanReason = getString("chat.kick_reason", "Banned for spamming");
|
||||
chatBanReason = getString("chat.ban_reason", "Banned for spamming");
|
||||
chatKickBroadcast = getString("chat.kick_broadcast", "[AntiCheat] &player was kicked for spamming");
|
||||
chatBanBroadcast = getString("chat.ban_broadcast", "[AntiCheat] &player was banned for spamming");
|
||||
try
|
||||
|
||||
Reference in new issue
Block a user