mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
More code quality fixes
This commit is contained in:
@ -172,10 +172,10 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
||||
final BlockVector3 min = getMinimumPoint().divide(16);
|
||||
final BlockVector3 max = getMaximumPoint().divide(16);
|
||||
|
||||
for (int X = min.getBlockX(); X <= max.getBlockX(); ++X) {
|
||||
for (int Z = min.getBlockZ(); Z <= max.getBlockZ(); ++Z) {
|
||||
if (containsChunk(X, Z)) {
|
||||
chunks.add(BlockVector2.at(X, Z));
|
||||
for (int x = min.getBlockX(); x <= max.getBlockX(); ++x) {
|
||||
for (int z = min.getBlockZ(); z <= max.getBlockZ(); ++z) {
|
||||
if (containsChunk(x, z)) {
|
||||
chunks.add(BlockVector2.at(x, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -124,8 +124,8 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
if (pos1 == null || pos2 == null) {
|
||||
return;
|
||||
}
|
||||
pos1 = pos1.clampY(world == null ? 0 : 0, world == null ? FaweCache.WORLD_MAX_Y : world.getMaxY());
|
||||
pos2 = pos2.clampY(world == null ? 0 : 0, world == null ? FaweCache.WORLD_MAX_Y : world.getMaxY());
|
||||
pos1 = pos1.clampY(world == null ? 0 : 0, world == null ? FaweCache.worldMaxY : world.getMaxY());
|
||||
pos2 = pos2.clampY(world == null ? 0 : 0, world == null ? FaweCache.worldMaxY : world.getMaxY());
|
||||
minX = Math.min(pos1.getX(), pos2.getX());
|
||||
minY = Math.min(pos1.getY(), pos2.getY());
|
||||
minZ = Math.min(pos1.getZ(), pos2.getZ());
|
||||
@ -730,7 +730,7 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
boolean trimZ = lowerZ != 0 || upperZ != 15;
|
||||
|
||||
int indexY, index;
|
||||
for (int layer = 0; layer < FaweCache.CHUNK_LAYERS; layer++) {
|
||||
for (int layer = 0; layer < FaweCache.chunkLayers; layer++) {
|
||||
if (set.hasSection(layer)) {
|
||||
char[] arr = set.load(layer);
|
||||
if (trimX || trimZ) {
|
||||
|
@ -67,9 +67,7 @@ public interface Region extends Iterable<BlockVector3>, Cloneable, IBatchProcess
|
||||
*
|
||||
* @return center point
|
||||
*/
|
||||
default Vector3 getCenter() {
|
||||
return getMinimumPoint().add(getMaximumPoint()).toVector3().divide(2);
|
||||
}
|
||||
Vector3 getCenter();
|
||||
|
||||
/**
|
||||
* Get the number of blocks in the region.
|
||||
@ -195,17 +193,9 @@ public interface Region extends Iterable<BlockVector3>, Cloneable, IBatchProcess
|
||||
*/
|
||||
List<BlockVector2> polygonize(int maxPoints);
|
||||
|
||||
default int getMinimumY() {
|
||||
return getMinimumPoint().getY();
|
||||
}
|
||||
|
||||
default int getMaximumY() {
|
||||
return getMaximumPoint().getY();
|
||||
}
|
||||
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, boolean full) {
|
||||
int minSection = Math.max(0, getMinimumY() >> 4);
|
||||
int maxSection = Math.min(15, getMaximumY() >> 4);
|
||||
int minSection = Math.max(0, getMinimumPoint().getBlockY() >> 4);
|
||||
int maxSection = Math.min(15, getMaximumPoint().getBlockY() >> 4);
|
||||
for (int layer = minSection; layer <= maxSection; layer++) {
|
||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(chunk, layer)) return;
|
||||
block = block.initLayer(get, set, layer);
|
||||
|
Reference in New Issue
Block a user