From 4249cbc95f17c4c377661f27627ccb6c85ad3401 Mon Sep 17 00:00:00 2001 From: zeroeightsix Date: Thu, 11 Oct 2018 21:29:58 +0200 Subject: [PATCH] Add commands option to CustomChat Closes #37 --- .../me/zeroeightsix/kami/module/modules/misc/CustomChat.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/misc/CustomChat.java b/src/main/java/me/zeroeightsix/kami/module/modules/misc/CustomChat.java index af0bf5308..0b663f035 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/misc/CustomChat.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/misc/CustomChat.java @@ -4,6 +4,7 @@ import me.zero.alpine.listener.Listener; import me.zeroeightsix.kami.event.events.PacketEvent; import me.zeroeightsix.kami.module.Module; +import me.zeroeightsix.kami.setting.Setting; import net.minecraft.network.play.client.CPacketChatMessage; /** @@ -12,12 +13,16 @@ @Module.Info(name = "CustomChat", category = Module.Category.MISC, description = "Modifies your chat messages") public class CustomChat extends Module { + @Setting(name = "Commands") + public boolean commands = false; + private final String KAMI_SUFFIX = " \u23D0 \u1D0B\u1D00\u1D0D\u026A"; @EventHandler public Listener listener = new Listener<>(event -> { if (event.getPacket() instanceof CPacketChatMessage) { String s = ((CPacketChatMessage) event.getPacket()).getMessage(); + if (s.startsWith("/") && !commands) return; s += KAMI_SUFFIX; if (s.length() >= 256) s = s.substring(0,256); ((CPacketChatMessage) event.getPacket()).message = s;