public class CuboidRegion extends AbstractRegion implements FlatRegion
world
Constructor and Description |
---|
CuboidRegion(BlockVector3 pos1,
BlockVector3 pos2)
Construct a new instance of this cuboid using two corners of the cuboid.
|
CuboidRegion(World world,
BlockVector3 pos1,
BlockVector3 pos2)
Construct a new instance of this cuboid using two corners of the cuboid.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<BlockVector2> |
asFlatRegion()
Get this region as an iterable flat region.
|
CuboidRegion |
clone()
Make a clone of the region.
|
boolean |
contains(BlockVector3 position)
Returns true based on whether the region contains the point.
|
void |
contract(BlockVector3... changes)
Contract the region.
|
void |
expand(BlockVector3... changes)
Expand the region.
|
static CuboidRegion |
fromCenter(BlockVector3 origin,
int apothem)
Make a cuboid from the center.
|
CuboidRegion |
getBoundingBox()
Get the bounding box of this region as a
CuboidRegion . |
java.util.Set<BlockVector3> |
getChunkCubes()
Return a list of 16*16*16 chunks in a region.
|
java.util.Set<BlockVector2> |
getChunks()
Get a list of chunks.
|
Region |
getFaces()
Get a region that contains the faces of this cuboid.
|
BlockVector3 |
getMaximumPoint()
Get the upper point of a region.
|
int |
getMaximumY()
Gets the maximum Y value.
|
BlockVector3 |
getMinimumPoint()
Get the lower point of a region.
|
int |
getMinimumY()
Gets the minimum Y value.
|
BlockVector3 |
getPos1()
Get the first cuboid-defining corner.
|
BlockVector3 |
getPos2()
Get the second cuboid-defining corner.
|
Region |
getWalls()
Get a region that contains the walls (all faces but the ones parallel to
the X-Z plane) of this cuboid.
|
java.util.Iterator<BlockVector3> |
iterator()
Get the iterator.
|
static CuboidRegion |
makeCuboid(Region region)
Make a cuboid region out of the given region using the minimum and maximum
bounds of the provided region.
|
void |
setPos1(BlockVector3 pos1)
Set the first cuboid-defining corner.
|
void |
setPos2(BlockVector3 pos2)
Set the second cuboid-defining corner.
|
void |
shift(BlockVector3 change)
Shift the region.
|
java.lang.String |
toString() |
getCenter, getHeight, getLength, getVolume, getWidth, getWorld, getWorldMaxY, getWorldMinY, polygonize, setWorld
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public CuboidRegion(BlockVector3 pos1, BlockVector3 pos2)
pos1
- the first positionpos2
- the second positionpublic CuboidRegion(World world, BlockVector3 pos1, BlockVector3 pos2)
world
- the worldpos1
- the first positionpos2
- the second positionpublic BlockVector3 getPos1()
public void setPos1(BlockVector3 pos1)
pos1
- a positionpublic BlockVector3 getPos2()
public void setPos2(BlockVector3 pos2)
pos2
- a positionpublic Region getFaces()
public Region getWalls()
public BlockVector3 getMinimumPoint()
Region
getMinimumPoint
in interface Region
public BlockVector3 getMaximumPoint()
Region
getMaximumPoint
in interface Region
public CuboidRegion getBoundingBox()
Region
CuboidRegion
.getBoundingBox
in interface Region
public int getMinimumY()
FlatRegion
getMinimumY
in interface FlatRegion
public int getMaximumY()
FlatRegion
getMaximumY
in interface FlatRegion
public void expand(BlockVector3... changes)
Region
public void contract(BlockVector3... changes)
Region
public void shift(BlockVector3 change) throws RegionOperationException
Region
shift
in interface Region
shift
in class AbstractRegion
change
- the changeRegionOperationException
- if the operation cannot be performedpublic java.util.Set<BlockVector2> getChunks()
AbstractRegion
getChunks
in interface Region
getChunks
in class AbstractRegion
public java.util.Set<BlockVector3> getChunkCubes()
Region
getChunkCubes
in interface Region
getChunkCubes
in class AbstractRegion
public boolean contains(BlockVector3 position)
Region
public java.util.Iterator<BlockVector3> iterator()
AbstractRegion
iterator
in interface java.lang.Iterable<BlockVector3>
iterator
in class AbstractRegion
public java.lang.Iterable<BlockVector2> asFlatRegion()
FlatRegion
asFlatRegion
in interface FlatRegion
public java.lang.String toString()
toString
in class java.lang.Object
public CuboidRegion clone()
Region
clone
in interface Region
clone
in class AbstractRegion
public static CuboidRegion makeCuboid(Region region)
region
- the regionpublic static CuboidRegion fromCenter(BlockVector3 origin, int apothem)
origin
- the originapothem
- the apothem, where 0 is the minimum value to make a 1x1 cuboid