This commit is contained in:
Jesse Boyd 2017-03-18 16:56:53 +11:00
parent 26404fc9db
commit 6ac7782d9a
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -576,16 +576,16 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
@Override
public boolean hasNext() {
return (nextX != Integer.MIN_VALUE);
return (nextZ != Integer.MIN_VALUE);
}
@Override
public Vector2D next() {
if (!hasNext()) throw new java.util.NoSuchElementException();
Vector2D answer = mutable.setComponents(nextX, nextZ);
if (++nextZ > max.getBlockZ()) {
nextZ = min.getBlockZ();
if (++nextX > max.getBlockX()) {
if (++nextX > max.getBlockX()) {
nextX = min.getBlockX();
if (++nextZ > max.getBlockZ()) {
nextZ = Integer.MIN_VALUE;
}
}