public final class UnsafeChunk extends Object implements IChunk, Closeable
STATE_FINISHED, STATE_GENERATED, STATE_NEW, STATE_POPULATED| Constructor and Description |
|---|
UnsafeChunk(int x,
int z,
Level level) |
| 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() |
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 |
init() |
boolean |
isDirty()
Whether the chunk has changed since it was last loaded or saved.
|
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 nextIn)
Atomically updates this chunk's state.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcompareTo, getAndSetBlock, getBlock, isFinished, isGenerated, isPopulated, key, setBlock, setDirtypublic UnsafeChunk(int x,
int z,
Level level)
public boolean init()
@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)
@Nonnull 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 IChunk@Nullable public 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()
getPlayers in interface IChunk@Nonnull public Set<Entity> getEntities()
getEntities in interface IChunk@Nonnull public Collection<BlockEntity> getBlockEntities()
getBlockEntities in interface IChunkpublic int getState()
IChunkpublic int setState(int nextIn)
IChunkpublic boolean isDirty()
public void setDirty(boolean dirty)
public boolean clearDirty()
IChunkclearDirty in interface IChunkpublic void clear()
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2020. All rights reserved.