@NotThreadSafe public final class LockableChunk extends Object implements IChunk, Lock
STATE_FINISHED, STATE_GENERATED, STATE_NEW, 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.
|
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.
|
BlockState |
getBlock(int x,
int y,
int z,
int layer) |
Collection<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<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.
|
ChunkSection |
getOrCreateSection(int y) |
Set<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.
|
void |
lock() |
void |
lockInterruptibly() |
Condition |
newCondition() |
void |
removeBlockEntity(BlockEntity blockEntity) |
void |
removeEntity(Entity entity) |
void |
setBiome(int x,
int z,
int biome) |
void |
setBlock(int x,
int y,
int z,
int layer,
BlockState blockState) |
void |
setBlockLight(int x,
int y,
int z,
int level) |
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.
|
boolean |
tryLock() |
boolean |
tryLock(long time,
TimeUnit unit) |
void |
unlock() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTo, getAndSetBlock, getBlock, isFinished, isGenerated, isPopulated, key, setBlock, setDirtypublic void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LockInterruptedExceptionpublic boolean tryLock(long time,
@Nonnull
TimeUnit unit)
throws InterruptedException
tryLock in interface LockInterruptedExceptionpublic Condition newCondition()
newCondition in interface Lock@Nonnull public ChunkSection getOrCreateSection(int y)
getOrCreateSection in interface IChunk@Nullable public ChunkSection getSection(int y)
getSection in interface IChunk@Nonnull public ChunkSection[] getSections()
getSections in interface IChunk@Nonnull public BlockState getBlock(int x, int y, int z, int layer)
public BlockState getAndSetBlock(int x, int y, int z, int layer, BlockState blockState)
getAndSetBlock in interface IChunkpublic void setBlock(int x,
int y,
int z,
int layer,
BlockState blockState)
public byte getSkyLight(int x,
int y,
int z)
getSkyLight in interface IChunkpublic void setSkyLight(int x,
int y,
int z,
int level)
setSkyLight in interface IChunkpublic byte getBlockLight(int x,
int y,
int z)
getBlockLight in interface IChunkpublic void setBlockLight(int x,
int y,
int z,
int level)
setBlockLight in interface IChunkpublic int getHighestBlock(int x,
int z)
getHighestBlock in interface IChunkpublic void removeEntity(Entity entity)
removeEntity in interface IChunkpublic void addBlockEntity(BlockEntity blockEntity)
addBlockEntity in interface IChunkpublic void removeBlockEntity(BlockEntity blockEntity)
removeBlockEntity in interface IChunkpublic BlockEntity getBlockEntity(int x, int y, int z)
getBlockEntity in interface IChunkpublic int getX()
IChunkpublic int getZ()
IChunk@Nonnull public Level getLevel()
IChunk@Nonnull public byte[] getBiomeArray()
IChunkgetBiomeArray in interface IChunk@Nonnull public int[] getHeightMapArray()
IChunkgetHeightMapArray in interface IChunk@Nonnull public Set<Player> getPlayers()
IChunkgetPlayers in interface IChunk@Nonnull public Set<Entity> getEntities()
IChunkgetEntities in interface IChunk@Nonnull public Collection<BlockEntity> getBlockEntities()
IChunkgetBlockEntities in interface IChunkpublic int getState()
IChunkpublic int setState(int next)
IChunkpublic boolean isDirty()
IChunkpublic void setDirty(boolean dirty)
IChunkpublic boolean clearDirty()
IChunkclearDirty in interface IChunkCopyright © 2020. All rights reserved.