diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java index a5da36a..1f4903c 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/Configuration.java @@ -88,17 +88,23 @@ public class Configuration { @Getter public boolean cspy = true; - @Getter public AntiIcuSelfCare icu = new AntiIcuSelfCare(); + @Getter public Icu icu = new Icu(); + + public static class Icu { + @Getter public boolean enabled = true; + @Getter public int positionPacketsPerSecond = 10; + } + + @Getter public Prefix prefix = new Prefix(); + + public static class Prefix { + @Getter public boolean enabled = true; + @Getter public String prefix = "&8[&eChomeNS Bot&8]"; + } - @Getter public boolean prefix = true; @Getter public boolean username = true; } - public static class AntiIcuSelfCare { - @Getter public boolean enabled = true; - @Getter public int positionPacketsPerSecond = 10; - } - public static class BotOption { @Getter public String host; @Getter public int port; diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java index 48a98ac..e6a5027 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/SelfCarePlugin.java @@ -71,9 +71,7 @@ public class SelfCarePlugin extends Bot.Listener { else if (message.startsWith("You have been muted")) muted = true; else if (message.equals("You have been unmuted.")) muted = false; - else if (message.equals("You now have the tag: [ChomeNS Bot]") || // for 1.19.2 (or 1.19?) and older clones - message.equals("You now have the tag: &8[&eChomeNS Bot&8]") - ) prefix = true; + else if (message.equals("You now have the tag: " + bot.config().selfCare().prefix().prefix())) prefix = true; else if (message.startsWith("You no longer have a tag")) prefix = false; else if (message.startsWith("You now have the tag: ")) prefix = false; @@ -96,7 +94,7 @@ public class SelfCarePlugin extends Bot.Listener { if (selfCares.gamemode() && gamemode != GameMode.CREATIVE) bot.chat().send("/minecraft:gamemode creative @s[type=player]"); else if (selfCares.op() && permissionLevel < 2) bot.chat().send("/minecraft:op @s[type=player]"); else if (selfCares.cspy() && !cspy && bot.options().kaboom()) bot.chat().send("/commandspy:commandspy on"); - else if (selfCares.prefix() && !prefix && bot.options().kaboom()) bot.chat().send("/extras:prefix &8[&eChomeNS Bot&8]"); + else if (selfCares.prefix().enabled() && !prefix && bot.options().kaboom()) bot.chat().send("/extras:prefix " + bot.config().selfCare().prefix().prefix()); else if (selfCares.username() && !username && bot.options().kaboom()) bot.chat().send("/extras:username " + bot.username()); else if (selfCares.icu().enabled() && positionPacketsPerSecond > selfCares.icu().positionPacketsPerSecond()) bot.core().run("essentials:sudo * icu stop"); else if (selfCares.vanish() && !vanish && !visibility && bot.options().hasEssentials()) { diff --git a/src/main/resources/default-config.yml b/src/main/resources/default-config.yml index 4c65436..934479d 100644 --- a/src/main/resources/default-config.yml +++ b/src/main/resources/default-config.yml @@ -81,8 +81,10 @@ selfCare: positionPacketsPerSecond: 10 # 10 seems to be the best number for me # extras - prefix: true - username: true + prefix: + enabled: true + prefix: '&8[&eChomeNS Bot&8]' + username: true # MIGHT cause problem(s) if set to false (not tested,.,.) bots: # username, kaboom, useCore, useChat, hasEssentials and reconnectDelay are optional.