Package net.minecraft.world.chunk
Class SingularPalette<T>
java.lang.Object
net.minecraft.world.chunk.SingularPalette<T>
- All Implemented Interfaces:
- Palette<T>
A palette that only holds a unique entry. Useful for void chunks or a
 single biome.
- Mappings:
- Namespace - Name - named - net/minecraft/world/chunk/SingularPalette- intermediary - net/minecraft/class_6564- official - dzo
- 
Nested Class SummaryNested classes/interfaces inherited from interface net.minecraft.world.chunk.PalettePalette.Factory
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate Tprivate final IndexedIterable<T> private final PaletteResizeListener<T> 
- 
Constructor SummaryConstructorsConstructorDescriptionSingularPalette(IndexedIterable<T> idList, PaletteResizeListener<T> listener, List<T> entries) 
- 
Method SummaryModifier and TypeMethodDescriptioncopy(PaletteResizeListener<T> resizeListener) static <A> Palette<A> create(int bitSize, IndexedIterable<A> idList, PaletteResizeListener<A> listener, List<A> entries) Creates a singular palette.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 - idList- Lnet/minecraft/world/chunk/SingularPalette;idList:Lnet/minecraft/util/collection/IndexedIterable;- intermediary - field_34573- Lnet/minecraft/class_6564;field_34573:Lnet/minecraft/class_2359;- official - a- Ldzo;a:Ljw;
 
- 
entry- Mappings:
- Namespace - Name - Mixin selector - named - entry- Lnet/minecraft/world/chunk/SingularPalette;entry:Ljava/lang/Object;- intermediary - field_34574- Lnet/minecraft/class_6564;field_34574:Ljava/lang/Object;- official - b- Ldzo;b:Ljava/lang/Object;
 
- 
listener- Mappings:
- Namespace - Name - Mixin selector - named - listener- Lnet/minecraft/world/chunk/SingularPalette;listener:Lnet/minecraft/world/chunk/PaletteResizeListener;- intermediary - field_34575- Lnet/minecraft/class_6564;field_34575:Lnet/minecraft/class_2835;- official - c- Ldzo;c:Ldzk;
 
 
- 
- 
Constructor Details- 
SingularPalettepublic SingularPalette(IndexedIterable<T> idList, PaletteResizeListener<T> listener, List<T> entries) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/world/chunk/SingularPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)V- intermediary - <init>- Lnet/minecraft/class_6564;<init>(Lnet/minecraft/class_2359;Lnet/minecraft/class_2835;Ljava/util/List;)V- official - <init>- Ldzo;<init>(Ljw;Ldzk;Ljava/util/List;)V
 
 
- 
- 
Method Details- 
createpublic static <A> Palette<A> create(int bitSize, IndexedIterable<A> idList, PaletteResizeListener<A> listener, List<A> entries) Creates a singular palette. Used as method reference to create factory.- Parameters:
- bitSize-- 0, as this palette has only 20=1 entry
- Mappings:
- Namespace - Name - Mixin selector - named - create- Lnet/minecraft/world/chunk/SingularPalette;create(ILnet/minecraft/util/collection/IndexedIterable;Lnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)Lnet/minecraft/world/chunk/Palette;- intermediary - method_38316- Lnet/minecraft/class_6564;method_38316(ILnet/minecraft/class_2359;Lnet/minecraft/class_2835;Ljava/util/List;)Lnet/minecraft/class_2837;- official - a- Ldzo;a(ILjw;Ldzk;Ljava/util/List;)Ldzj;
 
- 
indexReturns 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 interface- Palette<T>
- Parameters:
- object- the object to look up
- Returns:
- the ID of an object in this palette
- Mappings:
- Namespace - Name - Mixin selector - named - index- Lnet/minecraft/world/chunk/Palette;index(Ljava/lang/Object;)I- intermediary - method_12291- Lnet/minecraft/class_2837;method_12291(Ljava/lang/Object;)I- official - a- Ldzj;a(Ljava/lang/Object;)I
 
- 
hasAnyReturnstrueif any entry in this palette passes thepredicate.- Specified by:
- hasAnyin interface- Palette<T>
- Returns:
- trueif any entry in this palette passes the- predicate
- Mappings:
- Namespace - Name - Mixin selector - named - hasAny- Lnet/minecraft/world/chunk/Palette;hasAny(Ljava/util/function/Predicate;)Z- intermediary - method_19525- Lnet/minecraft/class_2837;method_19525(Ljava/util/function/Predicate;)Z- official - a- Ldzj;a(Ljava/util/function/Predicate;)Z
 
- 
getReturns the object associated with the givenid.- Specified by:
- getin interface- Palette<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 - get- Lnet/minecraft/world/chunk/Palette;get(I)Ljava/lang/Object;- intermediary - method_12288- Lnet/minecraft/class_2837;method_12288(I)Ljava/lang/Object;- official - a- Ldzj;a(I)Ljava/lang/Object;
 
- 
readPacketInitializes this palette from thebuf. Clears the preexisting data in this palette.- Specified by:
- readPacketin interface- Palette<T>
- Parameters:
- buf- the packet byte buffer
- Mappings:
- Namespace - Name - Mixin selector - named - readPacket- Lnet/minecraft/world/chunk/Palette;readPacket(Lnet/minecraft/network/PacketByteBuf;)V- intermediary - method_12289- Lnet/minecraft/class_2837;method_12289(Lnet/minecraft/class_2540;)V- official - a- Ldzj;a(Lvl;)V
 
- 
writePacketWrites this palette to thebuf.- Specified by:
- writePacketin interface- Palette<T>
- Parameters:
- buf- the packet byte buffer
- Mappings:
- Namespace - Name - Mixin selector - named - writePacket- Lnet/minecraft/world/chunk/Palette;writePacket(Lnet/minecraft/network/PacketByteBuf;)V- intermediary - method_12287- Lnet/minecraft/class_2837;method_12287(Lnet/minecraft/class_2540;)V- official - b- Ldzj;b(Lvl;)V
 
- 
getPacketSizepublic int getPacketSize()Returns the serialized size of this palette in a byte buf, in bytes.- Specified by:
- getPacketSizein interface- Palette<T>
- Returns:
- the serialized size of this palette in a byte buf, in bytes
- Mappings:
- Namespace - Name - Mixin selector - named - getPacketSize- Lnet/minecraft/world/chunk/Palette;getPacketSize()I- intermediary - method_12290- Lnet/minecraft/class_2837;method_12290()I- official - a- Ldzj;a()I
 
- 
getSizepublic int getSize()Returns the size of the palette.
- 
copy- Specified by:
- copyin interface- Palette<T>
- Mappings:
- Namespace - Name - Mixin selector - named - copy- Lnet/minecraft/world/chunk/Palette;copy(Lnet/minecraft/world/chunk/PaletteResizeListener;)Lnet/minecraft/world/chunk/Palette;- intermediary - method_39956- Lnet/minecraft/class_2837;method_39956(Lnet/minecraft/class_2835;)Lnet/minecraft/class_2837;- official - a- Ldzj;a(Ldzk;)Ldzj;
 
 
-