feat: god self care (can't believe i don't have one)
This commit is contained in:
@@ -1 +1 @@
|
||||
3364
|
||||
3366
|
||||
@@ -131,6 +131,7 @@ public class Configuration {
|
||||
|
||||
public boolean vanish = true;
|
||||
public boolean nickname = true;
|
||||
public boolean god = true;
|
||||
public boolean socialspy = true;
|
||||
public boolean mute = true;
|
||||
|
||||
@@ -176,6 +177,9 @@ public class Configuration {
|
||||
public String nickNameRemove = "You no longer have a nickname.";
|
||||
public String nickNameSet = "Your nickname is now ";
|
||||
|
||||
public String godModeEnable = "God mode enabled.";
|
||||
public String godModeDisable = "God mode disabled.";
|
||||
|
||||
public String socialSpyEnable = "SocialSpy for %s: enabled";
|
||||
public String socialSpyDisable = "SocialSpy for %s: disabled";
|
||||
|
||||
|
||||
@@ -5,10 +5,7 @@ import me.chayapak1.chomens_bot.data.listener.Listener;
|
||||
import me.chayapak1.chomens_bot.data.player.PlayerEntry;
|
||||
import me.chayapak1.chomens_bot.data.selfCare.SelfCare;
|
||||
import me.chayapak1.chomens_bot.data.selfCare.SelfData;
|
||||
import me.chayapak1.chomens_bot.selfCares.essentials.MuteSelfCare;
|
||||
import me.chayapak1.chomens_bot.selfCares.essentials.NicknameSelfCare;
|
||||
import me.chayapak1.chomens_bot.selfCares.essentials.SocialSpySelfCare;
|
||||
import me.chayapak1.chomens_bot.selfCares.essentials.VanishSelfCare;
|
||||
import me.chayapak1.chomens_bot.selfCares.essentials.*;
|
||||
import me.chayapak1.chomens_bot.selfCares.kaboom.commandSpy.CommandSpySelfCare;
|
||||
import me.chayapak1.chomens_bot.selfCares.kaboom.extras.PrefixSelfCare;
|
||||
import me.chayapak1.chomens_bot.selfCares.kaboom.extras.UsernameSelfCare;
|
||||
@@ -59,6 +56,7 @@ public class SelfCarePlugin implements Listener {
|
||||
// essentials
|
||||
selfCares.add(new VanishSelfCare(bot));
|
||||
selfCares.add(new NicknameSelfCare(bot));
|
||||
selfCares.add(new GodModeSelfCare(bot));
|
||||
selfCares.add(new SocialSpySelfCare(bot));
|
||||
selfCares.add(new MuteSelfCare(bot));
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package me.chayapak1.chomens_bot.selfCares.essentials;
|
||||
|
||||
import me.chayapak1.chomens_bot.Bot;
|
||||
import me.chayapak1.chomens_bot.data.selfCare.EssentialsSelfCare;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
public class GodModeSelfCare extends EssentialsSelfCare {
|
||||
public GodModeSelfCare (final Bot bot) {
|
||||
super(bot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRun () {
|
||||
return bot.serverFeatures.hasEssentials && bot.config.selfCare.god;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived (final Component component, final String string) {
|
||||
if (string.equals(messages.godModeEnable)) this.needsRunning = false;
|
||||
else if (string.startsWith(messages.godModeDisable)) this.needsRunning = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run () {
|
||||
this.runCommand("essentials:godmode " + getUsernameOrBlank() + "enable");
|
||||
}
|
||||
}
|
||||
@@ -113,6 +113,7 @@ selfCare:
|
||||
# essentials
|
||||
vanish: true
|
||||
nickname: true
|
||||
god: true
|
||||
socialspy: true
|
||||
mute: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user