public interface ChunkLayout
| Modifier and Type | Method and Description |
|---|---|
default Optional<com.flowpowered.math.vector.Vector3i> |
addToChunk(int cx,
int cy,
int cz,
int ox,
int oy,
int oz)
Adds the chunk offset to the chunk coordinates.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
addToChunk(com.flowpowered.math.vector.Vector3i chunkCoords,
com.flowpowered.math.vector.Vector3i chunkOffset)
Adds the chunk offset to the chunk coordinates.
|
com.flowpowered.math.vector.Vector3i |
forceToChunk(int x,
int y,
int z)
Converts world coordinates to chunk coordinates.
|
default com.flowpowered.math.vector.Vector3i |
forceToChunk(com.flowpowered.math.vector.Vector3i worldCoords)
Converts world coordinates to chunk coordinates.
|
com.flowpowered.math.vector.Vector3i |
forceToWorld(int x,
int y,
int z)
Converts chunk coordinates to world coordinates.
|
default com.flowpowered.math.vector.Vector3i |
forceToWorld(com.flowpowered.math.vector.Vector3i chunkCoords)
Converts chunk coordinates to world coordinates.
|
com.flowpowered.math.vector.Vector3i |
getChunkSize()
Returns the size of the chunks in blocks.
|
com.flowpowered.math.vector.Vector3i |
getSpaceMax()
Returns the maximum coordinates for chunks for each axis.
|
com.flowpowered.math.vector.Vector3i |
getSpaceMin()
Returns the minimum coordinates for chunks for each axis.
|
com.flowpowered.math.vector.Vector3i |
getSpaceOrigin()
Returns the origin of the chunk coordinate space.
|
com.flowpowered.math.vector.Vector3i |
getSpaceSize()
Gets the total size of the chunk space, which is equivalent to
getSpaceMax() - getSpaceMin() + 1. |
boolean |
isInChunk(int x,
int y,
int z)
Returns true if the local coordinates fit in a chunk.
|
boolean |
isInChunk(int wx,
int wy,
int wz,
int cx,
int cy,
int cz)
Returns true if the world coordinates fit in the chunk at the given
coordinates.
|
default boolean |
isInChunk(com.flowpowered.math.vector.Vector3i localCoords)
Returns true if the local coordinates fit in a chunk.
|
default boolean |
isInChunk(com.flowpowered.math.vector.Vector3i worldCoords,
com.flowpowered.math.vector.Vector3i chunkCoords)
Returns true if the world coordinates fit in the chunk at the given
coordinates.
|
default boolean |
isValidChunk(int x,
int y,
int z)
Returns true if the coordinates are valid chunk coordinates.
|
default boolean |
isValidChunk(com.flowpowered.math.vector.Vector3i coords)
Returns true if the coordinates are valid chunk coordinates.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
moveToChunk(int x,
int y,
int z,
Direction direction)
Moves chunk coordinates one step in the given direction.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
moveToChunk(int x,
int y,
int z,
Direction direction,
int steps)
Moves chunk coordinates a number of steps in the given direction.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
moveToChunk(com.flowpowered.math.vector.Vector3i chunkCoords,
Direction direction)
Moves chunk coordinates one step in the given direction.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
moveToChunk(com.flowpowered.math.vector.Vector3i chunkCoords,
Direction direction,
int steps)
Moves chunk coordinates a number of steps in the given direction.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
toChunk(int x,
int y,
int z)
Converts world coordinates to chunk coordinates.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
toChunk(com.flowpowered.math.vector.Vector3i worldCoords)
Converts world coordinates to chunk coordinates.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
toWorld(int x,
int y,
int z)
Converts chunk coordinates to world coordinates.
|
default Optional<com.flowpowered.math.vector.Vector3i> |
toWorld(com.flowpowered.math.vector.Vector3i chunkCoords)
Converts chunk coordinates to world coordinates.
|
com.flowpowered.math.vector.Vector3i getChunkSize()
com.flowpowered.math.vector.Vector3i getSpaceMax()
com.flowpowered.math.vector.Vector3i getSpaceMin()
com.flowpowered.math.vector.Vector3i getSpaceSize()
getSpaceMax() - getSpaceMin() + 1.com.flowpowered.math.vector.Vector3i getSpaceOrigin()
Vector3i.ZERO.default boolean isValidChunk(com.flowpowered.math.vector.Vector3i coords)
coords - The coordinates to validatedefault boolean isValidChunk(int x,
int y,
int z)
x - The x coordinate to validatey - The y coordinate to validatez - The z coordinate to validatedefault boolean isInChunk(com.flowpowered.math.vector.Vector3i localCoords)
localCoords - The coordinates to checkboolean isInChunk(int x,
int y,
int z)
x - The x local coordinate to validatey - The y local coordinate to validatez - The z local coordinate to validatedefault boolean isInChunk(com.flowpowered.math.vector.Vector3i worldCoords,
com.flowpowered.math.vector.Vector3i chunkCoords)
worldCoords - The world coordinates to validatechunkCoords - The chunk coordinates in which they must fitboolean isInChunk(int wx,
int wy,
int wz,
int cx,
int cy,
int cz)
wx - The x world coordinate to validatewy - The y world coordinate to validatewz - The z world coordinate to validatecx - The x chunk coordinate in which they must fitcy - The y chunk coordinate in which they must fitcz - The z chunk coordinate in which they must fitdefault Optional<com.flowpowered.math.vector.Vector3i> toChunk(com.flowpowered.math.vector.Vector3i worldCoords)
worldCoords - The world coordinates to convert to chunk coordinatesdefault Optional<com.flowpowered.math.vector.Vector3i> toChunk(int x, int y, int z)
x - The x world coordinate to convert to chunk coordinatesy - The y world coordinate to convert to chunk coordinatesz - The z world coordinate to convert to chunk coordinatesdefault Optional<com.flowpowered.math.vector.Vector3i> toWorld(com.flowpowered.math.vector.Vector3i chunkCoords)
chunkCoords - The chunk coordinates to convert to world coordinatesdefault Optional<com.flowpowered.math.vector.Vector3i> toWorld(int x, int y, int z)
x - The x chunk coordinate to convert to world coordinatesy - The y chunk coordinate to convert to world coordinatesz - The z chunk coordinate to convert to world coordinatesdefault com.flowpowered.math.vector.Vector3i forceToChunk(com.flowpowered.math.vector.Vector3i worldCoords)
worldCoords - The world coordinates to convert to chunk coordinatescom.flowpowered.math.vector.Vector3i forceToChunk(int x,
int y,
int z)
x - The x world coordinate to convert to chunk coordinatesy - The y world coordinate to convert to chunk coordinatesz - The z world coordinate to convert to chunk coordinatesdefault com.flowpowered.math.vector.Vector3i forceToWorld(com.flowpowered.math.vector.Vector3i chunkCoords)
chunkCoords - The chunk coordinates to convert to world coordinatescom.flowpowered.math.vector.Vector3i forceToWorld(int x,
int y,
int z)
x - The x chunk coordinate to convert to world coordinatesy - The y chunk coordinate to convert to world coordinatesz - The z chunk coordinate to convert to world coordinatesdefault Optional<com.flowpowered.math.vector.Vector3i> addToChunk(com.flowpowered.math.vector.Vector3i chunkCoords, com.flowpowered.math.vector.Vector3i chunkOffset)
chunkCoords - The chunk coordinates to add tochunkOffset - The chunk offset to add to the chunk coordinatesdefault Optional<com.flowpowered.math.vector.Vector3i> addToChunk(int cx, int cy, int cz, int ox, int oy, int oz)
cx - The x chunk coordinate to add tocy - The y chunk coordinate to add tocz - The z chunk coordinate to add toox - The x chunk offset to add to the chunk coordinatesoy - The y chunk offset to add to the chunk coordinatesoz - The z chunk offset to add to the chunk coordinatesdefault Optional<com.flowpowered.math.vector.Vector3i> moveToChunk(com.flowpowered.math.vector.Vector3i chunkCoords, Direction direction)
Direction.Division.SECONDARY_ORDINAL
directions are not a valid argument. These will throw an exception.chunkCoords - The chunk coordinates to move fromdirection - The direction in which to move a stepIllegalArgumentException - If the direction is a
Direction.Division.SECONDARY_ORDINALdefault Optional<com.flowpowered.math.vector.Vector3i> moveToChunk(int x, int y, int z, Direction direction)
Direction.Division.SECONDARY_ORDINAL directions are not a valid
argument. These will throw an exception.x - The x chunk coordinate to move fromy - The y chunk coordinate to move fromz - The z chunk coordinate to move fromdirection - The direction in which to move a stepIllegalArgumentException - If the direction is a
Direction.Division.SECONDARY_ORDINALdefault Optional<com.flowpowered.math.vector.Vector3i> moveToChunk(com.flowpowered.math.vector.Vector3i chunkCoords, Direction direction, int steps)
Direction.Division.SECONDARY_ORDINAL directions are not a valid
argument. These will throw an exception.chunkCoords - The chunk coordinates to move fromdirection - The direction in which to movesteps - The number of steps to takeIllegalArgumentException - If the direction is a
Direction.Division.SECONDARY_ORDINALdefault Optional<com.flowpowered.math.vector.Vector3i> moveToChunk(int x, int y, int z, Direction direction, int steps)
Direction.Division.SECONDARY_ORDINAL directions are not a valid
argument. These will throw an exception.x - The x chunk coordinate to move fromy - The y chunk coordinate to move fromz - The z chunk coordinate to move fromdirection - The direction in which to movesteps - The number of steps to takeIllegalArgumentException - If the direction is a
Direction.Division.SECONDARY_ORDINAL