mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 19:56:15 +00:00
refactor: remove racist filter
This commit is contained in:
parent
86ebdb1eea
commit
6264013c6b
1 changed files with 2 additions and 13 deletions
|
|
@ -26,8 +26,6 @@ public class CustomChat {
|
|||
|
||||
public static final CustomChat INSTANCE = new CustomChat(MinecraftClient.getInstance());
|
||||
|
||||
public static final Pattern RACIST_PATTERN = Pattern.compile("nigga|nigger|i hate black", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
public boolean enabled = true;
|
||||
|
||||
public String format;
|
||||
|
|
@ -85,16 +83,7 @@ public class CustomChat {
|
|||
public void chat (String message) {
|
||||
final ClientPlayerEntity player = client.player;
|
||||
|
||||
try {
|
||||
final Matcher racistMatcher = RACIST_PATTERN.matcher(message);
|
||||
if (racistMatcher.matches()) {
|
||||
player.sendMessage(Text.literal("racism bad"), false);
|
||||
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (player != null) return;
|
||||
|
||||
if (!enabled || !player.hasPermissionLevel(2) || !player.isCreative()) {
|
||||
Chat.sendChatMessage(message, true);
|
||||
|
|
@ -147,7 +136,7 @@ public class CustomChat {
|
|||
CommandCore.INSTANCE.run((KaboomCheck.INSTANCE.isKaboom ? "minecraft:tellraw @a " : "tellraw @a ") + sanitizedFormat);
|
||||
} catch (Exception e) {
|
||||
if (client.player == null) return;
|
||||
((Audience) client.player).sendMessage(Component.text(e.toString()).color(NamedTextColor.RED));
|
||||
client.player.sendMessage(Component.text(e.toString()).color(NamedTextColor.RED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue