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>
elementDeserializer
private Function<T,CompoundTag>
elementSerializer
private IdList<T>
idList
private int
indexBits
private Int2ObjectBiMap<T>
map
private 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 boolean
accepts(Predicate<T> predicate)
void
fromPacket(PacketByteBuf buf)
void
fromTag(ListTag tag)
T
getByIndex(int index)
int
getIndex(T object)
int
getIndexBits()
int
getPacketSize()
void
toPacket(PacketByteBuf buf)
void
toTag(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:
getByIndex
in interfacePalette<T>
-
fromPacket
- Specified by:
fromPacket
in interfacePalette<T>
-
toPacket
-
getPacketSize
public int getPacketSize()- Specified by:
getPacketSize
in interfacePalette<T>
-
getIndexBits
public int getIndexBits() -
fromTag
-
toTag
-