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;