Constructor and Description |
---|
PaletteImpl(int valuesLength) |
PaletteImpl(int valuesLength,
int expectedPaletteLength) |
Modifier and Type | Method and Description |
---|---|
void |
addId(int id)
Adds a new id to the palette.
|
void |
clear()
Clears the palette.
|
int[] |
getValues() |
int |
idAt(int sectionCoordinate)
Returns the value of the given chunk coordinate.
|
int |
idByIndex(int index)
Returns the id assigned to the given palette index.
|
int |
index(int x,
int y,
int z)
Returns the packet section index of the given coordinates.
|
int |
paletteIndexAt(int packedCoordinate)
Returns the palette index of the given section index.
|
void |
replaceId(int oldId,
int newId)
Replaces an id in the palette.
|
void |
setIdAt(int sectionCoordinate,
int id)
Set a value in the chunk section.
|
void |
setIdByIndex(int index,
int id)
Assigns an id assigned to the given palette index.
|
void |
setPaletteIndexAt(int sectionCoordinate,
int index)
Sets the index of the given section coordinate.
|
int |
size()
Returns the size of the palette.
|
public PaletteImpl(int valuesLength)
public PaletteImpl(int valuesLength, int expectedPaletteLength)
public int index(int x, int y, int z)
Palette
public int idAt(int sectionCoordinate)
Palette
public void setIdAt(int sectionCoordinate, int id)
Palette
public int paletteIndexAt(int packedCoordinate)
Palette
paletteIndexAt
in interface Palette
packedCoordinate
- section indexpublic void setPaletteIndexAt(int sectionCoordinate, int index)
Palette
setPaletteIndexAt
in interface Palette
sectionCoordinate
- section indexindex
- palette indexpublic int size()
Palette
public int idByIndex(int index)
Palette
public void setIdByIndex(int index, int id)
Palette
setIdByIndex
in interface Palette
index
- palette indexid
- id valuepublic void replaceId(int oldId, int newId)
Palette
public void addId(int id)
Palette
public void clear()
Palette