Interface DataPalette
- All Known Implementing Classes:
DataPaletteImpl
public interface DataPalette
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddId(int id) Adds a new id to the palette.voidclear()Clears the palette.intidAt(int sectionCoordinate) Returns the value of the given chunk coordinate.default intidAt(int sectionX, int sectionY, int sectionZ) Returns the value of the section coordinate.intidByIndex(int index) Returns the id assigned to the given palette index.intindex(int x, int y, int z) Returns the packet section index of the given coordinates.intpaletteIndexAt(int packedCoordinate) Returns the palette index of the given section index.voidreplaceId(int oldId, int newId) Replaces an id in the palette.voidsetIdAt(int sectionCoordinate, int id) Set a value in the chunk section.default voidsetIdAt(int sectionX, int sectionY, int sectionZ, int id) Set a value in the chunk section.voidsetIdByIndex(int index, int id) Assigns an id assigned to the given palette index.voidsetPaletteIndexAt(int sectionCoordinate, int index) Sets the index of the given section coordinate.intsize()Returns the size of the palette.
-
Method Details
-
index
int index(int x, int y, int z) Returns the packet section index of the given coordinates.- Parameters:
x- xy- yz- z- Returns:
- packed section index of the given coordinates
-
idAt
int idAt(int sectionCoordinate) Returns the value of the given chunk coordinate.- Parameters:
sectionCoordinate- section index within the section- Returns:
- section state of the given index
-
idAt
default int idAt(int sectionX, int sectionY, int sectionZ) Returns the value of the section coordinate.- Parameters:
sectionX- section xsectionY- section ysectionZ- section z- Returns:
- id of the given section coordinate
-
setIdAt
void setIdAt(int sectionCoordinate, int id) Set a value in the chunk section. This method does not update non-air blocks count.- Parameters:
sectionCoordinate- section index within the sectionid- id value
-
setIdAt
default void setIdAt(int sectionX, int sectionY, int sectionZ, int id) Set a value in the chunk section. This method does not update non-air blocks count.- Parameters:
sectionX- section xsectionY- section ysectionZ- section zid- id value
-
idByIndex
int idByIndex(int index) Returns the id assigned to the given palette index.- Parameters:
index- palette index- Returns:
- id assigned to the given palette index
-
setIdByIndex
void setIdByIndex(int index, int id) Assigns an id assigned to the given palette index.- Parameters:
index- palette indexid- id value
-
paletteIndexAt
int paletteIndexAt(int packedCoordinate) Returns the palette index of the given section index.- Parameters:
packedCoordinate- section index- Returns:
- palette index of the given section index
-
setPaletteIndexAt
void setPaletteIndexAt(int sectionCoordinate, int index) Sets the index of the given section coordinate.- Parameters:
sectionCoordinate- section indexindex- palette index
-
addId
void addId(int id) Adds a new id to the palette.- Parameters:
id- id value
-
replaceId
void replaceId(int oldId, int newId) Replaces an id in the palette.- Parameters:
oldId- old idnewId- new id
-
size
int size()Returns the size of the palette.- Returns:
- palette size
-
clear
void clear()Clears the palette.
-