Package net.minecraft.world.chunk
Class ArrayPalette<T>
java.lang.Object
net.minecraft.world.chunk.ArrayPalette<T>
- All Implemented Interfaces:
Palette<T>
A palette that stores the possible entries in an array and maps them
to their indices in the array.
- Mappings:
Namespace Name named net/minecraft/world/chunk/ArrayPaletteintermediary net/minecraft/class_2834official eeb
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.world.chunk.Palette
Palette.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final T[]private final IndexedIterable<T> private final intprivate final PaletteResizeListener<T> private int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateArrayPalette(IndexedIterable<T> idList, int bits, PaletteResizeListener<T> listener, List<T> list) privateArrayPalette(IndexedIterable<T> idList, T[] array, PaletteResizeListener<T> listener, int indexBits, int size) -
Method Summary
Modifier and TypeMethodDescriptioncopy(PaletteResizeListener<T> resizeListener) static <A> Palette<A> create(int bits, IndexedIterable<A> idList, PaletteResizeListener<A> listener, List<A> list) get(int id) Returns the object associated with the givenid.intReturns 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.intReturns the ID of an object in this palette.voidreadPacket(PacketByteBuf buf) Initializes this palette from thebuf.voidwritePacket(PacketByteBuf buf) Writes this palette to thebuf.
-
Field Details
-
idList
- Mappings:
Namespace Name Mixin selector named idListLnet/minecraft/world/chunk/ArrayPalette;idList:Lnet/minecraft/util/collection/IndexedIterable;intermediary field_12900Lnet/minecraft/class_2834;field_12900:Lnet/minecraft/class_2359;official aLeeb;a:Ljl;
-
array
- Mappings:
Namespace Name Mixin selector named arrayLnet/minecraft/world/chunk/ArrayPalette;array:[Ljava/lang/Object;intermediary field_12904Lnet/minecraft/class_2834;field_12904:[Ljava/lang/Object;official bLeeb;b:[Ljava/lang/Object;
-
listener
- Mappings:
Namespace Name Mixin selector named listenerLnet/minecraft/world/chunk/ArrayPalette;listener:Lnet/minecraft/world/chunk/PaletteResizeListener;intermediary field_12905Lnet/minecraft/class_2834;field_12905:Lnet/minecraft/class_2835;official cLeeb;c:Leee;
-
indexBits
private final int indexBits- Mappings:
Namespace Name Mixin selector named indexBitsLnet/minecraft/world/chunk/ArrayPalette;indexBits:Iintermediary field_12903Lnet/minecraft/class_2834;field_12903:Iofficial dLeeb;d:I
-
size
private int size- Mappings:
Namespace Name Mixin selector named sizeLnet/minecraft/world/chunk/ArrayPalette;size:Iintermediary field_12901Lnet/minecraft/class_2834;field_12901:Iofficial eLeeb;e:I
-
-
Constructor Details
-
ArrayPalette
private ArrayPalette(IndexedIterable<T> idList, int bits, PaletteResizeListener<T> listener, List<T> list) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/ArrayPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;ILnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)Vintermediary <init>Lnet/minecraft/class_2834;<init>(Lnet/minecraft/class_2359;ILnet/minecraft/class_2835;Ljava/util/List;)Vofficial <init>Leeb;<init>(Ljl;ILeee;Ljava/util/List;)V
-
ArrayPalette
private ArrayPalette(IndexedIterable<T> idList, T[] array, PaletteResizeListener<T> listener, int indexBits, int size) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/world/chunk/ArrayPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;[Ljava/lang/Object;Lnet/minecraft/world/chunk/PaletteResizeListener;II)Vintermediary <init>Lnet/minecraft/class_2834;<init>(Lnet/minecraft/class_2359;[Ljava/lang/Object;Lnet/minecraft/class_2835;II)Vofficial <init>Leeb;<init>(Ljl;[Ljava/lang/Object;Leee;II)V
-
-
Method Details
-
create
public static <A> Palette<A> create(int bits, IndexedIterable<A> idList, PaletteResizeListener<A> listener, List<A> list) - Mappings:
Namespace Name Mixin selector named createLnet/minecraft/world/chunk/ArrayPalette;create(ILnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)Lnet/minecraft/world/chunk/Palette;intermediary method_38295Lnet/minecraft/class_2834;method_38295(ILnet/minecraft/class_2359;Lnet/minecraft/class_2835;Ljava/util/List;)Lnet/minecraft/class_2837;official aLeeb;a(ILjl;Leee;Ljava/util/List;)Leed;
-
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;)Iintermediary method_12291Lnet/minecraft/class_2837;method_12291(Ljava/lang/Object;)Iofficial aLeed;a(Ljava/lang/Object;)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 aLeed;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 aLeed;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;)Vintermediary method_12289Lnet/minecraft/class_2837;method_12289(Lnet/minecraft/class_2540;)Vofficial aLeed;a(Lvy;)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;)Vintermediary method_12287Lnet/minecraft/class_2837;method_12287(Lnet/minecraft/class_2540;)Vofficial bLeed;b(Lvy;)V
-
getPacketSize
public int 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()Iintermediary method_12290Lnet/minecraft/class_2837;method_12290()Iofficial aLeed;a()I
-
getSize
public int getSize()Returns the size of the palette. -
copy
- Specified by:
copyin interfacePalette<T>- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/world/chunk/Palette;copy(Lnet/minecraft/world/chunk/PaletteResizeListener;)Lnet/minecraft/world/chunk/Palette;intermediary method_39956Lnet/minecraft/class_2837;method_39956(Lnet/minecraft/class_2835;)Lnet/minecraft/class_2837;official aLeed;a(Leee;)Leed;
-