Modifier and Type | Field and Description |
---|---|
private int |
arraySize |
private int |
bits |
private java.util.function.Function<CompoundNBT,T> |
deserializer |
private ObjectIntIdentityMap<T> |
registry |
private IResizeCallback<T> |
resizeHandler |
private T[] |
states |
Constructor and Description |
---|
PaletteArray(ObjectIntIdentityMap<T> registryIn,
int bitsIn,
IResizeCallback<T> resizeHandlerIn,
java.util.function.Function<CompoundNBT,T> deserializerIn) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T value) |
T |
get(int indexKey) |
int |
getPaletteSize() |
int |
getSerializedSize() |
int |
idFor(T state) |
void |
read(ListNBT nbt) |
void |
read(PacketBuffer buf) |
void |
write(PacketBuffer buf) |
private final ObjectIntIdentityMap<T> registry
private final T[] states
private final IResizeCallback<T> resizeHandler
private final java.util.function.Function<CompoundNBT,T> deserializer
private final int bits
private int arraySize
public PaletteArray(ObjectIntIdentityMap<T> registryIn, int bitsIn, IResizeCallback<T> resizeHandlerIn, java.util.function.Function<CompoundNBT,T> deserializerIn)
public void read(PacketBuffer buf)
public void write(PacketBuffer buf)
public int getSerializedSize()
getSerializedSize
in interface IPalette<T>
public int getPaletteSize()