diff --git a/build-number.txt b/build-number.txt index bf3b63f2..8cdbc5f9 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -3069 \ No newline at end of file +3070 \ No newline at end of file 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 72008bb3..44042864 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/SelfCarePlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/SelfCarePlugin.java @@ -98,30 +98,31 @@ public class SelfCarePlugin implements Listener { final boolean kaboom = bot.serverFeatures.hasExtras; final boolean hasEssentials = bot.serverFeatures.hasEssentials; - // chat only - if (selfCares.op && permissionLevel < 2) bot.chat.send("/minecraft:op @s[type=player]"); - else if (selfCares.gamemode && gamemode != GameMode.CREATIVE) + final String uuid = bot.profile.getIdAsString(); + + if (selfCares.op && permissionLevel < 2) { + bot.chat.send("/minecraft:op @s[type=player]"); + } else if (selfCares.gamemode && gamemode != GameMode.CREATIVE) { bot.chat.send("/minecraft:gamemode creative @s[type=player]"); - - // core - else if (selfCares.cspy && !cspy && kaboom) { - if (bot.options.useChat || !bot.options.coreCommandSpy) + } else if (selfCares.cspy && !cspy && kaboom) { + if (bot.options.useChat || !bot.options.coreCommandSpy) { bot.chat.sendCommandInstantly("commandspy:commandspy on"); - else bot.core.run("commandspy:commandspy " + bot.username + " on"); - } - - // back to chat only - else if (selfCares.prefix.enabled && !prefix && kaboom) + } else { + bot.core.run("commandspy:commandspy " + uuid + " on"); + } + } else if (selfCares.prefix.enabled && !prefix && kaboom) { bot.chat.send("/extras:prefix " + bot.config.selfCare.prefix.prefix); - else if (selfCares.username && (System.currentTimeMillis() - usernameStartTime) >= 2 * 1000 && !username && kaboom) + } else if ( + selfCares.username + && (System.currentTimeMillis() - usernameStartTime) >= 2 * 1000 + && !username + && kaboom + ) { bot.chat.send("/extras:username " + bot.username); - - // core - else if (hasEssentials) { + } else if (hasEssentials) { final String usernameOrBlank = !bot.options.useChat ? bot.username + " " : ""; - final String uuid = bot.profile.getIdAsString(); if (selfCares.vanish && visible == vanish) { runEssentialsCommand("essentials:vanish " + usernameOrBlank + (visible ? "disable" : "enable"));