java.lang.Object
org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet

public final class HolderSet extends Object
Represents a set of holders that could either be explicit, or resolved from a tag location. The client has to know how to resolve the tag location to get the holders.

Note that in NBT format, holder sets can also hold inline-defined holders, or even a combination of inline-defined and registry referenced holders. As of Java Edition 26.3, the stream codec still only supports registry referenced holders and tags.

  • Constructor Summary

    Constructors
    Constructor
    Description
    HolderSet(it.unimi.dsi.fastutil.ints.IntList holders)
     
    HolderSet(net.kyori.adventure.key.Key location)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(@Nullable Object o)
     
    it.unimi.dsi.fastutil.ints.IntList
     
    net.kyori.adventure.key.Key
     
    int
     
    it.unimi.dsi.fastutil.ints.IntList
    resolve(Function<net.kyori.adventure.key.Key,it.unimi.dsi.fastutil.ints.IntList> tagResolver)
    Return either the explicit holders, or resolve the tag location to get the holders.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • HolderSet

      public HolderSet(it.unimi.dsi.fastutil.ints.IntList holders)
    • HolderSet

      public HolderSet(net.kyori.adventure.key.Key location)
  • Method Details

    • resolve

      public it.unimi.dsi.fastutil.ints.IntList resolve(Function<net.kyori.adventure.key.Key,it.unimi.dsi.fastutil.ints.IntList> tagResolver)
      Return either the explicit holders, or resolve the tag location to get the holders.
      Parameters:
      tagResolver - The function to resolve the tag location to get the holders.
      Returns:
      The holders.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLocation

      public net.kyori.adventure.key.Key getLocation()
    • getHolders

      public it.unimi.dsi.fastutil.ints.IntList getHolders()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object