From e088c1fec10f306f1bd4c582abb320d798973b66 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+chomens@users.noreply.github.com> Date: Sat, 15 Mar 2025 19:04:14 +0700 Subject: [PATCH] refactor: make core increment a bit faster (from chomens bot) --- .../chipmunkmod/modules/CommandCore.java | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index 3cb5ceb..e3d43ff 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -188,26 +188,21 @@ public class CommandCore { public void incrementCurrentBlock() { if (withPos == null) return; - int x = block.getX(); + + int x = block.getX() + 1; int y = block.getY(); int z = block.getZ(); - x++; - if (x > withPos.getMaxX()) { x = withPos.getMinX(); z++; - } - - if (z > withPos.getMaxZ()) { - z = withPos.getMinZ(); - y++; - } - - if (y > withPos.getMaxY()) { - x = withPos.getMinX(); - y = withPos.getMinY(); - z = withPos.getMinZ(); + if (z > withPos.getMaxZ()) { + z = withPos.getMinZ(); + y++; + if (y > withPos.getMaxY()) { + y = withPos.getMinY(); + } + } } block = new BlockPos(x, y, z);