mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
*
A tribute to Jesse
This commit is contained in:
@ -120,6 +120,7 @@ public abstract class AbstractRegion extends AbstractSet<BlockVector3> implement
|
||||
(max.getY() - min.getY() + 1) *
|
||||
(max.getZ() - min.getZ() + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get X-size.
|
||||
*
|
||||
|
@ -412,6 +412,11 @@ public class CuboidRegion extends AbstractRegion implements FlatRegion {
|
||||
return x >= this.minX && x <= this.maxX && z >= this.minZ && z <= this.maxZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(BlockVector3 position) {
|
||||
return contains(position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<BlockVector3> iterator() {
|
||||
if (Settings.IMP.HISTORY.COMPRESSION_LEVEL >= 9 || useOldIterator) {
|
||||
|
@ -35,7 +35,6 @@ import com.sk89q.worldedit.math.geom.Polygons;
|
||||
import com.sk89q.worldedit.regions.iterator.FlatRegion3DIterator;
|
||||
import com.sk89q.worldedit.regions.iterator.FlatRegionIterator;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@ -327,6 +326,11 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
return dx * dx + dz * dz <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(BlockVector3 position) {
|
||||
return contains(position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the height of the cylinder to fit the specified Y.
|
||||
*
|
||||
@ -411,7 +415,8 @@ 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) {
|
||||
public void filter(final IChunk chunk, final Filter filter, final ChunkFilterBlock block,
|
||||
final IChunkGet get, final IChunkSet set) {
|
||||
int bcx = chunk.getX() >> 4;
|
||||
int bcz = chunk.getZ() >> 4;
|
||||
int tcx = bcx + 15;
|
||||
|
@ -104,7 +104,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return Math.max((int) (2 * radius.getY()), 256);
|
||||
return (int) (2 * radius.getY());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -246,6 +246,11 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
return cxd + cyd + czd <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(BlockVector3 position) {
|
||||
return position.subtract(center).toVector3().divide(radius).lengthSq() <= 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(int x, int z) {
|
||||
int cx = x - center.getBlockX();
|
||||
|
@ -141,9 +141,7 @@ public interface Region extends Iterable<BlockVector3>, Cloneable {
|
||||
* @param position the position
|
||||
* @return true if contained
|
||||
*/
|
||||
default boolean contains(BlockVector3 position) {
|
||||
return contains(position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
boolean contains(BlockVector3 position);
|
||||
|
||||
/**
|
||||
* Get a list of chunks.
|
||||
|
Reference in New Issue
Block a user