Record Class DummyHolder<T>

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.dummy.DummyHolder<T>
All Implemented Interfaces:
Supplier<T>, net.minecraft.core.Holder<T>, net.minecraftforge.registries.tags.IReverseTag<T>

public record DummyHolder<T>(T value, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key) extends Record implements net.minecraft.core.Holder<T>
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.core.Holder

    net.minecraft.core.Holder.Direct<T extends Object>, net.minecraft.core.Holder.Kind, net.minecraft.core.Holder.Reference<T extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    DummyHolder(T value, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key)
    Creates an instance of a DummyHolder record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canSerializeIn(net.minecraft.core.HolderOwner<T> p_255833_)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    is(Predicate<net.minecraft.resources.ResourceKey<T>> p_205711_)
     
    boolean
    is(net.minecraft.resources.ResourceKey<T> p_205712_)
     
    boolean
    is(net.minecraft.resources.ResourceLocation p_205713_)
     
    boolean
    is(net.minecraft.tags.TagKey<T> p_205705_)
     
    boolean
     
    net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
    key()
    Returns the value of the key record component.
    net.minecraft.core.Holder.Kind
     
    Stream<net.minecraft.tags.TagKey<T>>
     
    final String
    Returns a string representation of this record class.
    com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<T>,T>
     
    Optional<net.minecraft.resources.ResourceKey<T>>
     
    Returns the value of the value record component.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.core.Holder

    containsTag, get, getTagKeys

    Methods inherited from interface net.minecraftforge.registries.tags.IReverseTag

    containsTag
  • Constructor Details

    • DummyHolder

      public DummyHolder(T value, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key)
      Creates an instance of a DummyHolder record class.
      Parameters:
      value - the value for the value record component
      key - the value for the key record component
  • Method Details

    • isBound

      public boolean isBound()
      Specified by:
      isBound in interface net.minecraft.core.Holder<T>
    • is

      public boolean is(net.minecraft.resources.ResourceLocation p_205713_)
      Specified by:
      is in interface net.minecraft.core.Holder<T>
    • is

      public boolean is(net.minecraft.resources.ResourceKey<T> p_205712_)
      Specified by:
      is in interface net.minecraft.core.Holder<T>
    • is

      public boolean is(Predicate<net.minecraft.resources.ResourceKey<T>> p_205711_)
      Specified by:
      is in interface net.minecraft.core.Holder<T>
    • is

      public boolean is(net.minecraft.tags.TagKey<T> p_205705_)
      Specified by:
      is in interface net.minecraft.core.Holder<T>
    • tags

      public Stream<net.minecraft.tags.TagKey<T>> tags()
      Specified by:
      tags in interface net.minecraft.core.Holder<T>
    • unwrap

      public com.mojang.datafixers.util.Either<net.minecraft.resources.ResourceKey<T>,T> unwrap()
      Specified by:
      unwrap in interface net.minecraft.core.Holder<T>
    • unwrapKey

      public Optional<net.minecraft.resources.ResourceKey<T>> unwrapKey()
      Specified by:
      unwrapKey in interface net.minecraft.core.Holder<T>
    • kind

      public net.minecraft.core.Holder.Kind kind()
      Specified by:
      kind in interface net.minecraft.core.Holder<T>
    • canSerializeIn

      public boolean canSerializeIn(net.minecraft.core.HolderOwner<T> p_255833_)
      Specified by:
      canSerializeIn in interface net.minecraft.core.Holder<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.
    • value

      public T value()
      Returns the value of the value record component.
      Specified by:
      value in interface net.minecraft.core.Holder<T>
      Returns:
      the value of the value record component
    • key

      public net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component