refactor: make core increment a bit faster (from chomens bot)

This commit is contained in:
Chayapak Supasakul 2025-03-15 19:04:14 +07:00
parent c2313ee650
commit e088c1fec1
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -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);