From 1604b0a996d758e3344e703d32ede26b2c6fff16 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 24 Sep 2023 09:12:33 +0700 Subject: [PATCH] FIXIES AUTO REFILL ?? --- .../chipmunkmod/modules/CommandCore.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index 5ce23e7..0c4de57 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -70,13 +70,17 @@ public class CommandCore { timer.schedule(task, 50, 50); - timer.schedule(refillTask, 50, 900); + timer.schedule(refillTask, 50, 1000); } private void tick () { final ClientPlayNetworkHandler networkHandler = client.getNetworkHandler(); - if (networkHandler == null) cleanup(); + if (networkHandler == null) { + cleanup(); + + return; + } reloadRelativeArea(); @@ -92,10 +96,10 @@ public class CommandCore { if (networkHandler == null || withPos == null) return; - for (int x = withPos.start.getX(); x <= withPos.end.getX(); x++) { - for (int y = withPos.start.getY(); y <= withPos.end.getY(); y++) { - for (int z = withPos.start.getZ(); z <= withPos.end.getZ(); z++) { - try { + try { + for (int x = withPos.start.getX(); x <= withPos.end.getX(); x++) { + for (int y = withPos.start.getY(); y <= withPos.end.getY(); y++) { + for (int z = withPos.start.getZ(); z <= withPos.end.getZ(); z++) { final BlockPos pos = new BlockPos(x, y, z); final ClientWorld world = client.world; @@ -109,11 +113,11 @@ public class CommandCore { shouldRefill = true; return; - } catch (Exception e) { - e.printStackTrace(); } } } + } catch (Exception e) { + e.printStackTrace(); } }