Package net.minecraft.world.chunk
Class BiMapPalette<T>
java.lang.Object
net.minecraft.world.chunk.BiMapPalette<T>
- All Implemented Interfaces:
Palette<T>
A palette backed by a bidirectional hash table.
- Mappings:
Namespace Name named net/minecraft/world/chunk/BiMapPaletteintermediary net/minecraft/class_2814official elt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.chunk.Palette
Palette.Factory -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionBiMapPalette(int indexBits) BiMapPalette(int indexBits, List<T> values) privateBiMapPalette(int indexBits, Int2ObjectBiMap<T> map) -
Method Summary
Modifier and TypeMethodDescriptioncopy()static <A> Palette<A> get(int id) Returns the object associated with the givenid.intgetPacketSize(IndexedIterable<T> idList) Returns the serialized size of this palette in a byte buf, in bytes.intgetSize()Returns the size of the palette.booleanReturnstrueif any entry in this palette passes thepredicate.intindex(T object, PaletteResizeListener<T> listener) Returns the ID of an object in this palette.voidreadPacket(PacketByteBuf buf, IndexedIterable<T> idList) Initializes this palette from thebuf.voidwritePacket(PacketByteBuf buf, IndexedIterable<T> idList) Writes this palette to thebuf.
-
Field Details
-
map
- Mappings:
Namespace Name Mixin selector named mapLnet/minecraft/world/chunk/BiMapPalette;map:Lnet/minecraft/util/collection/Int2ObjectBiMap;intermediary field_12824Lnet/minecraft/class_2814;field_12824:Lnet/minecraft/class_3513;official aLelt;a:Lbec;
-
indexBits
private final int indexBits- Mappings:
Namespace Name Mixin selector named indexBitsLnet/minecraft/world/chunk/BiMapPalette;indexBits:Iintermediary field_12822Lnet/minecraft/class_2814;field_12822:Iofficial bLelt;b:I
-
-
Constructor Details
-
BiMapPalette
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/BiMapPalette;<init>(ILjava/util/List;)Vintermediary <init>Lnet/minecraft/class_2814;<init>(ILjava/util/List;)Vofficial <init>Lelt;<init>(ILjava/util/List;)V
-
BiMapPalette
public BiMapPalette(int indexBits) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/BiMapPalette;<init>(I)Vintermediary <init>Lnet/minecraft/class_2814;<init>(I)Vofficial <init>Lelt;<init>(I)V
-
BiMapPalette
- Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/BiMapPalette;<init>(ILnet/minecraft/util/collection/Int2ObjectBiMap;)Vintermediary <init>Lnet/minecraft/class_2814;<init>(ILnet/minecraft/class_3513;)Vofficial <init>Lelt;<init>(ILbec;)V
-
-
Method Details
-
create
- Mappings:
Namespace Name Mixin selector named createLnet/minecraft/world/chunk/BiMapPalette;create(ILjava/util/List;)Lnet/minecraft/world/chunk/Palette;intermediary method_38287Lnet/minecraft/class_2814;method_38287(ILjava/util/List;)Lnet/minecraft/class_2837;official aLelt;a(ILjava/util/List;)Lemb;
-
index
Returns the ID of an object in this palette.If the object does not yet exist in this palette, this palette will register the object. If the palette is too small to include this object, a resize listener will be called and this palette may be discarded.
- Specified by:
indexin interfacePalette<T>- Parameters:
object- the object to look up- Returns:
- the ID of an object in this palette
- Mappings:
Namespace Name Mixin selector named indexLnet/minecraft/world/chunk/Palette;index(Ljava/lang/Object;Lnet/minecraft/world/chunk/PaletteResizeListener;)Iintermediary method_12291Lnet/minecraft/class_2837;method_12291(Ljava/lang/Object;Lnet/minecraft/class_2835;)Iofficial aLemb;a(Ljava/lang/Object;Lemc;)I
-
hasAny
Returnstrueif any entry in this palette passes thepredicate.- Specified by:
hasAnyin interfacePalette<T>- Returns:
trueif any entry in this palette passes thepredicate- Mappings:
Namespace Name Mixin selector named hasAnyLnet/minecraft/world/chunk/Palette;hasAny(Ljava/util/function/Predicate;)Zintermediary method_19525Lnet/minecraft/class_2837;method_19525(Ljava/util/function/Predicate;)Zofficial aLemb;a(Ljava/util/function/Predicate;)Z
-
get
Returns the object associated with the givenid.- Specified by:
getin interfacePalette<T>- Parameters:
id- the ID to look up- Returns:
- the object associated with the given
id - Throws:
EntryMissingException- if this ID does not exist in this palette- Mappings:
Namespace Name Mixin selector named getLnet/minecraft/world/chunk/Palette;get(I)Ljava/lang/Object;intermediary method_12288Lnet/minecraft/class_2837;method_12288(I)Ljava/lang/Object;official aLemb;a(I)Ljava/lang/Object;
-
readPacket
Initializes this palette from thebuf. Clears the preexisting data in this palette.- Specified by:
readPacketin interfacePalette<T>- Parameters:
buf- the packet byte buffer- Mappings:
Namespace Name Mixin selector named readPacketLnet/minecraft/world/chunk/Palette;readPacket(Lnet/minecraft/network/PacketByteBuf;Lnet/minecraft/util/collection/IndexedIterable;)Vintermediary method_12289Lnet/minecraft/class_2837;method_12289(Lnet/minecraft/class_2540;Lnet/minecraft/class_2359;)Vofficial aLemb;a(Lwn;Ljp;)V
-
writePacket
Writes this palette to thebuf.- Specified by:
writePacketin interfacePalette<T>- Parameters:
buf- the packet byte buffer- Mappings:
Namespace Name Mixin selector named writePacketLnet/minecraft/world/chunk/Palette;writePacket(Lnet/minecraft/network/PacketByteBuf;Lnet/minecraft/util/collection/IndexedIterable;)Vintermediary method_12287Lnet/minecraft/class_2837;method_12287(Lnet/minecraft/class_2540;Lnet/minecraft/class_2359;)Vofficial bLemb;b(Lwn;Ljp;)V
-
getPacketSize
Returns the serialized size of this palette in a byte buf, in bytes.- Specified by:
getPacketSizein interfacePalette<T>- Returns:
- the serialized size of this palette in a byte buf, in bytes
- Mappings:
Namespace Name Mixin selector named getPacketSizeLnet/minecraft/world/chunk/Palette;getPacketSize(Lnet/minecraft/util/collection/IndexedIterable;)Iintermediary method_12290Lnet/minecraft/class_2837;method_12290(Lnet/minecraft/class_2359;)Iofficial aLemb;a(Ljp;)I
-
getElements
- Mappings:
Namespace Name Mixin selector named getElementsLnet/minecraft/world/chunk/BiMapPalette;getElements()Ljava/util/List;intermediary method_38288Lnet/minecraft/class_2814;method_38288()Ljava/util/List;official cLelt;c()Ljava/util/List;
-
getSize
public int getSize()Returns the size of the palette. -
copy
-