Interface IBlocks
- All Superinterfaces:
Trimable
- All Known Subinterfaces:
IChunk
,IChunkGet
,IChunkSet
,IQueueChunk<T>
- All Known Implementing Classes:
BitSetBlocks
,CharBlocks
,CharGetBlocks
,CharSetBlocks
,ChunkHolder
,NullChunk
,NullChunkGet
,ThreadUnsafeCharBlocks
A shared interface for IGetBlocks and ISetBlocks.
-
Method Summary
Modifier and TypeMethodDescriptionentities()
getBiomeType
(int x, int y, int z) default int
getBlock
(int x, int y, int z) default Set
<CompoundTag> Deprecated, for removal: This API element is subject to removal in a future version.int
Get the highest layer position stored in the internal chunk.int
Get the lowest layer position stored in the internal chunk.int
Get the number of stored sectionsdefault CompoundTag
getTile
(int x, int y, int z) Deprecated, for removal: This API element is subject to removal in a future version.default Map
<BlockVector3, CompoundTag> getTiles()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
hasSection
(int layer) Returns if the chunk has a BLOCKS section at the given layer.char[]
load
(int layer) Obtain the specified chunk section stored as an array of ordinals.char[]
loadIfPresent
(int layer) Obtain the specified chunk section stored as an array of ordinals if present or null.void
removeSectionLighting
(int layer, boolean sky) reset()
tile
(int x, int y, int z) tiles()
default byte[]
toByteArray
(boolean full, boolean stretched) default byte[]
toByteArray
(byte[] buffer, int bitMask, boolean full, boolean stretched) boolean
trim
(boolean aggressive, int layer)
-
Method Details
-
hasSection
boolean hasSection(int layer) Returns if the chunk has a BLOCKS section at the given layer. May not be indicative of presence of entities, tile entites, biomes, etc.- Parameters:
layer
- chunk section layer- Returns:
- if blocks/a block section is present
-
load
char[] load(int layer) Obtain the specified chunk section stored as an array of ordinals. Uses normal minecraft chunk-section position indices (length 4096). Operations synchronises on the section and will load the section into memory if not present. For chunk GET operations, this will load the data from the world. For chunk SET, this will create a new empty array.- Parameters:
layer
- chunk section layer (may be negative)- Returns:
- char array of ordinals of the chunk section
-
loadIfPresent
@Nullable char[] loadIfPresent(int layer) Obtain the specified chunk section stored as an array of ordinals if present or null. Uses normal minecraft chunk-section position indices (length 4096). Does not synchronise to the section layer as it will not attempt to load into memory.- Parameters:
layer
- chunk section layer (may be negative)- Returns:
- char array of ordinals of the chunk section if present
-
getBlock
-
getTiles
Deprecated, for removal: This API element is subject to removal in a future version. -
tiles
Map<BlockVector3,FaweCompoundTag> tiles() -
getTile
Deprecated, for removal: This API element is subject to removal in a future version. -
tile
-
getEntities
Deprecated, for removal: This API element is subject to removal in a future version. -
entities
Collection<FaweCompoundTag> entities() -
getBiomeType
-
getBitMask
default int getBitMask() -
removeSectionLighting
void removeSectionLighting(int layer, boolean sky) -
trim
boolean trim(boolean aggressive, int layer) -
reset
IBlocks reset() -
getSectionCount
int getSectionCount()Get the number of stored sections -
getMaxSectionPosition
int getMaxSectionPosition()Get the highest layer position stored in the internal chunk. For 1.16 and below, always returns 15. For 1.17 and above, may not return a value correct to the world if this is aIChunkSet
instance, which defaults to 15. For extended height worlds, this will only return over 15 if blocks are stored outside the default range. -
getMinSectionPosition
int getMinSectionPosition()Get the lowest layer position stored in the internal chunk. For 1.16 and below, always returns 0. For 1.17 and above, may not return a value correct to the world if this is aIChunkSet
instance, which defaults to 0. For extended height worlds, this will only return under 0 if blocks are stored outside the default range. -
toByteArray
default byte[] toByteArray(boolean full, boolean stretched) -
toByteArray
default byte[] toByteArray(byte[] buffer, int bitMask, boolean full, boolean stretched)
-