Record Class HolderSetWrapper<T>

java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.plugin.builtin.wrapper.HolderSetWrapper<T>
All Implemented Interfaces:
Iterable<T>

public record HolderSetWrapper<T>(net.minecraft.core.Registry<T> registry, net.minecraft.core.HolderSet<T> holders) extends Record implements Iterable<T>
  • Constructor Summary

    Constructors
    Constructor
    Description
    HolderSetWrapper(net.minecraft.core.Registry<T> registry, net.minecraft.core.HolderSet<T> holders)
    Creates an instance of a HolderSetWrapper record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(net.minecraft.resources.ResourceLocation id)
     
    boolean
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    Set<net.minecraft.resources.ResourceLocation>
     
     
    getRandom(net.minecraft.util.RandomSource random)
     
     
    final int
    Returns a hash code value for this object.
    net.minecraft.core.HolderSet<T>
    Returns the value of the holders record component.
    boolean
     
    @NotNull Iterator<T>
     
    net.minecraft.core.Registry<T>
    Returns the value of the registry record component.
    int
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • HolderSetWrapper

      public HolderSetWrapper(net.minecraft.core.Registry<T> registry, net.minecraft.core.HolderSet<T> holders)
      Creates an instance of a HolderSetWrapper record class.
      Parameters:
      registry - the value for the registry record component
      holders - the value for the holders record component
  • Method Details

    • size

      public int size()
    • isEmpty

      public boolean isEmpty()
    • contains

      public boolean contains(net.minecraft.resources.ResourceLocation id)
    • containsValue

      public boolean containsValue(T value)
    • getValues

      public List<T> getValues()
    • getKeys

      public Set<net.minecraft.resources.ResourceLocation> getKeys()
    • getRandom

      @Nullable public T getRandom()
    • getRandom

      @Nullable public T getRandom(net.minecraft.util.RandomSource random)
    • iterator

      @NotNull public @NotNull Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • registry

      public net.minecraft.core.Registry<T> registry()
      Returns the value of the registry record component.
      Returns:
      the value of the registry record component
    • holders

      public net.minecraft.core.HolderSet<T> holders()
      Returns the value of the holders record component.
      Returns:
      the value of the holders record component