Modifier and Type | Field and Description |
---|---|
private T[] |
array |
private IdList<T> |
idList |
private int |
indexBits |
private PaletteResizeListener<T> |
resizeListener |
private int |
size |
private Function<CompoundTag,T> |
valueDeserializer |
Constructor and Description |
---|
ArrayPalette(IdList<T> idList,
int integer,
PaletteResizeListener<T> resizeListener,
Function<CompoundTag,T> valueDeserializer) |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(Predicate<T> predicate) |
void |
fromPacket(PacketByteBuf buf) |
void |
fromTag(ListTag tag) |
T |
getByIndex(int index) |
int |
getIndex(T object) |
int |
getPacketSize() |
int |
getSize() |
void |
toPacket(PacketByteBuf buf) |
private final T[] array
private final PaletteResizeListener<T> resizeListener
private final Function<CompoundTag,T> valueDeserializer
private final int indexBits
private int size
public ArrayPalette(IdList<T> idList, int integer, PaletteResizeListener<T> resizeListener, Function<CompoundTag,T> valueDeserializer)
@Nullable public T getByIndex(int index)
getByIndex
in interface Palette<T>
@Environment(value=CLIENT) public void fromPacket(PacketByteBuf buf)
fromPacket
in interface Palette<T>
public void toPacket(PacketByteBuf buf)
public int getPacketSize()
getPacketSize
in interface Palette<T>
public int getSize()