From a153b0befb882f143045f1f5568bf8c41be56f32 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Mon, 28 Aug 2023 17:21:46 +0700 Subject: [PATCH] RACISM BAD --- .../chipmunk/chipmunkmod/modules/CustomChat.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java index fa8ce1e..c7fb7b0 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java @@ -2,8 +2,6 @@ package land.chipmunk.chipmunkmod.modules; import com.google.gson.JsonElement; import land.chipmunk.chipmunkmod.ChipmunkMod; - - import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; @@ -11,18 +9,12 @@ import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.text.Text; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; public class CustomChat { private final MinecraftClient client; 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; @@ -43,13 +35,6 @@ public class CustomChat { public void chat (String message) { final ClientPlayerEntity player = client.player; - final Matcher racistMatcher = RACIST_PATTERN.matcher(message); - if (racistMatcher.find()) { - player.sendMessage(Text.literal("racism bad")); - - return; - } - if (!enabled || !player.hasPermissionLevel(2) || !player.isCreative()) { final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler(); networkHandler.sendChatMessage(message);