public interface Chunk extends Comparable<Chunk>
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_FINISHED |
static int |
STATE_GENERATED |
static int |
STATE_NEW |
static int |
STATE_POPULATED |
| Modifier and Type | Method and Description |
|---|---|
void |
addBlockEntity(BlockEntity blockEntity) |
void |
addEntity(Entity entity) |
void |
clear()
Clear chunk to a state as if it was not generated.
|
boolean |
clearDirty()
Atomically resets this chunk's dirty status.
|
void |
close() |
default int |
compareTo(Chunk o) |
default BlockState |
getAndSetBlock(int x,
int y,
int z,
BlockState blockState) |
BlockState |
getAndSetBlock(int x,
int y,
int z,
int layer,
BlockState blockState) |
int |
getBiome(int x,
int z) |
byte[] |
getBiomeArray()
Get the copy of the biome array.
|
default BlockState |
getBlock(int x,
int y,
int z) |
BlockState |
getBlock(int x,
int y,
int z,
int layer) |
Set<? extends BlockEntity> |
getBlockEntities()
Gets an immutable copy of all block entities within the current chunk.
|
BlockEntity |
getBlockEntity(int x,
int y,
int z) |
byte |
getBlockLight(int x,
int y,
int z) |
Set<? extends Entity> |
getEntities()
Gets an immutable copy of entities currently in this chunk
|
int[] |
getHeightMapArray()
Get a copy of the height map array.
|
int |
getHighestBlock(int x,
int z) |
Level |
getLevel()
Get the level the chunk was loaded in.
|
Set<? extends ChunkLoader> |
getLoaders() |
ChunkSection |
getOrCreateSection(int y) |
Set<? extends Player> |
getPlayerLoaders() |
Set<? extends Player> |
getPlayers()
Gets an immutable copy of players currently in this chunk
|
ChunkSection |
getSection(int y) |
ChunkSection[] |
getSections() |
byte |
getSkyLight(int x,
int y,
int z) |
int |
getState()
Gets this chunk's current state.
|
int |
getX()
Get the chunk's X coordinate in the level it was loaded.
|
int |
getZ()
Get the chunk's Z coordinate in the level it was loaded.
|
boolean |
isDirty()
Whether the chunk has changed since it was last loaded or saved.
|
default boolean |
isFinished() |
default boolean |
isGenerated() |
default boolean |
isPopulated() |
default long |
key() |
LockableChunk |
readLockable() |
void |
removeBlockEntity(BlockEntity blockEntity) |
void |
removeEntity(Entity entity) |
void |
setBiome(int x,
int z,
int biome) |
default void |
setBlock(int x,
int y,
int z,
BlockState blockState) |
void |
setBlock(int x,
int y,
int z,
int layer,
BlockState blockState) |
void |
setBlockLight(int x,
int y,
int z,
int level) |
default void |
setDirty()
Sets the chunk's dirty status.
|
void |
setDirty(boolean dirty)
Sets the chunk's dirty status.
|
void |
setSkyLight(int x,
int y,
int z,
int level) |
int |
setState(int next)
Atomically updates this chunk's state.
|
LockableChunk |
writeLockable() |
static final int STATE_NEW
static final int STATE_GENERATED
static final int STATE_POPULATED
static final int STATE_FINISHED
@Nonnull ChunkSection getOrCreateSection(@Nonnegative int y)
@Nullable ChunkSection getSection(@Nonnegative int y)
@Nonnull ChunkSection[] getSections()
@Nonnull default BlockState getBlock(int x, int y, int z)
@Nonnull BlockState getBlock(int x, int y, int z, @Nonnegative int layer)
default BlockState getAndSetBlock(int x, int y, int z, BlockState blockState)
BlockState getAndSetBlock(int x, int y, int z, @Nonnegative int layer, BlockState blockState)
default void setBlock(int x,
int y,
int z,
BlockState blockState)
void setBlock(int x,
int y,
int z,
@Nonnegative
int layer,
BlockState blockState)
int getBiome(int x,
int z)
void setBiome(int x,
int z,
int biome)
byte getSkyLight(int x,
int y,
int z)
void setSkyLight(int x,
int y,
int z,
@Nonnegative
int level)
byte getBlockLight(int x,
int y,
int z)
void setBlockLight(int x,
int y,
int z,
@Nonnegative
int level)
int getHighestBlock(int x,
int z)
void removeEntity(Entity entity)
void addBlockEntity(BlockEntity blockEntity)
void removeBlockEntity(BlockEntity blockEntity)
BlockEntity getBlockEntity(int x, int y, int z)
int getX()
int getZ()
@Nonnull byte[] getBiomeArray()
@Nonnull int[] getHeightMapArray()
@Nonnull Set<? extends Player> getPlayers()
@Nonnull Set<? extends Entity> getEntities()
@Nonnull Set<? extends BlockEntity> getBlockEntities()
int getState()
int setState(int next)
next - the new state to setIllegalStateException - if the new state is invalid, or the same as or lower than the current statedefault boolean isGenerated()
default boolean isPopulated()
default boolean isFinished()
boolean isDirty()
default void setDirty()
void setDirty(boolean dirty)
dirty - true if chunk is dirtyboolean clearDirty()
void clear()
default long key()
default int compareTo(Chunk o)
compareTo in interface Comparable<Chunk>LockableChunk readLockable()
LockableChunk writeLockable()
void close()
Set<? extends ChunkLoader> getLoaders()
Copyright © 2021. All rights reserved.