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>
A palette backed by a bidirectional hash table.
Mappings:
Namespace Name
named net/minecraft/world/chunk/BiMapPalette
intermediary net/minecraft/class_2814
official dui
  • Field Details

    • idList

      private final IndexedIterable<T> idList
      Mappings:
      Namespace Name Mixin selector
      named idList Lnet/minecraft/world/chunk/BiMapPalette;idList:Lnet/minecraft/util/collection/IndexedIterable;
      intermediary field_12821 Lnet/minecraft/class_2814;field_12821:Lnet/minecraft/class_2359;
      official a Ldui;a:Ljn;
    • map

      private final Int2ObjectBiMap<T> map
      Mappings:
      Namespace Name Mixin selector
      named map Lnet/minecraft/world/chunk/BiMapPalette;map:Lnet/minecraft/util/collection/Int2ObjectBiMap;
      intermediary field_12824 Lnet/minecraft/class_2814;field_12824:Lnet/minecraft/class_3513;
      official b Ldui;b:Laxv;
    • listener

      private final PaletteResizeListener<T> listener
      Mappings:
      Namespace Name Mixin selector
      named listener Lnet/minecraft/world/chunk/BiMapPalette;listener:Lnet/minecraft/world/chunk/PaletteResizeListener;
      intermediary field_12825 Lnet/minecraft/class_2814;field_12825:Lnet/minecraft/class_2835;
      official c Ldui;c:Ldur;
    • indexBits

      private final int indexBits
      Mappings:
      Namespace Name Mixin selector
      named indexBits Lnet/minecraft/world/chunk/BiMapPalette;indexBits:I
      intermediary field_12822 Lnet/minecraft/class_2814;field_12822:I
      official d Ldui;d:I
  • Constructor Details

    • BiMapPalette

      public BiMapPalette(IndexedIterable<T> idList, int bits, PaletteResizeListener<T> listener, List<T> entries)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/world/chunk/BiMapPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;ILnet/minecraft/world/chunk/PaletteResizeListener;Ljava/util/List;)V
      intermediary <init> Lnet/minecraft/class_2814;<init>(Lnet/minecraft/class_2359;ILnet/minecraft/class_2835;Ljava/util/List;)V
      official <init> Ldui;<init>(Ljn;ILdur;Ljava/util/List;)V
    • BiMapPalette

      public BiMapPalette(IndexedIterable<T> idList, int indexBits, PaletteResizeListener<T> listener)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/world/chunk/BiMapPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;ILnet/minecraft/world/chunk/PaletteResizeListener;)V
      intermediary <init> Lnet/minecraft/class_2814;<init>(Lnet/minecraft/class_2359;ILnet/minecraft/class_2835;)V
      official <init> Ldui;<init>(Ljn;ILdur;)V
    • BiMapPalette

      private BiMapPalette(IndexedIterable<T> idList, int indexBits, PaletteResizeListener<T> listener, Int2ObjectBiMap<T> map)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/world/chunk/BiMapPalette;<init>(Lnet/minecraft/util/collection/IndexedIterable;ILnet/minecraft/world/chunk/PaletteResizeListener;Lnet/minecraft/util/collection/Int2ObjectBiMap;)V
      intermediary <init> Lnet/minecraft/class_2814;<init>(Lnet/minecraft/class_2359;ILnet/minecraft/class_2835;Lnet/minecraft/class_3513;)V
      official <init> Ldui;<init>(Ljn;ILdur;Laxv;)V
  • 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
      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;
      intermediary method_38287 Lnet/minecraft/class_2814;method_38287(ILnet/minecraft/class_2359;Lnet/minecraft/class_2835;Ljava/util/List;)Lnet/minecraft/class_2837;
      official a Ldui;a(ILjn;Ldur;Ljava/util/List;)Lduq;
    • index

      public int index(T object)
      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 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 Lduq;a(Ljava/lang/Object;)I
    • hasAny

      public boolean hasAny(Predicate<T> predicate)
      Returns true if any entry in this palette passes the predicate.
      Specified by:
      hasAny in interface Palette<T>
      Returns:
      true if 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 Lduq;a(Ljava/util/function/Predicate;)Z
    • get

      public T get(int id)
      Returns the object associated with the given id.
      Specified by:
      get in 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 Lduq;a(I)Ljava/lang/Object;
    • readPacket

      public void readPacket(PacketByteBuf buf)
      Initializes this palette from the buf. Clears the preexisting data in this palette.
      Specified by:
      readPacket in 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 Lduq;a(Lwm;)V
    • writePacket

      public void writePacket(PacketByteBuf buf)
      Writes this palette to the buf.
      Specified by:
      writePacket in 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 Lduq;b(Lwm;)V
    • getPacketSize

      public int getPacketSize()
      Returns the serialized size of this palette in a byte buf, in bytes.
      Specified by:
      getPacketSize in 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 Lduq;a()I
    • getElements

      public List<T> getElements()
      Mappings:
      Namespace Name Mixin selector
      named getElements Lnet/minecraft/world/chunk/BiMapPalette;getElements()Ljava/util/List;
      intermediary method_38288 Lnet/minecraft/class_2814;method_38288()Ljava/util/List;
      official d Ldui;d()Ljava/util/List;
    • getSize

      public int getSize()
      Returns the size of the palette.
      Specified by:
      getSize in interface Palette<T>
      Returns:
      the size of the palette
      Mappings:
      Namespace Name Mixin selector
      named getSize Lnet/minecraft/world/chunk/Palette;getSize()I
      intermediary method_12197 Lnet/minecraft/class_2837;method_12197()I
      official b Lduq;b()I
    • copy

      public Palette<T> copy()
      Specified by:
      copy in interface Palette<T>
      Mappings:
      Namespace Name Mixin selector
      named copy Lnet/minecraft/world/chunk/Palette;copy()Lnet/minecraft/world/chunk/Palette;
      intermediary method_39956 Lnet/minecraft/class_2837;method_39956()Lnet/minecraft/class_2837;
      official c Lduq;c()Lduq;