Package cn.nukkit.level.format.generic
Class BaseFullChunk
java.lang.Object
cn.nukkit.level.format.generic.BaseFullChunk
- All Implemented Interfaces:
ChunkManager
,FullChunk
,Cloneable
- Direct Known Subclasses:
BaseChunk
- Author:
- MagicDroidX (Nukkit Project)
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
encoded as:protected byte[]
protected byte[]
protected long
protected BatchPacket
protected byte[]
protected it.unimi.dsi.fastutil.longs.Long2ObjectMap<Entity>
protected byte[]
protected boolean
protected List<CompoundTag>
protected List<CompoundTag>
protected LevelProvider
protected Class<? extends LevelProvider>
protected byte[]
protected it.unimi.dsi.fastutil.ints.Int2ObjectMap<BlockEntity>
protected it.unimi.dsi.fastutil.longs.Long2ObjectMap<BlockEntity>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlockEntity
(BlockEntity blockEntity) void
void
backwardCompatibilityUpdate
(Level level) clone()
boolean
compress()
int
getBiomeId
(int x, int z) byte[]
int
getBlockDataAt
(int x, int y, int z) Deprecated.int
getBlockDataAt
(int x, int y, int z, int layer) Deprecated.int
getBlockExtraData
(int x, int y, int z) int
getBlockIdAt
(int x, int y, int z) int
getBlockIdAt
(int x, int y, int z, int layer) byte[]
byte[]
long
getChunk
(int chunkX, int chunkZ) int
getHeightMap
(int x, int z) byte[]
int
getHighestBlockAt
(int x, int z) int
getHighestBlockAt
(int x, int z, boolean cache) final long
getIndex()
long
getSeed()
getTile
(int x, int y, int z) final int
getX()
final int
getZ()
boolean
void
boolean
boolean
isLoaded()
boolean
load()
boolean
load
(boolean generate) void
void
int
recalculateHeightMapColumn
(int x, int z) void
removeBlockEntity
(BlockEntity blockEntity) void
removeEntity
(Entity entity) scanBlocks
(BlockVector3 min, BlockVector3 max, BiPredicate<BlockVector3, BlockState> condition) void
setBiomeId
(int x, int z, byte biomeId) void
setBlockAt
(int x, int y, int z, int id, int data) Deprecated.boolean
setBlockAtLayer
(int x, int y, int z, int layer, int blockId) boolean
setBlockAtLayer
(int x, int y, int z, int layer, int blockId, int meta) Deprecated.void
setBlockDataAt
(int x, int y, int z, int data) Deprecated.void
setBlockDataAt
(int x, int y, int z, int layer, int data) Deprecated.void
setBlockExtraData
(int x, int y, int z, int data) void
setBlockFullIdAt
(int x, int y, int z, int fullId) Deprecated.void
setBlockFullIdAt
(int x, int y, int z, int layer, int fullId) Deprecated.void
setBlockIdAt
(int x, int y, int z, int id) void
setBlockIdAt
(int x, int y, int z, int layer, int id) void
void
setChanged
(boolean changed) void
setChunk
(int chunkX, int chunkZ) void
setChunk
(int chunkX, int chunkZ, BaseFullChunk chunk) void
setChunkPacket
(BatchPacket packet) void
setHeightMap
(int x, int z, int value) void
void
setLightPopulated
(boolean value) void
setPosition
(int x, int z) void
setProvider
(LevelProvider provider) final void
setX
(int x) final void
setZ
(int z) byte[]
boolean
unload()
boolean
unload
(boolean save) boolean
unload
(boolean save, boolean safe) Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.level.ChunkManager
getBlockStateAt, getBlockStateAt, getChunk, setBlockAt, setBlockStateAt, setBlockStateAt
Methods inherited from interface cn.nukkit.level.format.FullChunk
findBorders, getAndSetBlock, getAndSetBlock, getAndSetBlockState, getAndSetBlockState, getBiomeId, getBlockChanges, getBlockData, getBlockData, getBlockId, getBlockId, getBlockLight, getBlockRuntimeId, getBlockRuntimeId, getBlockSkyLight, getBlockState, getBlockState, getChunkSectionCount, getFullBlock, getFullBlock, isBlockChangeAllowed, isBlockedByBorder, isGenerated, isNether, isOverWorld, isPopulated, isTheEnd, reObfuscateChunk, setBiome, setBiome, setBiomeId, setBiomeId, setBiomeId, setBlock, setBlock, setBlockData, setBlockData, setBlockId, setBlockId, setBlockLight, setBlockSkyLight, setBlockState, setBlockStateAtLayer, setFullBlockId, setFullBlockId, setGenerated, setGenerated, setPopulated, setPopulated, toBinary
-
Field Details
-
entities
-
tiles
-
tileList
-
biomes
protected byte[] biomesencoded as:(x << 4) | z
-
blocks
protected byte[] blocks -
data
protected byte[] data -
skyLight
protected byte[] skyLight -
blockLight
protected byte[] blockLight -
heightMap
protected byte[] heightMap -
NBTtiles
-
NBTentities
-
extraData
-
provider
-
providerClass
-
changes
protected long changes -
isInit
protected boolean isInit -
chunkPacket
-
-
Constructor Details
-
BaseFullChunk
public BaseFullChunk()
-
-
Method Details
-
clone
-
getChunkPacket
-
setChunkPacket
-
backwardCompatibilityUpdate
@PowerNukkitOnly("Needed for level backward compatibility") @Since("1.3.0.0-PN") public void backwardCompatibilityUpdate(Level level) -
initChunk
public void initChunk() -
getIndex
public final long getIndex() -
getX
public final int getX() -
setX
public final void setX(int x) -
getZ
public final int getZ() -
setZ
public final void setZ(int z) -
setPosition
public void setPosition(int x, int z) - Specified by:
setPosition
in interfaceFullChunk
-
getProvider
- Specified by:
getProvider
in interfaceFullChunk
-
setProvider
- Specified by:
setProvider
in interfaceFullChunk
-
getBiomeId
public int getBiomeId(int x, int z) - Specified by:
getBiomeId
in interfaceFullChunk
-
setBiomeId
public void setBiomeId(int x, int z, byte biomeId) - Specified by:
setBiomeId
in interfaceFullChunk
-
getHeightMap
public int getHeightMap(int x, int z) - Specified by:
getHeightMap
in interfaceFullChunk
-
setHeightMap
public void setHeightMap(int x, int z, int value) - Specified by:
setHeightMap
in interfaceFullChunk
-
recalculateHeightMap
public void recalculateHeightMap()- Specified by:
recalculateHeightMap
in interfaceFullChunk
-
recalculateHeightMapColumn
- Specified by:
recalculateHeightMapColumn
in interfaceFullChunk
-
getBlockExtraData
public int getBlockExtraData(int x, int y, int z) - Specified by:
getBlockExtraData
in interfaceFullChunk
-
setBlockExtraData
public void setBlockExtraData(int x, int y, int z, int data) - Specified by:
setBlockExtraData
in interfaceFullChunk
-
populateSkyLight
public void populateSkyLight()- Specified by:
populateSkyLight
in interfaceFullChunk
-
getHighestBlockAt
public int getHighestBlockAt(int x, int z) - Specified by:
getHighestBlockAt
in interfaceFullChunk
-
getHighestBlockAt
public int getHighestBlockAt(int x, int z, boolean cache) - Specified by:
getHighestBlockAt
in interfaceFullChunk
-
addEntity
-
removeEntity
- Specified by:
removeEntity
in interfaceFullChunk
-
addBlockEntity
- Specified by:
addBlockEntity
in interfaceFullChunk
-
removeBlockEntity
- Specified by:
removeBlockEntity
in interfaceFullChunk
-
getEntities
- Specified by:
getEntities
in interfaceFullChunk
-
getBlockEntities
- Specified by:
getBlockEntities
in interfaceFullChunk
-
getBlockExtraDataArray
- Specified by:
getBlockExtraDataArray
in interfaceFullChunk
-
getTile
-
isLoaded
public boolean isLoaded() -
load
- Specified by:
load
in interfaceFullChunk
- Throws:
IOException
-
load
- Specified by:
load
in interfaceFullChunk
- Throws:
IOException
-
unload
-
unload
-
unload
public boolean unload(boolean save, boolean safe) -
getBlockSkyLightArray
public byte[] getBlockSkyLightArray()- Specified by:
getBlockSkyLightArray
in interfaceFullChunk
-
getBlockLightArray
public byte[] getBlockLightArray()- Specified by:
getBlockLightArray
in interfaceFullChunk
-
getBiomeIdArray
public byte[] getBiomeIdArray()- Specified by:
getBiomeIdArray
in interfaceFullChunk
-
getHeightMapArray
public byte[] getHeightMapArray()- Specified by:
getHeightMapArray
in interfaceFullChunk
-
getChanges
public long getChanges() -
hasChanged
public boolean hasChanged()- Specified by:
hasChanged
in interfaceFullChunk
-
setChanged
public void setChanged()- Specified by:
setChanged
in interfaceFullChunk
-
setChanged
public void setChanged(boolean changed) - Specified by:
setChanged
in interfaceFullChunk
-
toFastBinary
public byte[] toFastBinary()- Specified by:
toFastBinary
in interfaceFullChunk
-
isLightPopulated
public boolean isLightPopulated()- Specified by:
isLightPopulated
in interfaceFullChunk
-
setLightPopulated
public void setLightPopulated(boolean value) - Specified by:
setLightPopulated
in interfaceFullChunk
-
setLightPopulated
public void setLightPopulated()- Specified by:
setLightPopulated
in interfaceFullChunk
-
getBlockIdAt
public int getBlockIdAt(int x, int y, int z) - Specified by:
getBlockIdAt
in interfaceChunkManager
-
getBlockIdAt
- Specified by:
getBlockIdAt
in interfaceChunkManager
-
setBlockFullIdAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockFullIdAt(int x, int y, int z, int fullId) Deprecated.- Specified by:
setBlockFullIdAt
in interfaceChunkManager
-
setBlockFullIdAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public void setBlockFullIdAt(int x, int y, int z, int layer, int fullId) Deprecated.- Specified by:
setBlockFullIdAt
in interfaceChunkManager
-
setBlockAtLayer
- Specified by:
setBlockAtLayer
in interfaceChunkManager
- Specified by:
setBlockAtLayer
in interfaceFullChunk
-
setBlockAtLayer
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public boolean setBlockAtLayer(int x, int y, int z, int layer, int blockId, int meta) Deprecated.- Specified by:
setBlockAtLayer
in interfaceChunkManager
- Specified by:
setBlockAtLayer
in interfaceFullChunk
-
setBlockIdAt
public void setBlockIdAt(int x, int y, int z, int id) - Specified by:
setBlockIdAt
in interfaceChunkManager
-
setBlockIdAt
- Specified by:
setBlockIdAt
in interfaceChunkManager
-
setBlockAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockAt(int x, int y, int z, int id, int data) Deprecated.- Specified by:
setBlockAt
in interfaceChunkManager
-
getBlockDataAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public int getBlockDataAt(int x, int y, int z) Deprecated.- Specified by:
getBlockDataAt
in interfaceChunkManager
-
getBlockDataAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public int getBlockDataAt(int x, int y, int z, int layer) Deprecated.- Specified by:
getBlockDataAt
in interfaceChunkManager
-
setBlockDataAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockDataAt(int x, int y, int z, int data) Deprecated.- Specified by:
setBlockDataAt
in interfaceChunkManager
-
setBlockDataAt
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public void setBlockDataAt(int x, int y, int z, int layer, int data) Deprecated.- Specified by:
setBlockDataAt
in interfaceChunkManager
-
getChunk
- Specified by:
getChunk
in interfaceChunkManager
-
setChunk
public void setChunk(int chunkX, int chunkZ) - Specified by:
setChunk
in interfaceChunkManager
-
setChunk
- Specified by:
setChunk
in interfaceChunkManager
-
getSeed
public long getSeed()- Specified by:
getSeed
in interfaceChunkManager
-
compress
public boolean compress() -
scanBlocks
@PowerNukkitOnly @Since("1.4.0.0-PN") @NotNull public Stream<Block> scanBlocks(BlockVector3 min, BlockVector3 max, BiPredicate<BlockVector3, BlockState> condition)
-