-
Field Summary
Fields
static int
static int
static int
static int
-
Method Summary
void
void
void
Clear chunk to a state as if it was not generated.
boolean
Atomically resets this chunk's dirty status.
void
default int
getAndSetBlock(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int layer,
BlockState blockState)
int
byte[]
Get the copy of the biome array.
getBlock(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int layer)
Gets an immutable copy of all block entities within the current chunk.
byte
Gets an immutable copy of entities currently in this chunk
int[]
Get a copy of the height map array.
int
Get the level the chunk was loaded in.
Gets an immutable copy of players currently in this chunk
getSection(@org.checkerframework.checker.index.qual.NonNegative int y)
byte
int
Gets this chunk's current state.
int
Get the chunk's X coordinate in the level it was loaded.
int
Get the chunk's Z coordinate in the level it was loaded.
boolean
Whether the chunk has changed since it was last loaded or saved.
default boolean
default boolean
default boolean
default long
void
void
void
void
setBlock(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int layer,
BlockState blockState)
default void
void
setBlockLight(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int level)
default void
Sets the chunk's dirty status.
void
Sets the chunk's dirty status.
void
setSkyLight(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int level)
int
Atomically updates this chunk's state.
-
-
Method Details
-
getOrCreateSection
ChunkSection getOrCreateSection
(@org.checkerframework.checker.index.qual.NonNegative int y)
-
getSection
@Nullable ChunkSection getSection
(@org.checkerframework.checker.index.qual.NonNegative int y)
-
-
-
getBlock
BlockState getBlock
(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int layer)
-
-
getAndSetBlock
BlockState getAndSetBlock
(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int layer,
BlockState blockState)
-
setBlock
default void setBlock
(int x,
int y,
int z,
BlockState blockState)
-
setBlock
void setBlock
(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int layer,
BlockState blockState)
-
getBiome
int getBiome(int x,
int z)
-
setBiome
void setBiome(int x,
int z,
int biome)
-
getSkyLight
byte getSkyLight(int x,
int y,
int z)
-
setSkyLight
void setSkyLight(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int level)
-
getBlockLight
byte getBlockLight(int x,
int y,
int z)
-
setBlockLight
void setBlockLight(int x,
int y,
int z,
@org.checkerframework.checker.index.qual.NonNegative int level)
-
getHighestBlock
int getHighestBlock(int x,
int z)
-
addEntity
void addEntity
(@NonNull Entity entity)
-
removeEntity
void removeEntity
(Entity entity)
-
-
-
-
getX
int getX()
Get the chunk's X coordinate in the level it was loaded.
- Returns:
- chunk x
-
getZ
int getZ()
Get the chunk's Z coordinate in the level it was loaded.
- Returns:
- chunk z
-
getLevel
Get the level the chunk was loaded in.
- Returns:
- chunk level
-
getBiomeArray
byte[] getBiomeArray()
Get the copy of the biome array.
- Returns:
- biome array
-
getHeightMapArray
int[] getHeightMapArray()
Get a copy of the height map array.
- Returns:
- height map
-
getPlayers
Gets an immutable copy of players currently in this chunk
- Returns:
- player set
-
getEntities
Gets an immutable copy of entities currently in this chunk
- Returns:
- entity set
-
getBlockEntities
Gets an immutable copy of all block entities within the current chunk.
- Returns:
- block entity set
-
getState
int getState()
Gets this chunk's current state.
-
setState
int setState(int next)
Atomically updates this chunk's state.
- Parameters:
next - the new state to set
- Returns:
- the chunk's previous state
- Throws:
IllegalStateException - if the new state is invalid, or the same as or lower than the current state
-
isGenerated
default boolean isGenerated()
-
isPopulated
default boolean isPopulated()
-
isFinished
default boolean isFinished()
-
isDirty
boolean isDirty()
Whether the chunk has changed since it was last loaded or saved.
- Returns:
- dirty
-
setDirty
default void setDirty()
Sets the chunk's dirty status.
-
setDirty
void setDirty(boolean dirty)
Sets the chunk's dirty status.
- Parameters:
dirty - true if chunk is dirty
-
clearDirty
boolean clearDirty()
Atomically resets this chunk's dirty status.
- Returns:
- whether or not the chunk was previously dirty
-
clear
void clear()
Clear chunk to a state as if it was not generated.
-
key
default long key()
- Returns:
- this chunk's key
-
-
-
-
-
-