mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 21:06:16 +00:00
refactor: make core increment a bit faster (from chomens bot)
This commit is contained in:
parent
c2313ee650
commit
e088c1fec1
1 changed files with 9 additions and 14 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
block = new BlockPos(x, y, z);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue