From 7f35559ecd36d889d9de656c3adf484167e0496d Mon Sep 17 00:00:00 2001 From: Bella Date: Tue, 10 Mar 2020 18:22:23 -0400 Subject: [PATCH] customchat instructions for changing --- .../kami/module/modules/chat/CustomChat.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java b/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java index a68a8b48b..d14ce128c 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/chat/CustomChat.java @@ -22,7 +22,7 @@ public class CustomChat extends Module { public Setting textMode = register(Settings.e("Message", TextMode.ONTOP)); private Setting decoMode = register(Settings.e("Separator", DecoMode.NONE)); private Setting commands = register(Settings.b("Commands", false)); - public Setting customText = register(Settings.stringBuilder("Custom Text").withValue("Use &7" + Command.getCommandPrefix() + "customchat&r to modify this").withConsumer((old, value) -> {}).build()); + public Setting customText = register(Settings.stringBuilder("Custom Text").withValue("unchanged").withConsumer((old, value) -> {}).build()); public enum TextMode { NAME, ONTOP, WEBSITE, JAPANESE, CUSTOM @@ -73,4 +73,15 @@ public class CustomChat extends Module { } }); + private static long startTime = 0; + @Override + public void onUpdate() { + if (startTime == 0) startTime = System.currentTimeMillis(); + if (startTime + 5000 <= System.currentTimeMillis()) { // 5 seconds in milliseconds + if (textMode.getValue().equals(TextMode.CUSTOM) && customText.getValue().equalsIgnoreCase("unchanged") && mc.player != null) { + Command.sendWarningMessage(this.getChatName() + " Warning: In order to use the custom " + this.getName() + ", please run the &7" + Command.getCommandPrefix() + "customchat&r command to change it"); + } + startTime = System.currentTimeMillis(); + } + } }