public interface BlockVolume
Modifier and Type | Method and Description |
---|---|
boolean |
containsBlock(int x,
int y,
int z)
Returns true if the block volume contains a block at the specified
position.
|
default boolean |
containsBlock(com.flowpowered.math.vector.Vector3i position)
Returns true if the block volume contains a block at the specified
position.
|
BlockState |
getBlock(int x,
int y,
int z)
Gets a representation of the block at the given position.
|
default BlockState |
getBlock(com.flowpowered.math.vector.Vector3i position)
Gets a representation of the block at the given position.
|
default MutableBlockVolume |
getBlockCopy()
Returns a mutable copy of the blocks stored in this volume.
|
MutableBlockVolume |
getBlockCopy(StorageType type)
Returns a mutable copy of the blocks stored in this volume.
|
com.flowpowered.math.vector.Vector3i |
getBlockMax()
Gets the block location with the highest x, y and z that is still a valid
position for
getBlock(Vector3i) . |
com.flowpowered.math.vector.Vector3i |
getBlockMin()
Gets the block location with the lowest x, y and z that is still a valid
position for
getBlock(Vector3i) . |
com.flowpowered.math.vector.Vector3i |
getBlockSize()
Gets the size of the whole volume.
|
BlockType |
getBlockType(int x,
int y,
int z)
Gets the base type of block.
|
default BlockType |
getBlockType(com.flowpowered.math.vector.Vector3i position)
Gets the base type of block.
|
BlockVolume |
getBlockView(DiscreteTransform3 transform)
Returns a new volume that is viewed through some transformation.
|
BlockVolume |
getBlockView(com.flowpowered.math.vector.Vector3i newMin,
com.flowpowered.math.vector.Vector3i newMax)
Returns a new volume that is the same or smaller than the current volume.
|
BlockVolumeWorker<? extends BlockVolume> |
getBlockWorker()
Gets a new block worker for this block volume.
|
ImmutableBlockVolume |
getImmutableBlockCopy()
Returns an immutable copy of the blocks stored in this volume.
|
default BlockVolume |
getRelativeBlockView()
Returns a new volume that is translated so that
getBlockMin() returns Vector3i.ZERO . |
UnmodifiableBlockVolume |
getUnmodifiableBlockView()
Returns a new volume that cannot be modified through this view.
|
com.flowpowered.math.vector.Vector3i getBlockMin()
getBlock(Vector3i)
.com.flowpowered.math.vector.Vector3i getBlockMax()
getBlock(Vector3i)
.com.flowpowered.math.vector.Vector3i getBlockSize()
getBlockMax()
- getBlockMin()
+ (1, 1, 1)
.default boolean containsBlock(com.flowpowered.math.vector.Vector3i position)
{getBlockMin()
<= position <=
getBlockMax()
position
- The position to checkboolean containsBlock(int x, int y, int z)
{getBlockMin()
<= (x, y, z)
<= getBlockMax()
x
- The X coordinate to checky
- The Y coordinate to checkz
- The Z coordinate to checkdefault BlockState getBlock(com.flowpowered.math.vector.Vector3i position)
position
- The positionPositionOutOfBoundsException
- If the position is outside of the
bounds of the volumeBlockState getBlock(int x, int y, int z)
x
- The X positiony
- The Y positionz
- The Z positionPositionOutOfBoundsException
- If the position is outside of the
bounds of the volumedefault BlockType getBlockType(com.flowpowered.math.vector.Vector3i position)
The type does not include block data such as the contents of inventories.
position
- The position of the blockPositionOutOfBoundsException
- If the position is outside of the
bounds of the block volumeBlockType getBlockType(int x, int y, int z)
The type does not include block data such as the contents of inventories.
x
- The X positiony
- The Y positionz
- The Z positionPositionOutOfBoundsException
- If the position is outside of the
bounds of the block volumeBlockVolume getBlockView(com.flowpowered.math.vector.Vector3i newMin, com.flowpowered.math.vector.Vector3i newMax)
newMin
- The new minimum coordinates in this volumenewMax
- The new maximum coordinates in this volumePositionOutOfBoundsException
- If the new minimum and maximum are
outside the current volumeBlockVolume getBlockView(DiscreteTransform3 transform)
transform
- The transformation to be applieddefault BlockVolume getRelativeBlockView()
getBlockMin()
returns Vector3i.ZERO
. This
does not copy the blocks, it only provides a new view of the storage.UnmodifiableBlockVolume getUnmodifiableBlockView()
default MutableBlockVolume getBlockCopy()
StorageType.STANDARD
.MutableBlockVolume getBlockCopy(StorageType type)
type
- The type of storage used by the new blocksImmutableBlockVolume getImmutableBlockCopy()
BlockVolumeWorker<? extends BlockVolume> getBlockWorker()