Package net.minecraft.world.chunk
Class BiMapPalette<T>
java.lang.Object
net.minecraft.world.chunk.BiMapPalette<T>
- All Implemented Interfaces:
Palette<T>
public class BiMapPalette<T> extends Object implements Palette<T>
-
Field Summary
Fields Modifier and Type Field Description private Function<CompoundTag,T>elementDeserializerprivate Function<T,CompoundTag>elementSerializerprivate IdList<T>idListprivate intindexBitsprivate Int2ObjectBiMap<T>mapprivate PaletteResizeListener<T>resizeHandler -
Constructor Summary
Constructors Constructor Description BiMapPalette(IdList<T> idList, int indexBits, PaletteResizeListener<T> resizeHandler, Function<CompoundTag,T> elementDeserializer, Function<T,CompoundTag> elementSerializer) -
Method Summary
Modifier and Type Method Description booleanaccepts(Predicate<T> predicate)voidfromPacket(PacketByteBuf buf)voidfromTag(ListTag tag)TgetByIndex(int index)intgetIndex(T object)intgetIndexBits()intgetPacketSize()voidtoPacket(PacketByteBuf buf)voidtoTag(ListTag tag)
-
Field Details
-
idList
-
map
-
resizeHandler
-
elementDeserializer
-
elementSerializer
-
indexBits
private final int indexBits
-
-
Constructor Details
-
BiMapPalette
public BiMapPalette(IdList<T> idList, int indexBits, PaletteResizeListener<T> resizeHandler, Function<CompoundTag,T> elementDeserializer, Function<T,CompoundTag> elementSerializer)
-
-
Method Details
-
getIndex
-
accepts
-
getByIndex
- Specified by:
getByIndexin interfacePalette<T>
-
fromPacket
- Specified by:
fromPacketin interfacePalette<T>
-
toPacket
-
getPacketSize
public int getPacketSize()- Specified by:
getPacketSizein interfacePalette<T>
-
getIndexBits
public int getIndexBits() -
fromTag
-
toTag
-