Interface ChunkSection
- All Known Implementing Classes:
ChunkSectionImpl
public interface ChunkSection
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSize (dimensions) of biomes in a chunks section.static final intSize (dimensions) of blocks in a chunks section. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPalette(PaletteType type, DataPalette blockPalette) @Nullable ChunkSectionLightgetLight()Returns the light of the chunk section.intReturns the number of non-air blocks in this section.default booleanhasLight()Returns whether this section holds light data.static intindex(int x, int y, int z) @Nullable DataPalettepalette(PaletteType type) Returns the palette of the given type if present.voidremovePalette(PaletteType type) voidsetLight(@Nullable ChunkSectionLight light) voidsetNonAirBlocksCount(int nonAirBlocksCount) static intxFromIndex(int idx) static intyFromIndex(int idx) static intzFromIndex(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
-