public class CuboidRegion extends AbstractRegion implements FlatRegion
world
Constructor and Description |
---|
CuboidRegion(Vector pos1,
Vector pos2)
Construct a new instance of this cuboid using two corners of the cuboid.
|
CuboidRegion(World world,
Vector pos1,
Vector pos2)
Construct a new instance of this cuboid using two corners of the cuboid.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Vector2D> |
asFlatRegion()
Get this region as an iterable flat region.
|
CuboidRegion |
clone()
Make a clone of the region.
|
boolean |
contains(Vector position)
Returns true based on whether the region contains the point.
|
void |
contract(Vector... changes)
Contract the region.
|
void |
expand(Vector... changes)
Expand the region.
|
static CuboidRegion |
fromCenter(Vector origin,
int apothem)
Make a cuboid from the center.
|
java.util.Set<Vector> |
getChunkCubes()
Return a list of 16*16*16 chunks in a region
|
java.util.Set<Vector2D> |
getChunks()
Get a list of chunks.
|
Region |
getFaces()
Get a region that contains the faces of this cuboid.
|
Vector |
getMaximumPoint()
Get the upper point of a region.
|
int |
getMaximumY()
Gets the maximum Y value
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
int |
getMinimumY()
Gets the minimum Y value
|
Vector |
getPos1()
Get the first cuboid-defining corner.
|
Vector |
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<BlockVector> |
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(Vector pos1)
Set the first cuboid-defining corner.
|
void |
setPos2(Vector pos2)
Set the second cuboid-defining corner.
|
void |
shift(Vector change)
Shift the region.
|
java.lang.String |
toString() |
getArea, getCenter, getHeight, getLength, getWidth, getWorld, polygonize, setWorld
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public CuboidRegion(Vector pos1, Vector pos2)
pos1
- the first positionpos2
- the second positionpublic Vector getPos1()
public void setPos1(Vector pos1)
pos1
- a positionpublic Vector getPos2()
public void setPos2(Vector pos2)
pos2
- a positionpublic Region getFaces()
public Region getWalls()
public Vector getMinimumPoint()
Region
getMinimumPoint
in interface Region
public Vector getMaximumPoint()
Region
getMaximumPoint
in interface Region
public int getMinimumY()
FlatRegion
getMinimumY
in interface FlatRegion
public int getMaximumY()
FlatRegion
getMaximumY
in interface FlatRegion
public void expand(Vector... changes)
Region
public void contract(Vector... changes)
Region
public void shift(Vector change) throws RegionOperationException
Region
shift
in interface Region
shift
in class AbstractRegion
change
- the changeRegionOperationException
public java.util.Set<Vector2D> getChunks()
AbstractRegion
getChunks
in interface Region
getChunks
in class AbstractRegion
public java.util.Set<Vector> getChunkCubes()
Region
getChunkCubes
in interface Region
getChunkCubes
in class AbstractRegion
public boolean contains(Vector position)
Region
public java.util.Iterator<BlockVector> iterator()
AbstractRegion
iterator
in interface java.lang.Iterable<BlockVector>
iterator
in class AbstractRegion
public java.lang.Iterable<Vector2D> 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(Vector origin, int apothem)
origin
- the originapothem
- the apothem, where 0 is the minimum value to make a 1x1 cuboid