diff --git a/build-number.txt b/build-number.txt index 1f168c59..130e16f6 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1199 \ No newline at end of file +1200 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/Configuration.java b/src/main/java/me/chayapak1/chomens_bot/Configuration.java index edf393ba..a5da14f5 100644 --- a/src/main/java/me/chayapak1/chomens_bot/Configuration.java +++ b/src/main/java/me/chayapak1/chomens_bot/Configuration.java @@ -173,8 +173,24 @@ public class Configuration { public int reconnectDelay = 2000; public boolean removeNamespaces = false; public int chatQueueDelay = 125; + public EssentialsMessages essentialsMessages = new EssentialsMessages(); public CoreRateLimit coreRateLimit = new CoreRateLimit(); + public static class EssentialsMessages { + public String vanishEnable1 = "Vanish for %s: enabled"; + public String vanishEnable2 = "You are now completely invisible to normal users, and hidden from in-game commands."; + public String vanishDisable = "Vanish for %s: disabled"; + + public String nickNameRemove = "You no longer have a nickname."; + public String nickNameSet = "Your nickname is now "; + + public String socialSpyEnable = "SocialSpy for %s: enabled"; + public String socialSpyDisable = "SocialSpy for %s: disabled"; + + public String muted = "You have been muted"; + public String unmuted = "You have been unmuted."; + } + public static class CoreRateLimit { public int limit = 0; public int reset = 0; diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/SelfCarePlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/SelfCarePlugin.java index bcbde1ba..6cc0ffaf 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/SelfCarePlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/SelfCarePlugin.java @@ -52,18 +52,18 @@ public class SelfCarePlugin extends Bot.Listener { if (string.equals("Successfully enabled CommandSpy")) cspy = true; else if (string.equals("Successfully disabled CommandSpy")) cspy = false; - else if (string.equals("Vanish for " + bot.username + ": enabled")) vanish = true; - else if (string.equals("You are now completely invisible to normal users, and hidden from in-game commands.")) vanish = true; - else if (string.equals("Vanish for " + bot.username + ": disabled")) vanish = false; + else if (string.equals(String.format(bot.options.essentialsMessages.vanishEnable1, bot.username))) vanish = true; + else if (string.equals(bot.options.essentialsMessages.vanishEnable2)) vanish = true; + else if (string.equals(String.format(bot.options.essentialsMessages.vanishDisable, bot.username))) vanish = false; - else if (string.equals("You no longer have a nickname.")) nickname = true; - else if (string.startsWith("Your nickname is now ")) nickname = false; + else if (string.equals(bot.options.essentialsMessages.nickNameRemove)) nickname = true; + else if (string.startsWith(bot.options.essentialsMessages.nickNameSet)) nickname = false; - else if (string.equals("SocialSpy for " + bot.username + ": enabled")) socialspy = true; - else if (string.equals("SocialSpy for " + bot.username + ": disabled")) socialspy = false; + else if (string.equals(bot.options.essentialsMessages.socialSpyEnable)) socialspy = true; + else if (string.equals(bot.options.essentialsMessages.socialSpyDisable)) socialspy = false; - else if (string.startsWith("You have been muted")) muted = true; - else if (string.equals("You have been unmuted.")) muted = false; + else if (string.startsWith(bot.options.essentialsMessages.muted)) muted = true; + else if (string.equals(bot.options.essentialsMessages.unmuted)) muted = false; else if (string.equals("You now have the tag: " + bot.config.selfCare.prefix.prefix)) prefix = true; else if (string.startsWith("You no longer have a tag")) prefix = false; diff --git a/src/main/resources/default-config.yml b/src/main/resources/default-config.yml index d2dd6000..6d706ecb 100644 --- a/src/main/resources/default-config.yml +++ b/src/main/resources/default-config.yml @@ -140,6 +140,7 @@ bots: # coreCommandSpy - set to true if server supports enabling player's commandspy though command block # resolveSRV - whether to resolve SRV records on the server. the notchian minecraft doesn't resolve them # removeNamespaces - when the bot sends a command it will remove like `minecraft:` for example if set to true + # essentialsMessages - the messages in essentials that the bot uses for self care (no example is intentional) # coreRateLimit - will ignore commands if reached the ratelimit - host: 'localhost'