mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
Various minor
Disable P2's we region restrictions (so that it uses FAWE's) Fix extent binding Fix filtering on null sections
This commit is contained in:
@ -671,14 +671,14 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set) {
|
||||
public void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, boolean full) {
|
||||
int chunkX = chunk.getX();
|
||||
int chunkZ = chunk.getZ();
|
||||
block = block.init(chunkX, chunkZ, get);
|
||||
|
||||
|
||||
if ((minX + 15) >> 4 <= chunkX && (maxX - 15) >> 4 >= chunkX && (minZ + 15) >> 4 <= chunkZ && (maxZ - 15) >> 4 >= chunkZ) {
|
||||
filter(chunk, filter, block, get, set, minY, maxY);
|
||||
filter(chunk, filter, block, get, set, minY, maxY, full);
|
||||
return;
|
||||
}
|
||||
int localMinX = Math.max(minX, chunkX << 4) & 15;
|
||||
@ -692,19 +692,19 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
int minSection = minY >> 4;
|
||||
int maxSection = maxY >> 4;
|
||||
if (minSection == maxSection) {
|
||||
filter(chunk, filter, block, get, set, minSection, localMinX, yStart, localMinZ, localMaxX, yEnd, localMaxZ);
|
||||
filter(chunk, filter, block, get, set, minSection, localMinX, yStart, localMinZ, localMaxX, yEnd, localMaxZ, full);
|
||||
return;
|
||||
}
|
||||
if (yStart != 0) {
|
||||
filter(chunk, filter, block, get, set, minSection, localMinX, yStart, localMinZ, localMaxX, 15, localMaxZ);
|
||||
filter(chunk, filter, block, get, set, minSection, localMinX, yStart, localMinZ, localMaxX, 15, localMaxZ, full);
|
||||
minSection++;
|
||||
}
|
||||
if (yEnd != 15) {
|
||||
filter(chunk, filter, block, get, set, minSection, localMinX, 0, localMinZ, localMaxX, 15, localMaxZ);
|
||||
filter(chunk, filter, block, get, set, minSection, localMinX, 0, localMinZ, localMaxX, 15, localMaxZ, full);
|
||||
maxSection--;
|
||||
}
|
||||
for (int layer = minSection; layer <= maxSection; layer++) {
|
||||
filter(chunk, filter, block, get, set, layer, localMinX, yStart, localMinZ, localMaxX, yEnd, localMaxZ);
|
||||
filter(chunk, filter, block, get, set, layer, localMinX, yStart, localMinZ, localMaxX, yEnd, localMaxZ, full);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -406,15 +406,15 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
|
||||
@Override
|
||||
public void filter(final IChunk chunk, final Filter filter, final ChunkFilterBlock block,
|
||||
final IChunkGet get, final IChunkSet set) {
|
||||
final IChunkGet get, final IChunkSet set, boolean full) {
|
||||
int bcx = chunk.getX() >> 4;
|
||||
int bcz = chunk.getZ() >> 4;
|
||||
int tcx = bcx + 15;
|
||||
int tcz = bcz + 15;
|
||||
if (contains(bcx, bcz) && contains(tcx, tcz)) {
|
||||
filter(chunk, filter, block, get, set, minY, maxY);
|
||||
filter(chunk, filter, block, get, set, minY, maxY, full);
|
||||
return;
|
||||
}
|
||||
super.filter(chunk, filter, block, get, set);
|
||||
super.filter(chunk, filter, block, get, set, full);
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set) {
|
||||
public void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, boolean full) {
|
||||
// Check bounds
|
||||
// This needs to be able to perform 50M blocks/sec otherwise it becomes a bottleneck
|
||||
int cx = center.getBlockX();
|
||||
@ -385,7 +385,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
int yBotFull = Math.max(0, cy - diffYFull);
|
||||
int yTopFull = Math.min(255, cy + diffYFull);
|
||||
// Set those layers
|
||||
filter(chunk, filter, block, get, set, yBotFull, yTopFull);
|
||||
filter(chunk, filter, block, get, set, yBotFull, yTopFull, full);
|
||||
|
||||
// Fill the remaining layers
|
||||
if (yBotFull != 0 || yTopFull != 255) {
|
||||
@ -405,7 +405,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
|
||||
|
||||
} else {
|
||||
super.filter(chunk, filter, block, get, set); // TODO optimize non spheres
|
||||
super.filter(chunk, filter, block, get, set, full); // TODO optimize non spheres
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -203,53 +203,53 @@ public interface Region extends Iterable<BlockVector3>, Cloneable, IBatchProcess
|
||||
return getMaximumPoint().getY();
|
||||
}
|
||||
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set) {
|
||||
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);
|
||||
for (int layer = minSection; layer <= maxSection; layer++) {
|
||||
if (!get.hasSection(layer) || !filter.appliesLayer(chunk, layer)) return;
|
||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(chunk, layer)) return;
|
||||
block = block.init(get, set, layer);
|
||||
block.filter(filter, this);
|
||||
}
|
||||
}
|
||||
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, final int minY, final int maxY) {
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, final int minY, final int maxY, boolean full) {
|
||||
int minSection = minY >> 4;
|
||||
int maxSection = maxY >> 4;
|
||||
int yStart = (minY & 15);
|
||||
int yEnd = (maxY & 15);
|
||||
if (minSection == maxSection) {
|
||||
filter(chunk, filter, block, get, set, minSection, yStart, yEnd);
|
||||
filter(chunk, filter, block, get, set, minSection, yStart, yEnd, full);
|
||||
return;
|
||||
}
|
||||
if (yStart != 0) {
|
||||
filter(chunk, filter, block, get, set, minSection, yStart, 15);
|
||||
filter(chunk, filter, block, get, set, minSection, yStart, 15, full);
|
||||
minSection++;
|
||||
}
|
||||
if (yEnd != 15) {
|
||||
filter(chunk, filter, block, get, set, minSection, 0, yEnd);
|
||||
filter(chunk, filter, block, get, set, minSection, 0, yEnd, full);
|
||||
maxSection--;
|
||||
}
|
||||
for (int layer = minSection; layer <= maxSection; layer++) {
|
||||
filter(chunk, filter, block, get, set, layer);
|
||||
filter(chunk, filter, block, get, set, layer, full);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, int layer) {
|
||||
if (!get.hasSection(layer) || !filter.appliesLayer(chunk, layer)) return;
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, int layer, boolean full) {
|
||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(chunk, layer)) return;
|
||||
block = block.init(get, set, layer);
|
||||
block.filter(filter);
|
||||
}
|
||||
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, int layer, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) {
|
||||
if (!get.hasSection(layer) || !filter.appliesLayer(chunk, layer)) return;
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, int layer, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean full) {
|
||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(chunk, layer)) return;
|
||||
block = block.init(get, set, layer);
|
||||
block.filter(filter, minX, minY, minZ, maxX, maxY, maxZ);
|
||||
}
|
||||
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, int layer, int yStart, int yEnd) {
|
||||
if (!get.hasSection(layer) || !filter.appliesLayer(chunk, layer)) return;
|
||||
default void filter(final IChunk chunk, final Filter filter, ChunkFilterBlock block, final IChunkGet get, final IChunkSet set, int layer, int yStart, int yEnd, boolean full) {
|
||||
if ((!full && !get.hasSection(layer)) || !filter.appliesLayer(chunk, layer)) return;
|
||||
block = block.init(get, set, layer);
|
||||
block.filter(filter, yStart, yEnd);
|
||||
}
|
||||
|
Reference in New Issue
Block a user