Package cn.nukkit.level.format.generic
Class BaseChunk
java.lang.Object
cn.nukkit.level.format.generic.BaseFullChunk
cn.nukkit.level.format.generic.BaseChunk
- All Implemented Interfaces:
ChunkManager
,Chunk
,FullChunk
,Cloneable
- Direct Known Subclasses:
Chunk
- Author:
- MagicDroidX (Nukkit Project)
-
Nested Class Summary
Nested classes/interfaces inherited from interface cn.nukkit.level.format.Chunk
Chunk.Entry
-
Field Summary
FieldsFields inherited from class cn.nukkit.level.format.generic.BaseFullChunk
biomes, blockLight, blocks, changes, chunkPacket, data, entities, extraData, heightMap, isInit, NBTentities, NBTtiles, provider, providerClass, skyLight, tileList, tiles
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
backwardCompatibilityUpdate
(Level level) clone()
protected void
createChunkSection
(int sectionY) void
findBorders
(int x, int z) getAndSetBlock
(int x, int y, int z, int layer, Block block) getAndSetBlock
(int x, int y, int z, Block block) getAndSetBlockState
(int x, int y, int z, int layer, BlockState state) long
int
getBlockData
(int x, int y, int z) Deprecated.int
getBlockData
(int x, int y, int z, int layer) Deprecated.int
getBlockId
(int x, int y, int z) int
getBlockId
(int x, int y, int z, int layer) int
getBlockLight
(int x, int y, int z) byte[]
int
getBlockSkyLight
(int x, int y, int z) byte[]
getBlockState
(int x, int y, int z, int layer) getBlockStateAt
(int x, int y, int z, int layer) int
getFullBlock
(int x, int y, int z) Deprecated.int
getFullBlock
(int x, int y, int z, int layer) Deprecated.byte[]
protected ChunkSection
getOrCreateMutableSection
(int sectionY) getSection
(float fY) long
getSectionBlockChanges
(int sectionY) boolean
isBlockChangeAllowed
(int x, int y, int z) boolean
isBlockedByBorder
(int x, int z) boolean
boolean
isSectionEmpty
(float fY) boolean
load()
boolean
load
(boolean generate) scanBlocks
(BlockVector3 min, BlockVector3 max, BiPredicate<BlockVector3, BlockState> condition) boolean
setBlock
(int x, int y, int z, int blockId) boolean
setBlock
(int x, int y, int z, int blockId, int meta) 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
setBlockData
(int x, int y, int z, int data) Deprecated.void
setBlockData
(int x, int y, int z, int layer, int data) Deprecated.void
setBlockId
(int x, int y, int z, int id) void
setBlockId
(int x, int y, int z, int layer, int id) Deprecated.void
setBlockLight
(int x, int y, int z, int level) void
setBlockSkyLight
(int x, int y, int z, int level) boolean
setBlockStateAt
(int x, int y, int z, int layer, BlockState state) boolean
setBlockStateAtLayer
(int x, int y, int z, int layer, BlockState state) boolean
setFullBlockId
(int x, int y, int z, int fullId) Deprecated.boolean
setFullBlockId
(int x, int y, int z, int layer, int fullId) Deprecated.protected void
setInternalSection
(float fY, ChunkSection section) void
setPaletteUpdatesDelayed
(boolean delayPaletteUpdates) boolean
setSection
(float fY, ChunkSection section) final int
toSectionY
(int blockPosY) Methods inherited from class cn.nukkit.level.format.generic.BaseFullChunk
addBlockEntity, addEntity, compress, getBiomeId, getBiomeIdArray, getBlockDataAt, getBlockDataAt, getBlockEntities, getBlockExtraData, getBlockExtraDataArray, getBlockIdAt, getBlockIdAt, getChanges, getChunk, getChunkPacket, getEntities, getHeightMap, getHighestBlockAt, getHighestBlockAt, getIndex, getSeed, getTile, getX, getZ, hasChanged, initChunk, isLightPopulated, isLoaded, populateSkyLight, recalculateHeightMap, recalculateHeightMapColumn, removeBlockEntity, removeEntity, setBiomeId, setBlockAt, setBlockDataAt, setBlockDataAt, setBlockExtraData, setBlockFullIdAt, setBlockFullIdAt, setBlockIdAt, setBlockIdAt, setChanged, setChanged, setChunk, setChunk, setChunkPacket, setHeightMap, setLightPopulated, setLightPopulated, setPosition, setProvider, setX, setZ, toFastBinary, unload, unload, unload
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.level.format.Chunk
getMaxHeight, getMinHeight, isChunkSection3DBiomeSupported
Methods inherited from interface cn.nukkit.level.ChunkManager
getBlockStateAt, getChunk, setBlockAt, setBlockStateAt
Methods inherited from interface cn.nukkit.level.format.FullChunk
addBlockEntity, addEntity, getAndSetBlockState, getBiomeId, getBiomeId, getBiomeIdArray, getBlockEntities, getBlockExtraData, getBlockExtraDataArray, getBlockRuntimeId, getBlockRuntimeId, getBlockState, getChunkSectionCount, getEntities, getHeightMap, getHighestBlockAt, getHighestBlockAt, getIndex, getTile, getX, getZ, hasChanged, initChunk, isGenerated, isLightPopulated, isLoaded, isNether, isOverWorld, isPopulated, isTheEnd, populateSkyLight, recalculateHeightMap, recalculateHeightMapColumn, removeBlockEntity, removeEntity, reObfuscateChunk, setBiome, setBiome, setBiomeId, setBiomeId, setBiomeId, setBiomeId, setBlockExtraData, setBlockState, setChanged, setChanged, setGenerated, setGenerated, setHeightMap, setLightPopulated, setLightPopulated, setPopulated, setPopulated, setPosition, setProvider, setX, setZ, toBinary, toFastBinary, unload, unload, unload
-
Field Details
-
sections
-
sectionLength
protected int sectionLength
-
-
Constructor Details
-
BaseChunk
public BaseChunk()
-
-
Method Details
-
backwardCompatibilityUpdate
@PowerNukkitOnly("Needed for level backward compatibility") @Since("1.3.0.0-PN") public void backwardCompatibilityUpdate(Level level) - Overrides:
backwardCompatibilityUpdate
in classBaseFullChunk
-
toSectionY
-
clone
- Overrides:
clone
in classBaseFullChunk
-
getBlockChanges
public long getBlockChanges()- Specified by:
getBlockChanges
in interfaceFullChunk
-
getSectionBlockChanges
- Parameters:
sectionY
-- Returns:
- 指定section的方块更改总数
-
scanBlocks
@Since("1.4.0.0-PN") @PowerNukkitOnly @NotNull public Stream<Block> scanBlocks(BlockVector3 min, BlockVector3 max, BiPredicate<BlockVector3, BlockState> condition) - Overrides:
scanBlocks
in classBaseFullChunk
-
getFullBlock
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public int getFullBlock(int x, int y, int z) Deprecated.- Specified by:
getFullBlock
in interfaceFullChunk
-
getFullBlock
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public int getFullBlock(int x, int y, int z, int layer) Deprecated.- Specified by:
getFullBlock
in interfaceFullChunk
-
getBlockState
- Specified by:
getBlockState
in interfaceFullChunk
-
setBlockAtLayer
- Specified by:
setBlockAtLayer
in interfaceChunkManager
- Specified by:
setBlockAtLayer
in interfaceFullChunk
- Overrides:
setBlockAtLayer
in classBaseFullChunk
-
setBlock
public boolean setBlock(int x, int y, int z, int blockId) -
getAndSetBlock
- Specified by:
getAndSetBlock
in interfaceFullChunk
-
getAndSetBlockState
@PowerNukkitOnly @Since("1.4.0.0-PN") public BlockState getAndSetBlockState(int x, int y, int z, int layer, BlockState state) - Specified by:
getAndSetBlockState
in interfaceFullChunk
-
getAndSetBlock
- Specified by:
getAndSetBlock
in interfaceFullChunk
-
setFullBlockId
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") public boolean setFullBlockId(int x, int y, int z, int fullId) Deprecated.- Specified by:
setFullBlockId
in interfaceFullChunk
-
setFullBlockId
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.3.0.0-PN") @PowerNukkitOnly public boolean setFullBlockId(int x, int y, int z, int layer, int fullId) Deprecated.- Specified by:
setFullBlockId
in interfaceFullChunk
-
setBlock
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public boolean setBlock(int x, int y, int z, int blockId, int meta) Deprecated. -
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
- Overrides:
setBlockAtLayer
in classBaseFullChunk
-
setBlockStateAtLayer
@PowerNukkitOnly @Since("1.4.0.0-PN") public boolean setBlockStateAtLayer(int x, int y, int z, int layer, BlockState state) - Specified by:
setBlockStateAtLayer
in interfaceFullChunk
-
getOrCreateMutableSection
-
createChunkSection
protected void createChunkSection(int sectionY) -
setBlockId
public void setBlockId(int x, int y, int z, int id) - Specified by:
setBlockId
in interfaceFullChunk
-
setBlockId
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public void setBlockId(int x, int y, int z, int layer, int id) Deprecated.- Specified by:
setBlockId
in interfaceFullChunk
-
getBlockId
public int getBlockId(int x, int y, int z) - Specified by:
getBlockId
in interfaceFullChunk
-
getBlockId
- Specified by:
getBlockId
in interfaceFullChunk
-
getBlockData
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public int getBlockData(int x, int y, int z) Deprecated.- Specified by:
getBlockData
in interfaceFullChunk
-
getBlockData
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public int getBlockData(int x, int y, int z, int layer) Deprecated.- Specified by:
getBlockData
in interfaceFullChunk
-
setBlockData
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") public void setBlockData(int x, int y, int z, int data) Deprecated.- Specified by:
setBlockData
in interfaceFullChunk
-
setBlockData
@Deprecated @DeprecationDetails(reason="The meta is limited to 32 bits", since="1.4.0.0-PN") @PowerNukkitOnly public void setBlockData(int x, int y, int z, int layer, int data) Deprecated.- Specified by:
setBlockData
in interfaceFullChunk
-
getBlockSkyLight
public int getBlockSkyLight(int x, int y, int z) - Specified by:
getBlockSkyLight
in interfaceFullChunk
-
setBlockSkyLight
public void setBlockSkyLight(int x, int y, int z, int level) - Specified by:
setBlockSkyLight
in interfaceFullChunk
-
getBlockLight
public int getBlockLight(int x, int y, int z) - Specified by:
getBlockLight
in interfaceFullChunk
-
setBlockLight
public void setBlockLight(int x, int y, int z, int level) - Specified by:
setBlockLight
in interfaceFullChunk
-
isSectionEmpty
public boolean isSectionEmpty(float fY) - Specified by:
isSectionEmpty
in interfaceChunk
-
getSection
- Specified by:
getSection
in interfaceChunk
-
setSection
- Specified by:
setSection
in interfaceChunk
-
setInternalSection
-
load
- Specified by:
load
in interfaceFullChunk
- Overrides:
load
in classBaseFullChunk
- Throws:
IOException
-
load
- Specified by:
load
in interfaceFullChunk
- Overrides:
load
in classBaseFullChunk
- Throws:
IOException
-
getBlockSkyLightArray
public byte[] getBlockSkyLightArray()- Specified by:
getBlockSkyLightArray
in interfaceFullChunk
- Overrides:
getBlockSkyLightArray
in classBaseFullChunk
-
getBlockLightArray
public byte[] getBlockLightArray()- Specified by:
getBlockLightArray
in interfaceFullChunk
- Overrides:
getBlockLightArray
in classBaseFullChunk
-
getSections
- Specified by:
getSections
in interfaceChunk
-
getHeightMapArray
public byte[] getHeightMapArray()- Specified by:
getHeightMapArray
in interfaceFullChunk
- Overrides:
getHeightMapArray
in classBaseFullChunk
-
getProvider
- Specified by:
getProvider
in interfaceFullChunk
- Overrides:
getProvider
in classBaseFullChunk
-
setBlockStateAt
@PowerNukkitOnly @Since("1.4.0.0-PN") public boolean setBlockStateAt(int x, int y, int z, int layer, BlockState state) - Specified by:
setBlockStateAt
in interfaceChunkManager
-
getBlockStateAt
- Specified by:
getBlockStateAt
in interfaceChunkManager
-
isBlockChangeAllowed
- Specified by:
isBlockChangeAllowed
in interfaceFullChunk
-
findBorders
- Specified by:
findBorders
in interfaceFullChunk
-
isBlockedByBorder
- Specified by:
isBlockedByBorder
in interfaceFullChunk
-
delayPaletteUpdates
-
isPaletteUpdatesDelayed
-
setPaletteUpdatesDelayed
@PowerNukkitOnly @Since("1.4.0.0-PN") public void setPaletteUpdatesDelayed(boolean delayPaletteUpdates)
-