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.
  • Constructor Details

    • HolderSet

      public HolderSet(int @NonNull [] holders)
    • HolderSet

      public HolderSet(@NonNull @NonNull String location)
  • Method Details

    • resolve

      public int[] resolve(Function<String,int[]> 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.
    • getLocation

      public @Nullable String getLocation()
    • getHolders

      public int @Nullable [] getHolders()
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object