Package net.minecraft.util.palette
Class HashMapPalette<T>
- java.lang.Object
-
- net.minecraft.util.palette.HashMapPalette<T>
-
-
Field Summary
Fields Modifier and Type Field Description private int
bits
private java.util.function.Function<CompoundNBT,T>
reader
private ObjectIntIdentityMap<T>
registry
private IResizeCallback<T>
resizeHandler
private IntIdentityHashBiMap<T>
values
private java.util.function.Function<T,CompoundNBT>
writer
-
Constructor Summary
Constructors Constructor Description HashMapPalette(ObjectIntIdentityMap<T> p_i48964_1_, int p_i48964_2_, IResizeCallback<T> p_i48964_3_, java.util.function.Function<CompoundNBT,T> p_i48964_4_, java.util.function.Function<T,CompoundNBT> p_i48964_5_)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getSerializedSize()
int
getSize()
int
idFor(T p_186041_1_)
boolean
maybeHas(java.util.function.Predicate<T> p_230341_1_)
void
read(ListNBT p_196968_1_)
void
read(PacketBuffer p_186038_1_)
T
valueFor(int p_186039_1_)
void
write(ListNBT p_196969_1_)
void
write(PacketBuffer p_186037_1_)
-
-
-
Field Detail
-
registry
private final ObjectIntIdentityMap<T> registry
-
values
private final IntIdentityHashBiMap<T> values
-
resizeHandler
private final IResizeCallback<T> resizeHandler
-
reader
private final java.util.function.Function<CompoundNBT,T> reader
-
writer
private final java.util.function.Function<T,CompoundNBT> writer
-
bits
private final int bits
-
-
Constructor Detail
-
HashMapPalette
public HashMapPalette(ObjectIntIdentityMap<T> p_i48964_1_, int p_i48964_2_, IResizeCallback<T> p_i48964_3_, java.util.function.Function<CompoundNBT,T> p_i48964_4_, java.util.function.Function<T,CompoundNBT> p_i48964_5_)
-
-
Method Detail
-
maybeHas
public boolean maybeHas(java.util.function.Predicate<T> p_230341_1_)
-
valueFor
@Nullable public T valueFor(int p_186039_1_)
-
read
public void read(PacketBuffer p_186038_1_)
-
write
public void write(PacketBuffer p_186037_1_)
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfaceIPalette<T>
-
getSize
public int getSize()
-
write
public void write(ListNBT p_196969_1_)
-
-