mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Fix entity bounding box traverse blocks iterate
Reset both x and y values on z level iteration , to prevent skip entire y level loop on z level iteration and cause some issues, e.g. inconsistent with vanilla
This commit is contained in:
@@ -46,7 +46,7 @@ public final class BlockPosIterator extends AbstractIterator<BlockPos> {
|
||||
MutableBlockPos pos = this.pos;
|
||||
if (pos == null) {
|
||||
return this.pos = new MutableBlockPos(this.startX, this.startY, this.startZ);
|
||||
} else {
|
||||
}
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
@@ -59,6 +59,7 @@ public final class BlockPosIterator extends AbstractIterator<BlockPos> {
|
||||
} else if (z < this.endZ) {
|
||||
z += 1;
|
||||
x = this.startX;
|
||||
y = this.startY; // Reset y also!
|
||||
} else {
|
||||
return this.endOfData();
|
||||
}
|
||||
@@ -66,5 +67,4 @@ public final class BlockPosIterator extends AbstractIterator<BlockPos> {
|
||||
pos.set(x, y, z);
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user