public final class DataPaletteImpl extends java.lang.Object implements DataPalette
Constructor and Description |
---|
DataPaletteImpl(int valuesLength) |
DataPaletteImpl(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 |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
idAt, setIdAt
public DataPaletteImpl(int valuesLength)
public DataPaletteImpl(int valuesLength, int expectedPaletteLength)
public int index(int x, int y, int z)
DataPalette
index
in interface DataPalette
x
- xy
- yz
- zpublic int idAt(int sectionCoordinate)
DataPalette
idAt
in interface DataPalette
sectionCoordinate
- section index within the sectionpublic void setIdAt(int sectionCoordinate, int id)
DataPalette
setIdAt
in interface DataPalette
sectionCoordinate
- section index within the sectionid
- id valuepublic int paletteIndexAt(int packedCoordinate)
DataPalette
paletteIndexAt
in interface DataPalette
packedCoordinate
- section indexpublic void setPaletteIndexAt(int sectionCoordinate, int index)
DataPalette
setPaletteIndexAt
in interface DataPalette
sectionCoordinate
- section indexindex
- palette indexpublic int size()
DataPalette
size
in interface DataPalette
public int idByIndex(int index)
DataPalette
idByIndex
in interface DataPalette
index
- palette indexpublic void setIdByIndex(int index, int id)
DataPalette
setIdByIndex
in interface DataPalette
index
- palette indexid
- id valuepublic void replaceId(int oldId, int newId)
DataPalette
replaceId
in interface DataPalette
oldId
- old idnewId
- new idpublic void addId(int id)
DataPalette
addId
in interface DataPalette
id
- id valuepublic void clear()
DataPalette
clear
in interface DataPalette