Interface ChunkSection
- All Known Implementing Classes:
ChunkSectionImpl
public interface ChunkSection
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Size (dimensions) of biomes in a chunks section.static final int
Size (dimensions) of blocks in a chunks section. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPalette
(PaletteType type, DataPalette blockPalette) @Nullable ChunkSectionLight
getLight()
Returns the light of the chunk section.int
Returns the number of non-air blocks in this section.default boolean
hasLight()
Returns whether this section holds light data.static int
index
(int x, int y, int z) @Nullable DataPalette
palette
(PaletteType type) Returns the palette of the given type if present.void
removePalette
(PaletteType type) void
setLight
(@Nullable ChunkSectionLight light) void
setNonAirBlocksCount
(int nonAirBlocksCount) static int
xFromIndex
(int idx) static int
yFromIndex
(int idx) static int
zFromIndex
(int idx)
-
Field Details
-
SIZE
static final int SIZESize (dimensions) of blocks in a chunks section.- See Also:
-
BIOME_SIZE
static final int BIOME_SIZESize (dimensions) of biomes in a chunks section.- See Also:
-
-
Method Details
-
index
static int index(int x, int y, int z) -
xFromIndex
static int xFromIndex(int idx) -
yFromIndex
static int yFromIndex(int idx) -
zFromIndex
static int zFromIndex(int idx) -
getNonAirBlocksCount
int getNonAirBlocksCount()Returns the number of non-air blocks in this section.- Returns:
- non-air blocks in this section
-
setNonAirBlocksCount
void setNonAirBlocksCount(int nonAirBlocksCount) -
hasLight
default boolean hasLight()Returns whether this section holds light data. Only true for < 1.14 chunks.- Returns:
- whether this section holds light data
-
getLight
@Nullable ChunkSectionLight getLight()Returns the light of the chunk section. Only present for < 1.14 chunks, otherwise sent separately.- Returns:
- chunk section light if present
-
setLight
-
palette
Returns the palette of the given type if present.- Parameters:
type
- type of the palette- Returns:
- palette
-
addPalette
-
removePalette
-