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 official cxr
intermediary net/minecraft/class_2814
named net/minecraft/world/chunk/BiMapPalette
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.chunk.Palette
Palette.Factory
-
Field Summary
Modifier and TypeFieldDescriptionprivate final IndexedIterable<T>
private final int
private final PaletteResizeListener<T>
private final Int2ObjectBiMap<T>
-
Constructor Summary
ModifierConstructorDescriptionBiMapPalette
(IndexedIterable<T> idList, int indexBits, PaletteResizeListener<T> listener) BiMapPalette
(IndexedIterable<T> idList, int bits, PaletteResizeListener<T> listener, List<T> entries) private
BiMapPalette
(IndexedIterable<T> indexedIterable, int int2, PaletteResizeListener<T> paletteResizeListener, Int2ObjectBiMap<T> int2ObjectBiMap) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
static <A> Palette<A>
create
(int bits, IndexedIterable<A> idList, PaletteResizeListener<A> listener, List<A> entries) get
(int id) Returns the object associated with the givenid
.int
Returns the serialized size of this palette in a byte buf, in bytes.int
getSize()
Returns the size of the palette.boolean
Returnstrue
if any entry in this palette passes thepredicate
.int
Returns the ID of an object in this palette.void
readPacket
(PacketByteBuf buf) Initializes this palette from thebuf
.void
writePacket
(PacketByteBuf buf) Writes this palette to thebuf
.
-
Field Details
-
idList
- Mappings:
Namespace Name Mixin selector official a
Lcxr;a:Lhf;
intermediary field_12821
Lnet/minecraft/class_2814;field_12821:Lnet/minecraft/class_2359;
named idList
Lnet/minecraft/world/chunk/BiMapPalette;idList:Lnet/minecraft/util/collection/IndexedIterable;
-
map
- Mappings:
Namespace Name Mixin selector official b
Lcxr;b:Lalh;
intermediary field_12824
Lnet/minecraft/class_2814;field_12824:Lnet/minecraft/class_3513;
named map
Lnet/minecraft/world/chunk/BiMapPalette;map:Lnet/minecraft/util/collection/Int2ObjectBiMap;
-
listener
- Mappings:
Namespace Name Mixin selector official c
Lcxr;c:Lcxz;
intermediary field_12825
Lnet/minecraft/class_2814;field_12825:Lnet/minecraft/class_2835;
named listener
Lnet/minecraft/world/chunk/BiMapPalette;listener:Lnet/minecraft/world/chunk/PaletteResizeListener;
-
indexBits
private final int indexBits- Mappings:
Namespace Name Mixin selector official d
Lcxr;d:I
intermediary field_12822
Lnet/minecraft/class_2814;field_12822:I
named indexBits
Lnet/minecraft/world/chunk/BiMapPalette;indexBits:I
-
-
Constructor Details
-
BiMapPalette
public BiMapPalette(IndexedIterable<T> idList, int bits, PaletteResizeListener<T> listener, List<T> entries) - Mappings:
Namespace Name Mixin selector official <init>
Lcxr;<init>(Lhf;ILcxz;Ljava/util/List;)V
intermediary <init>
Lnet/minecraft/class_2814;<init>(Lnet/minecraft/class_2359;ILnet/minecraft/class_2835;Ljava/util/List;)V
named <init>
Lnet/minecraft/world/chunk/BiMapPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;ILnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)V
-
BiMapPalette
- Mappings:
Namespace Name Mixin selector official <init>
Lcxr;<init>(Lhf;ILcxz;)V
intermediary <init>
Lnet/minecraft/class_2814;<init>(Lnet/minecraft/class_2359;ILnet/minecraft/class_2835;)V
named <init>
Lnet/minecraft/world/chunk/BiMapPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;ILnet/minecraft/world/chunk/PaletteResizeListener;)V
-
BiMapPalette
private BiMapPalette(IndexedIterable<T> indexedIterable, int int2, PaletteResizeListener<T> paletteResizeListener, Int2ObjectBiMap<T> int2ObjectBiMap)
-
-
Method Details
-
create
public static <A> Palette<A> create(int bits, IndexedIterable<A> idList, PaletteResizeListener<A> listener, List<A> entries) - Mappings:
Namespace Name Mixin selector official a
Lcxr;a(ILhf;Lcxz;Ljava/util/List;)Lcxy;
intermediary method_38287
Lnet/minecraft/class_2814;method_38287(ILnet/minecraft/class_2359;Lnet/minecraft/class_2835;Ljava/util/List;)Lnet/minecraft/class_2837;
named create
Lnet/minecraft/world/chunk/BiMapPalette;create(ILnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)Lnet/minecraft/world/chunk/Palette;
-
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:
index
in interfacePalette<T>
- Parameters:
object
- the object to look up- Returns:
- the ID of an object in this palette
- Mappings:
Namespace Name Mixin selector official a
Lcxy;a(Ljava/lang/Object;)I
intermediary method_12291
Lnet/minecraft/class_2837;method_12291(Ljava/lang/Object;)I
named index
Lnet/minecraft/world/chunk/Palette;index(Ljava/lang/Object;)I
-
hasAny
Returnstrue
if any entry in this palette passes thepredicate
.- Specified by:
hasAny
in interfacePalette<T>
- Returns:
true
if any entry in this palette passes thepredicate
- Mappings:
Namespace Name Mixin selector official a
Lcxy;a(Ljava/util/function/Predicate;)Z
intermediary method_19525
Lnet/minecraft/class_2837;method_19525(Ljava/util/function/Predicate;)Z
named hasAny
Lnet/minecraft/world/chunk/Palette;hasAny(Ljava/util/function/Predicate;)Z
-
get
Returns the object associated with the givenid
.- Specified by:
get
in interfacePalette<T>
- Parameters:
id
- the ID to look up- Returns:
- the object associated with the given
id
- Mappings:
Namespace Name Mixin selector official a
Lcxy;a(I)Ljava/lang/Object;
intermediary method_12288
Lnet/minecraft/class_2837;method_12288(I)Ljava/lang/Object;
named get
Lnet/minecraft/world/chunk/Palette;get(I)Ljava/lang/Object;
-
readPacket
Initializes this palette from thebuf
. Clears the preexisting data in this palette.- Specified by:
readPacket
in interfacePalette<T>
- Parameters:
buf
- the packet byte buffer- Mappings:
Namespace Name Mixin selector official a
Lcxy;a(Lqx;)V
intermediary method_12289
Lnet/minecraft/class_2837;method_12289(Lnet/minecraft/class_2540;)V
named readPacket
Lnet/minecraft/world/chunk/Palette;readPacket(Lnet/minecraft/network/PacketByteBuf;)V
-
writePacket
Writes this palette to thebuf
.- Specified by:
writePacket
in interfacePalette<T>
- Parameters:
buf
- the packet byte buffer- Mappings:
Namespace Name Mixin selector official b
Lcxy;b(Lqx;)V
intermediary method_12287
Lnet/minecraft/class_2837;method_12287(Lnet/minecraft/class_2540;)V
named writePacket
Lnet/minecraft/world/chunk/Palette;writePacket(Lnet/minecraft/network/PacketByteBuf;)V
-
getPacketSize
public int getPacketSize()Returns the serialized size of this palette in a byte buf, in bytes.- Specified by:
getPacketSize
in interfacePalette<T>
- Returns:
- the serialized size of this palette in a byte buf, in bytes
- Mappings:
Namespace Name Mixin selector official a
Lcxy;a()I
intermediary method_12290
Lnet/minecraft/class_2837;method_12290()I
named getPacketSize
Lnet/minecraft/world/chunk/Palette;getPacketSize()I
-
getElements
- Mappings:
Namespace Name Mixin selector official d
Lcxr;d()Ljava/util/List;
intermediary method_38288
Lnet/minecraft/class_2814;method_38288()Ljava/util/List;
named getElements
Lnet/minecraft/world/chunk/BiMapPalette;getElements()Ljava/util/List;
-
getSize
public int getSize()Returns the size of the palette. -
copy
-