3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-02 17:40:09 +01:00

cache min/max for cuboid region

Dieser Commit ist enthalten in:
Jesse Boyd 2019-11-04 20:04:41 +00:00
Ursprung b224457464
Commit 6142f30715
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 59F1DE6293AF6E1F

Datei anzeigen

@ -51,6 +51,8 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
private boolean useOldIterator; private boolean useOldIterator;
private int minX, minY, minZ, maxX, maxY, maxZ; private int minX, minY, minZ, maxX, maxY, maxZ;
private BlockVector3 min;
private BlockVector3 max;
private BlockVector3 pos1; private BlockVector3 pos1;
private BlockVector3 pos2; private BlockVector3 pos2;
@ -139,6 +141,8 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
maxX = max.getBlockX(); maxX = max.getBlockX();
maxY = max.getBlockY(); maxY = max.getBlockY();
maxZ = max.getBlockZ(); maxZ = max.getBlockZ();
min = BlockVector3.at(minX, minY, minZ);
max = BlockVector3.at(maxX, maxY, maxZ);
} }
/** /**
@ -186,22 +190,22 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
@Override @Override
public BlockVector3 getMinimumPoint() { public BlockVector3 getMinimumPoint() {
return pos1.getMinimum(pos2); return min;
} }
@Override @Override
public BlockVector3 getMaximumPoint() { public BlockVector3 getMaximumPoint() {
return pos1.getMaximum(pos2); return max;
} }
@Override @Override
public int getMinimumY() { public int getMinimumY() {
return Math.min(pos1.getBlockY(), pos2.getBlockY()); return minY;
} }
@Override @Override
public int getMaximumY() { public int getMaximumY() {
return Math.max(pos1.getBlockY(), pos2.getBlockY()); return maxY;
} }
@Override @Override