@ThreadSafe @ParametersAreNonnullByDefault public final class CloudChunk extends Object implements org.cloudburstmc.api.level.chunk.Chunk, Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
SECTION_COUNT |
| Constructor and Description |
|---|
CloudChunk(int x,
int z,
org.cloudburstmc.api.level.Level level) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity) |
void |
addEntity(org.cloudburstmc.api.entity.Entity entity) |
void |
addLoader(org.cloudburstmc.api.level.ChunkLoader chunkLoader) |
static short |
blockKey(int x,
int y,
int z) |
static int |
blockKey(int x,
int y,
int z,
int layer) |
static short |
blockKey(com.nukkitx.math.vector.Vector3i vector) |
void |
clear() |
boolean |
clearDirty() |
void |
close() |
com.nukkitx.protocol.bedrock.packet.LevelChunkPacket |
createChunkPacket() |
static com.nukkitx.math.vector.Vector4i |
fromKey(long chunkKey,
int blockKey) |
static com.nukkitx.math.vector.Vector3i |
fromKey(long chunkKey,
short blockKey) |
static int |
fromKeyX(long key) |
static int |
fromKeyZ(long key) |
org.cloudburstmc.api.block.BlockState |
getAndSetBlock(int x,
int y,
int z,
int layer,
org.cloudburstmc.api.block.BlockState blockState) |
int |
getBiome(int x,
int z) |
byte[] |
getBiomeArray() |
org.cloudburstmc.api.block.BlockState |
getBlock(int x,
int y,
int z,
int layer) |
Set<BaseBlockEntity> |
getBlockEntities() |
org.cloudburstmc.api.blockentity.BlockEntity |
getBlockEntity(int x,
int y,
int z) |
byte |
getBlockLight(int x,
int y,
int z) |
Set<BaseEntity> |
getEntities() |
int[] |
getHeightMapArray() |
int |
getHighestBlock(int x,
int z) |
org.cloudburstmc.api.level.Level |
getLevel() |
Set<org.cloudburstmc.api.level.ChunkLoader> |
getLoaders() |
org.cloudburstmc.api.level.chunk.ChunkSection |
getOrCreateSection(int y) |
Set<CloudPlayer> |
getPlayerLoaders() |
Set<CloudPlayer> |
getPlayers() |
org.cloudburstmc.api.level.chunk.ChunkSection |
getSection(int y) |
org.cloudburstmc.api.level.chunk.ChunkSection[] |
getSections() |
byte |
getSkyLight(int x,
int y,
int z) |
int |
getState() |
int |
getX() |
int |
getZ() |
void |
init() |
boolean |
isDirty() |
static long |
key(int x,
int z) |
org.cloudburstmc.api.level.chunk.LockableChunk |
readLockable() |
void |
removeBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity) |
void |
removeEntity(org.cloudburstmc.api.entity.Entity entity) |
void |
removeLoader(org.cloudburstmc.api.level.ChunkLoader chunkLoader) |
void |
setBiome(int x,
int z,
int biome) |
void |
setBlock(int x,
int y,
int z,
int layer,
org.cloudburstmc.api.block.BlockState blockState) |
void |
setBlockLight(int x,
int y,
int z,
int level) |
void |
setDirty(boolean dirty) |
void |
setSkyLight(int x,
int y,
int z,
int level) |
int |
setState(int next) |
void |
tick(int tick) |
org.cloudburstmc.api.level.chunk.LockableChunk |
writeLockable() |
public static final int SECTION_COUNT
public CloudChunk(int x,
int z,
org.cloudburstmc.api.level.Level level)
public void init()
@Nonnull public org.cloudburstmc.api.level.chunk.ChunkSection getOrCreateSection(int y)
getOrCreateSection in interface org.cloudburstmc.api.level.chunk.Chunk@Nullable public org.cloudburstmc.api.level.chunk.ChunkSection getSection(int y)
getSection in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public org.cloudburstmc.api.level.chunk.ChunkSection[] getSections()
getSections in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public org.cloudburstmc.api.block.BlockState getBlock(int x, int y, int z, int layer)
getBlock in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public org.cloudburstmc.api.block.BlockState getAndSetBlock(int x, int y, int z, int layer, org.cloudburstmc.api.block.BlockState blockState)
getAndSetBlock in interface org.cloudburstmc.api.level.chunk.Chunkpublic void setBlock(int x,
int y,
int z,
int layer,
org.cloudburstmc.api.block.BlockState blockState)
setBlock in interface org.cloudburstmc.api.level.chunk.Chunkpublic int getBiome(int x,
int z)
getBiome in interface org.cloudburstmc.api.level.chunk.Chunkpublic void setBiome(int x,
int z,
int biome)
setBiome in interface org.cloudburstmc.api.level.chunk.Chunkpublic byte getSkyLight(int x,
int y,
int z)
getSkyLight in interface org.cloudburstmc.api.level.chunk.Chunkpublic void setSkyLight(int x,
int y,
int z,
int level)
setSkyLight in interface org.cloudburstmc.api.level.chunk.Chunkpublic byte getBlockLight(int x,
int y,
int z)
getBlockLight in interface org.cloudburstmc.api.level.chunk.Chunkpublic void setBlockLight(int x,
int y,
int z,
int level)
setBlockLight in interface org.cloudburstmc.api.level.chunk.Chunkpublic int getHighestBlock(int x,
int z)
getHighestBlock in interface org.cloudburstmc.api.level.chunk.Chunkpublic void addEntity(@Nonnull org.cloudburstmc.api.entity.Entity entity)
addEntity in interface org.cloudburstmc.api.level.chunk.Chunkpublic void removeEntity(org.cloudburstmc.api.entity.Entity entity)
removeEntity in interface org.cloudburstmc.api.level.chunk.Chunkpublic static short blockKey(com.nukkitx.math.vector.Vector3i vector)
public static short blockKey(int x,
int y,
int z)
public static com.nukkitx.math.vector.Vector3i fromKey(long chunkKey,
short blockKey)
public int getX()
getX in interface org.cloudburstmc.api.level.chunk.Chunkpublic int getZ()
getZ in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public org.cloudburstmc.api.level.Level getLevel()
getLevel in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public byte[] getBiomeArray()
getBiomeArray in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public int[] getHeightMapArray()
getHeightMapArray in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public Set<CloudPlayer> getPlayers()
getPlayers in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public Set<BaseEntity> getEntities()
getEntities in interface org.cloudburstmc.api.level.chunk.Chunkpublic static com.nukkitx.math.vector.Vector4i fromKey(long chunkKey,
int blockKey)
public int getState()
getState in interface org.cloudburstmc.api.level.chunk.Chunkpublic int setState(int next)
setState in interface org.cloudburstmc.api.level.chunk.Chunkpublic boolean isDirty()
isDirty in interface org.cloudburstmc.api.level.chunk.Chunkpublic boolean clearDirty()
clearDirty in interface org.cloudburstmc.api.level.chunk.Chunkpublic void addLoader(org.cloudburstmc.api.level.ChunkLoader chunkLoader)
public void removeLoader(org.cloudburstmc.api.level.ChunkLoader chunkLoader)
@Nonnull public Set<org.cloudburstmc.api.level.ChunkLoader> getLoaders()
getLoaders in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public Set<CloudPlayer> getPlayerLoaders()
getPlayerLoaders in interface org.cloudburstmc.api.level.chunk.Chunkpublic void tick(int tick)
public org.cloudburstmc.api.level.chunk.LockableChunk readLockable()
readLockable in interface org.cloudburstmc.api.level.chunk.Chunkpublic org.cloudburstmc.api.level.chunk.LockableChunk writeLockable()
writeLockable in interface org.cloudburstmc.api.level.chunk.Chunkpublic void clear()
clear in interface org.cloudburstmc.api.level.chunk.Chunkpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.cloudburstmc.api.level.chunk.Chunkpublic void addBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity)
addBlockEntity in interface org.cloudburstmc.api.level.chunk.Chunkpublic void removeBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity)
removeBlockEntity in interface org.cloudburstmc.api.level.chunk.Chunkpublic static int blockKey(int x,
int y,
int z,
int layer)
public org.cloudburstmc.api.blockentity.BlockEntity getBlockEntity(int x,
int y,
int z)
getBlockEntity in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public Set<BaseBlockEntity> getBlockEntities()
getBlockEntities in interface org.cloudburstmc.api.level.chunk.Chunkpublic static long key(int x,
int z)
public static int fromKeyX(long key)
public static int fromKeyZ(long key)
public void setDirty(boolean dirty)
setDirty in interface org.cloudburstmc.api.level.chunk.Chunk@Nonnull public com.nukkitx.protocol.bedrock.packet.LevelChunkPacket createChunkPacket()
Copyright © 2021. All rights reserved.