forked from ChomeNS/chomens-bot-java
improve prefix self care
the prefix self care is currently disabled/not used in the main instance but whatever..
This commit is contained in:
parent
43061c850b
commit
5ec213df39
3 changed files with 19 additions and 13 deletions
|
@ -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;
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue