From 0abd349b7a993df811ad958e3e0885aac6f305b1 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 24 Jun 2023 13:50:42 +0700 Subject: [PATCH] remove clear chat username too many problems --- .../chipmunk/chayapak/chomens_bot/Bot.java | 2 - .../plugins/ClearChatUsernamePlugin.java | 38 ------------------- 2 files changed, 40 deletions(-) delete mode 100644 src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ClearChatUsernamePlugin.java diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java index 1846b24..e298a6f 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Bot.java @@ -62,7 +62,6 @@ public class Bot { @Getter private MusicPlayerPlugin music; @Getter private TPSPlugin tps; @Getter private EvalRunnerPlugin eval; - @Getter private ClearChatUsernamePlugin clearChatUsername; @Getter private TrustedPlugin trusted; @Getter private BruhifyPlugin bruhify; @Getter private GrepLogPlugin grepLog; @@ -109,7 +108,6 @@ public class Bot { this.music = new MusicPlayerPlugin(this); this.tps = new TPSPlugin(this); this.eval = new EvalRunnerPlugin(this); - this.clearChatUsername = new ClearChatUsernamePlugin(this); this.trusted = new TrustedPlugin(this); this.bruhify = new BruhifyPlugin(this); this.grepLog = new GrepLogPlugin(this); diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ClearChatUsernamePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ClearChatUsernamePlugin.java deleted file mode 100644 index 575260b..0000000 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/ClearChatUsernamePlugin.java +++ /dev/null @@ -1,38 +0,0 @@ -package land.chipmunk.chayapak.chomens_bot.plugins; - -import land.chipmunk.chayapak.chomens_bot.Bot; -import land.chipmunk.chayapak.chomens_bot.data.chat.PlayerMessage; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; -import net.kyori.adventure.text.format.NamedTextColor; - -// idea totallynotskidded™ from chipmunkbot (the js one) -public class ClearChatUsernamePlugin extends ChatPlugin.Listener { - private final Bot bot; - - public ClearChatUsernamePlugin(Bot bot) { - this.bot = bot; - - bot.chat().addListener(this); - } - - @Override - public void commandSpyMessageReceived (PlayerMessage message) { - final String username = message.sender().profile().getName(); - final String command = ((TextComponent) message.contents()).content(); - - if ( - command.startsWith("/cc") || - command.startsWith("/clearchat") || - command.startsWith("/extras:cc") || - command.startsWith("/extras:clearchat") - ) { - bot.chat().tellraw( - Component.empty() - .append(Component.text(username)) - .append(Component.text(" cleared the chat")) - .color(NamedTextColor.DARK_GREEN) - ); - } - } -}