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() {
|
public void incrementCurrentBlock() {
|
||||||
if (withPos == null) return;
|
if (withPos == null) return;
|
||||||
int x = block.getX();
|
|
||||||
|
int x = block.getX() + 1;
|
||||||
int y = block.getY();
|
int y = block.getY();
|
||||||
int z = block.getZ();
|
int z = block.getZ();
|
||||||
|
|
||||||
x++;
|
|
||||||
|
|
||||||
if (x > withPos.getMaxX()) {
|
if (x > withPos.getMaxX()) {
|
||||||
x = withPos.getMinX();
|
x = withPos.getMinX();
|
||||||
z++;
|
z++;
|
||||||
}
|
if (z > withPos.getMaxZ()) {
|
||||||
|
z = withPos.getMinZ();
|
||||||
if (z > withPos.getMaxZ()) {
|
y++;
|
||||||
z = withPos.getMinZ();
|
if (y > withPos.getMaxY()) {
|
||||||
y++;
|
y = withPos.getMinY();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (y > withPos.getMaxY()) {
|
|
||||||
x = withPos.getMinX();
|
|
||||||
y = withPos.getMinY();
|
|
||||||
z = withPos.getMinZ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
block = new BlockPos(x, y, z);
|
block = new BlockPos(x, y, z);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue