AntiUnicode Patches

This commit is contained in:
obvWolf
2023-12-07 22:01:06 -06:00
parent 228f8a848f
commit e9e24aa0f4

View File

@@ -7,7 +7,7 @@ import org.bukkit.event.player.AsyncPlayerChatEvent;
public class AntiUnicode { public class AntiUnicode {
public static void handleAntiUnicode(AsyncPlayerChatEvent e) { public static void handleAntiUnicode(AsyncPlayerChatEvent e) {
String message = Text.removeFirstColor(e.getMessage()); String message = Text.removeFirstColor(e.getMessage());
String nonAllowed = message.replaceAll("[A-Za-z0-9\\[,./?><|\\]\u00A7()*&^%$#@!~`{}:;'\"-_]", "").trim(); String nonAllowed = message.replaceAll("[A-Za-z0-9\\[,./?><|\\]§()*&^%$#@!~`{}:;'\"-_]", "").trim();
if (nonAllowed.length() != 0) { if (nonAllowed.length() != 0) {
e.getPlayer().sendMessage(Text.prefix(Sentinel.dict.get("unicode-warn"))); e.getPlayer().sendMessage(Text.prefix(Sentinel.dict.get("unicode-warn")));
e.setCancelled(true); e.setCancelled(true);