some stuff

This commit is contained in:
ChomeNS
2023-05-09 09:45:32 +07:00
parent f5782d470a
commit c1a3968124
4 changed files with 7 additions and 6 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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) {

View File

@@ -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