From a5b8ff6eb91d9e3653594eae05c25d2a59afb868 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 23 Jul 2023 07:08:17 +0700 Subject: [PATCH] move back to this method --- .../chayapak/chomens_bot/plugins/CorePlugin.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java index 4482c50..0449aa7 100644 --- a/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java +++ b/src/main/java/land/chipmunk/chayapak/chomens_bot/plugins/CorePlugin.java @@ -52,8 +52,6 @@ public class CorePlugin extends PositionPlugin.Listener { private int nextTransactionId = 0; private final Map> transactions = new HashMap<>(); - private final List afterTicks = new ArrayList<>(); - private final boolean kaboom; private int commandsPerSecond = 0; @@ -165,7 +163,9 @@ public class CorePlugin extends PositionPlugin.Listener { final CompletableFuture future = new CompletableFuture<>(); transactions.put(transactionId, future); - afterTicks.add(() -> bot.session.send(new ServerboundBlockEntityTagQuery(transactionId, beforeBlock))); + final Runnable afterTick = () -> bot.session.send(new ServerboundBlockEntityTagQuery(transactionId, beforeBlock)); + + bot.executor.schedule(afterTick, 50, TimeUnit.MILLISECONDS); return future; } @@ -199,16 +199,6 @@ public class CorePlugin extends PositionPlugin.Listener { public void packetReceived (ClientboundBlockUpdatePacket packet) { final BlockChangeEntry entry = packet.getEntry(); - if (isCommandBlockUpdate(entry.getBlock())) { - for (Runnable runnable : afterTicks) { - runnable.run(); - } - - afterTicks.clear(); - - return; - } - final Vector3i position = entry.getPosition(); if (isCore(position)) shouldRefill = true;