some stuff
This commit is contained in:
@@ -61,8 +61,6 @@ public class Configuration {
|
||||
}
|
||||
|
||||
public static class SelfCare {
|
||||
@Getter public int checkInterval;
|
||||
|
||||
@Getter public boolean op = true;
|
||||
@Getter public boolean gamemode = true;
|
||||
@Getter public boolean endCredits = true;
|
||||
|
||||
@@ -19,6 +19,7 @@ import land.chipmunk.chayapak.chomens_bot.util.ComponentUtilities;
|
||||
import land.chipmunk.chayapak.chomens_bot.util.IllegalCharactersUtilities;
|
||||
import land.chipmunk.chayapak.chomens_bot.util.UUIDUtilities;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TranslatableComponent;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
@@ -37,11 +38,15 @@ public class ChatPlugin extends Bot.Listener {
|
||||
@Getter private final List<String> queue = new ArrayList<>();
|
||||
@Getter private final List<String> _queue = new ArrayList<>();
|
||||
|
||||
@Getter @Setter private int queueDelay;
|
||||
|
||||
private final List<Listener> listeners = new ArrayList<>();
|
||||
|
||||
public ChatPlugin (Bot bot) {
|
||||
this.bot = bot;
|
||||
|
||||
queueDelay = bot.config().chatQueueDelay();
|
||||
|
||||
this.commandSpyParser = new CommandSpyParser(bot);
|
||||
|
||||
bot.addListener(this);
|
||||
@@ -52,7 +57,7 @@ public class ChatPlugin extends Bot.Listener {
|
||||
chatParsers.add(new ChomeNSCustomChatParser(bot));
|
||||
|
||||
bot.executor().scheduleAtFixedRate(this::_sendChatTick, 0, 1, TimeUnit.MILLISECONDS);
|
||||
bot.executor().scheduleAtFixedRate(this::sendChatTick, 0, bot.config().chatQueueDelay(), TimeUnit.MILLISECONDS);
|
||||
bot.executor().scheduleAtFixedRate(this::sendChatTick, 0, queueDelay, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -149,7 +149,7 @@ public class SelfCarePlugin extends Bot.Listener {
|
||||
check();
|
||||
};
|
||||
|
||||
checkTask = bot.executor().scheduleAtFixedRate(task, 0, bot.config().selfCare().checkInterval(), TimeUnit.MILLISECONDS);
|
||||
checkTask = bot.executor().scheduleAtFixedRate(task, 0, bot.chat().queueDelay(), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
public void packetReceived (ClientboundGameEventPacket packet) {
|
||||
|
||||
@@ -47,8 +47,6 @@ core:
|
||||
# PLEASE give valid JSON component here else the core don't refill at all
|
||||
customName: '[{"text":"ChomeNS ","color":"yellow"},{"text":"Core","color":"green"},{"text":"™","color":"gold"}]'
|
||||
selfCare:
|
||||
checkInterval: 1000
|
||||
|
||||
# vanilla
|
||||
op: true
|
||||
gamemode: true
|
||||
|
||||
Reference in New Issue
Block a user