Modifier and Type | Field and Description |
---|---|
private int |
bits |
private java.util.function.Function<CompoundNBT,T> |
deserializer |
private IResizeCallback<T> |
paletteResizer |
private ObjectIntIdentityMap<T> |
registry |
private java.util.function.Function<T,CompoundNBT> |
serializer |
private IntIdentityHashBiMap<T> |
statePaletteMap |
Constructor and Description |
---|
PaletteHashMap(ObjectIntIdentityMap<T> backingRegistry,
int bitsIn,
IResizeCallback<T> paletteResizerIn,
java.util.function.Function<CompoundNBT,T> deserializerIn,
java.util.function.Function<T,CompoundNBT> p_i48964_5_) |
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) |
void |
writePaletteToList(ListNBT paletteList) |
private final ObjectIntIdentityMap<T> registry
private final IntIdentityHashBiMap<T> statePaletteMap
private final IResizeCallback<T> paletteResizer
private final java.util.function.Function<CompoundNBT,T> deserializer
private final java.util.function.Function<T,CompoundNBT> serializer
private final int bits
public PaletteHashMap(ObjectIntIdentityMap<T> backingRegistry, int bitsIn, IResizeCallback<T> paletteResizerIn, java.util.function.Function<CompoundNBT,T> deserializerIn, java.util.function.Function<T,CompoundNBT> p_i48964_5_)
public void read(PacketBuffer buf)
public void write(PacketBuffer buf)
public int getSerializedSize()
getSerializedSize
in interface IPalette<T>
public int getPaletteSize()
public void writePaletteToList(ListNBT paletteList)