Update to PlotSquared-we branch

This commit is contained in:
Jesse Boyd
2019-11-06 09:29:20 +00:00
parent 0bfb1dbdd1
commit 240b2de90c
27 changed files with 284 additions and 198 deletions

View File

@ -131,8 +131,8 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
if (pos1 == null || pos2 == null) {
return;
}
pos1 = pos1.clampY(world == null ? Integer.MIN_VALUE : 0, world == null ? Integer.MAX_VALUE : world.getMaxY());
pos2 = pos2.clampY(world == null ? Integer.MIN_VALUE : 0, world == null ? Integer.MAX_VALUE : world.getMaxY());
pos1 = pos1.clampY(world == null ? 0 : 0, world == null ? FaweCache.IMP.WORLD_MAX_Y : world.getMaxY());
pos2 = pos2.clampY(world == null ? 0 : 0, world == null ? FaweCache.IMP.WORLD_MAX_Y : world.getMaxY());
minX = Math.min(pos1.getX(), pos2.getX());
minY = Math.min(pos1.getY(), pos2.getY());
minZ = Math.min(pos1.getZ(), pos2.getZ());
@ -196,16 +196,6 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
return max;
}
@Override
public int getMinimumY() {
return minY;
}
@Override
public int getMaximumY() {
return maxY;
}
@Override
public void expand(BlockVector3... changes) {
checkNotNull(changes);
@ -655,15 +645,31 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
}
@Override
public int getMinY() {
public int getMinimumY() {
return minY;
}
@Override
public int getMaxY() {
public int getMaximumY() {
return maxY;
}
public int getMinimumX() {
return minX;
}
public int getMinimumZ() {
return minZ;
}
public int getMaximumX() {
return maxX;
}
public int getMaximumZ() {
return maxZ;
}
@Override
public void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set) {
int chunkX = chunk.getX();

View File

@ -385,16 +385,6 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
return Polygons.polygonizeCylinder(center, radius, maxPoints);
}
@Override
public int getMinY() {
return minY;
}
@Override
public int getMaxY() {
return maxY;
}
/**
* Return a new instance with the given center and radius in the X and Z
* axes with a Y that extends from the bottom of the extent to the top

View File

@ -195,17 +195,17 @@ public interface Region extends Iterable<BlockVector3>, Cloneable, IBatchProcess
*/
List<BlockVector2> polygonize(int maxPoints);
default int getMinY() {
default int getMinimumY() {
return getMinimumPoint().getY();
}
default int getMaxY() {
default int getMaximumY() {
return getMaximumPoint().getY();
}
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set) {
int minSection = Math.max(0, getMinY() >> 4);
int maxSection = Math.min(15, getMaxY() >> 4);
int minSection = Math.max(0, getMinimumY() >> 4);
int maxSection = Math.min(15, getMaximumY() >> 4);
for (int layer = minSection; layer <= maxSection; layer++) {
if (!get.hasSection(layer) || !filter.appliesLayer(chunk, layer)) return;
block = block.init(get, set, layer);