Class UnsafeChunk
java.lang.Object
org.cloudburstmc.server.level.chunk.UnsafeChunk
- All Implemented Interfaces:
Closeable,AutoCloseable,Comparable<org.cloudburstmc.api.level.chunk.Chunk>,org.cloudburstmc.api.level.chunk.Chunk
-
Field Summary
Fields inherited from interface org.cloudburstmc.api.level.chunk.Chunk
STATE_FINISHED, STATE_GENERATED, STATE_NEW, STATE_POPULATED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity)voidaddEntity(org.cloudburstmc.api.entity.Entity entity)voidclear()Clear chunk to a state as if it was not generated.booleanvoidclose()org.cloudburstmc.api.block.BlockStategetAndSetBlock(int x, int y, int z, int layer, org.cloudburstmc.api.block.BlockState blockState)intgetBiome(int x, int z)byte[]org.cloudburstmc.api.block.BlockStategetBlock(int x, int y, int z, int layer)Gets an immutable copy of all block entities within the current chunk.org.cloudburstmc.api.blockentity.BlockEntitygetBlockEntity(int x, int y, int z)bytegetBlockLight(int x, int y, int z)Gets an immutable copy of entities currently in this chunkint[]intgetHighestBlock(int x, int z)org.cloudburstmc.api.level.LevelgetLevel()getOrCreateSection(int y)Gets an immutable copy of players currently in this chunkgetSection(int y)bytegetSkyLight(int x, int y, int z)intgetState()intgetX()intgetZ()booleaninit()booleanisDirty()Whether the chunk has changed since it was last loaded or saved.longkey()org.cloudburstmc.api.level.chunk.LockableChunkvoidremoveBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity)voidremoveEntity(org.cloudburstmc.api.entity.Entity entity)voidsetBiome(int x, int z, int biome)voidsetBlock(int x, int y, int z, int layer, org.cloudburstmc.api.block.BlockState blockState)voidsetBlockLight(int x, int y, int z, int level)voidsetDirty(boolean dirty)Sets the chunk's dirty status.voidsetSkyLight(int x, int y, int z, int level)intsetState(int nextIn)org.cloudburstmc.api.level.chunk.LockableChunkMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.api.level.chunk.Chunk
compareTo, getAndSetBlock, getBlock, isFinished, isGenerated, isPopulated, setBlock, setDirty
-
Constructor Details
-
UnsafeChunk
public UnsafeChunk(int x, int z, org.cloudburstmc.api.level.Level level)
-
-
Method Details
-
init
public boolean init() -
getOrCreateSection
- Specified by:
getOrCreateSectionin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getSection
- Specified by:
getSectionin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getSections
- Specified by:
getSectionsin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getBlock
@Nonnull public org.cloudburstmc.api.block.BlockState getBlock(int x, int y, int z, int layer)- Specified by:
getBlockin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getAndSetBlock
@Nonnull public org.cloudburstmc.api.block.BlockState getAndSetBlock(int x, int y, int z, int layer, org.cloudburstmc.api.block.BlockState blockState)- Specified by:
getAndSetBlockin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
setBlock
public void setBlock(int x, int y, int z, int layer, org.cloudburstmc.api.block.BlockState blockState)- Specified by:
setBlockin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getBiome
public int getBiome(int x, int z)- Specified by:
getBiomein interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
setBiome
public void setBiome(int x, int z, int biome)- Specified by:
setBiomein interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getSkyLight
public byte getSkyLight(int x, int y, int z)- Specified by:
getSkyLightin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
setSkyLight
public void setSkyLight(int x, int y, int z, int level)- Specified by:
setSkyLightin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getBlockLight
public byte getBlockLight(int x, int y, int z)- Specified by:
getBlockLightin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
setBlockLight
public void setBlockLight(int x, int y, int z, int level)- Specified by:
setBlockLightin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getHighestBlock
public int getHighestBlock(int x, int z)- Specified by:
getHighestBlockin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
addEntity
public void addEntity(@Nonnull org.cloudburstmc.api.entity.Entity entity)- Specified by:
addEntityin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
removeEntity
public void removeEntity(org.cloudburstmc.api.entity.Entity entity)- Specified by:
removeEntityin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
addBlockEntity
public void addBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity)- Specified by:
addBlockEntityin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
removeBlockEntity
public void removeBlockEntity(org.cloudburstmc.api.blockentity.BlockEntity blockEntity)- Specified by:
removeBlockEntityin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getBlockEntity
@Nullable public org.cloudburstmc.api.blockentity.BlockEntity getBlockEntity(int x, int y, int z)- Specified by:
getBlockEntityin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getX
public int getX()- Specified by:
getXin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getZ
public int getZ()- Specified by:
getZin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getLevel
@Nonnull public org.cloudburstmc.api.level.Level getLevel()- Specified by:
getLevelin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getBiomeArray
@Nonnull public byte[] getBiomeArray()- Specified by:
getBiomeArrayin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getHeightMapArray
@Nonnull public int[] getHeightMapArray()- Specified by:
getHeightMapArrayin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getPlayers
Gets an immutable copy of players currently in this chunk- Specified by:
getPlayersin interfaceorg.cloudburstmc.api.level.chunk.Chunk- Returns:
- player set
-
getEntities
Gets an immutable copy of entities currently in this chunk- Specified by:
getEntitiesin interfaceorg.cloudburstmc.api.level.chunk.Chunk- Returns:
- entity set
-
getBlockEntities
Gets an immutable copy of all block entities within the current chunk.- Specified by:
getBlockEntitiesin interfaceorg.cloudburstmc.api.level.chunk.Chunk- Returns:
- block entity collection
-
getState
public int getState()- Specified by:
getStatein interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
setState
public int setState(int nextIn)- Specified by:
setStatein interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
isDirty
public boolean isDirty()Whether the chunk has changed since it was last loaded or saved.- Specified by:
isDirtyin interfaceorg.cloudburstmc.api.level.chunk.Chunk- Returns:
- dirty
-
setDirty
public void setDirty(boolean dirty)Sets the chunk's dirty status.- Specified by:
setDirtyin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
clearDirty
public boolean clearDirty()- Specified by:
clearDirtyin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
clear
public void clear()Clear chunk to a state as if it was not generated.- Specified by:
clearin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.cloudburstmc.api.level.chunk.Chunk- Specified by:
closein interfaceCloseable
-
getLoaders
- Specified by:
getLoadersin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
getPlayerLoaders
- Specified by:
getPlayerLoadersin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
key
public long key()- Specified by:
keyin interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
readLockable
public org.cloudburstmc.api.level.chunk.LockableChunk readLockable()- Specified by:
readLockablein interfaceorg.cloudburstmc.api.level.chunk.Chunk
-
writeLockable
public org.cloudburstmc.api.level.chunk.LockableChunk writeLockable()- Specified by:
writeLockablein interfaceorg.cloudburstmc.api.level.chunk.Chunk
-