Record Class DummyRegistry<T>

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.dummy.DummyRegistry<T>
All Implemented Interfaces:
com.mojang.serialization.Keyable, Iterable<T>, net.minecraft.core.HolderOwner<T>, net.minecraft.core.IdMap<T>, net.minecraft.core.Registry<T>, net.neoforged.neoforge.registries.IRegistryExtension<T>

public record DummyRegistry<T>(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, net.minecraft.resources.ResourceLocation defaultId, T defaultValue) extends Record implements net.minecraft.core.Registry<T>, net.minecraft.core.HolderOwner<T>
  • Field Summary

    Fields inherited from interface net.minecraft.core.IdMap

    DEFAULT
  • Constructor Summary

    Constructors
    Constructor
    Description
    DummyRegistry(net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey, net.minecraft.resources.ResourceLocation defaultId, T defaultValue)
    Creates an instance of a DummyRegistry record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addAlias(net.minecraft.resources.ResourceLocation resourceLocation, net.minecraft.resources.ResourceLocation resourceLocation1)
     
    void
    addCallback(net.neoforged.neoforge.registries.callback.RegistryCallback<T> registryCallback)
     
    net.minecraft.core.HolderLookup.RegistryLookup<T>
     
    void
    bindTags(Map<net.minecraft.tags.TagKey<T>,List<net.minecraft.core.Holder<T>>> p_205997_)
     
    byId(int p_122651_)
     
    boolean
    containsKey(net.minecraft.resources.ResourceKey<T> p_175475_)
     
    boolean
    containsKey(net.minecraft.resources.ResourceLocation p_123011_)
     
    boolean
     
    net.minecraft.core.Holder.Reference<T>
     
    net.minecraft.resources.ResourceLocation
    Returns the value of the defaultId record component.
    Returns the value of the defaultValue record component.
    boolean
     
    Set<Map.Entry<net.minecraft.resources.ResourceKey<T>,T>>
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    net.minecraft.core.Registry<T>
     
    get(@Nullable net.minecraft.resources.ResourceKey<T> p_122980_)
     
    get(@Nullable net.minecraft.resources.ResourceLocation p_123002_)
     
    Optional<net.minecraft.core.Holder.Reference<T>>
     
    <A> A
    getData(net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> dataMapType, net.minecraft.resources.ResourceKey<T> resourceKey)
     
    <A> Map<net.minecraft.resources.ResourceKey<T>,A>
    getDataMap(net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> dataMapType)
     
    Optional<net.minecraft.core.Holder.Reference<T>>
    getHolder(int p_206051_)
     
    Optional<net.minecraft.core.Holder.Reference<T>>
    getHolder(net.minecraft.resources.ResourceKey<T> p_206050_)
     
    Optional<net.minecraft.core.Holder.Reference<T>>
    getHolder(net.minecraft.resources.ResourceLocation resourceLocation)
     
    int
    getId(net.minecraft.resources.ResourceKey<T> resourceKey)
     
    int
    getId(net.minecraft.resources.ResourceLocation resourceLocation)
     
    int
    getId(T p_122977_)
     
    @Nullable net.minecraft.resources.ResourceLocation
    getKey(T p_123006_)
     
    int
     
    net.minecraft.core.HolderSet.Named<T>
    getOrCreateTag(net.minecraft.tags.TagKey<T> p_206045_)
     
    Optional<net.minecraft.core.Holder.Reference<T>>
    getRandom(net.minecraft.util.RandomSource p_235781_)
     
    Optional<net.minecraft.resources.ResourceKey<T>>
    getResourceKey(T p_123008_)
     
    Optional<net.minecraft.core.HolderSet.Named<T>>
    getTag(net.minecraft.tags.TagKey<T> p_206052_)
     
    Stream<net.minecraft.tags.TagKey<T>>
     
    Stream<com.mojang.datafixers.util.Pair<net.minecraft.tags.TagKey<T>,net.minecraft.core.HolderSet.Named<T>>>
     
    final int
    Returns a hash code value for this object.
    net.minecraft.core.HolderOwner<T>
     
    Stream<net.minecraft.core.Holder.Reference<T>>
     
    @NotNull Iterator<T>
     
    net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
    key()
     
    Set<net.minecraft.resources.ResourceLocation>
     
    Optional<net.minecraft.core.RegistrationInfo>
    registrationInfo(net.minecraft.resources.ResourceKey<T> resourceKey)
     
    net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>>
    Returns the value of the registryKey record component.
    Set<net.minecraft.resources.ResourceKey<T>>
     
    com.mojang.serialization.Lifecycle
     
    void
     
    net.minecraft.resources.ResourceKey<T>
    resolve(net.minecraft.resources.ResourceKey<T> resourceKey)
     
    net.minecraft.resources.ResourceLocation
    resolve(net.minecraft.resources.ResourceLocation resourceLocation)
     
    int
     
    final String
    Returns a string representation of this record class.
    net.minecraft.core.Holder<T>
    wrapAsHolder(T p_263382_)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.core.HolderOwner

    canSerializeIn

    Methods inherited from interface net.minecraft.core.IdMap

    byIdOrThrow, getIdOrThrow

    Methods inherited from interface net.neoforged.neoforge.registries.IRegistryExtension

    addCallback, getKeyOrNull

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface net.minecraft.core.Registry

    asHolderIdMap, asTagAddingLookup, byNameCodec, getHolderOrThrow, getOptional, getOptional, getOrThrow, getRandomElementOf, getTagOrEmpty, holderByNameCodec, keys, stream
  • Constructor Details

    • DummyRegistry

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

    • key

      public net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> key()
      Specified by:
      key in interface net.minecraft.core.Registry<T>
    • getKey

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getKey(T p_123006_)
      Specified by:
      getKey in interface net.minecraft.core.Registry<T>
    • getResourceKey

      public Optional<net.minecraft.resources.ResourceKey<T>> getResourceKey(T p_123008_)
      Specified by:
      getResourceKey in interface net.minecraft.core.Registry<T>
    • getId

      public int getId(@Nullable T p_122977_)
      Specified by:
      getId in interface net.minecraft.core.IdMap<T>
      Specified by:
      getId in interface net.minecraft.core.Registry<T>
    • byId

      @Nullable public T byId(int p_122651_)
      Specified by:
      byId in interface net.minecraft.core.IdMap<T>
    • size

      public int size()
      Specified by:
      size in interface net.minecraft.core.IdMap<T>
    • get

      @Nullable public T get(@Nullable @Nullable net.minecraft.resources.ResourceKey<T> p_122980_)
      Specified by:
      get in interface net.minecraft.core.Registry<T>
    • get

      @Nullable public T get(@Nullable @Nullable net.minecraft.resources.ResourceLocation p_123002_)
      Specified by:
      get in interface net.minecraft.core.Registry<T>
    • registrationInfo

      public Optional<net.minecraft.core.RegistrationInfo> registrationInfo(net.minecraft.resources.ResourceKey<T> resourceKey)
      Specified by:
      registrationInfo in interface net.minecraft.core.Registry<T>
    • registryLifecycle

      public com.mojang.serialization.Lifecycle registryLifecycle()
      Specified by:
      registryLifecycle in interface net.minecraft.core.Registry<T>
    • getAny

      public Optional<net.minecraft.core.Holder.Reference<T>> getAny()
      Specified by:
      getAny in interface net.minecraft.core.Registry<T>
    • keySet

      public Set<net.minecraft.resources.ResourceLocation> keySet()
      Specified by:
      keySet in interface net.minecraft.core.Registry<T>
    • entrySet

      public Set<Map.Entry<net.minecraft.resources.ResourceKey<T>,T>> entrySet()
      Specified by:
      entrySet in interface net.minecraft.core.Registry<T>
    • registryKeySet

      public Set<net.minecraft.resources.ResourceKey<T>> registryKeySet()
      Specified by:
      registryKeySet in interface net.minecraft.core.Registry<T>
    • getRandom

      public Optional<net.minecraft.core.Holder.Reference<T>> getRandom(net.minecraft.util.RandomSource p_235781_)
      Specified by:
      getRandom in interface net.minecraft.core.Registry<T>
    • containsKey

      public boolean containsKey(net.minecraft.resources.ResourceLocation p_123011_)
      Specified by:
      containsKey in interface net.minecraft.core.Registry<T>
    • containsKey

      public boolean containsKey(net.minecraft.resources.ResourceKey<T> p_175475_)
      Specified by:
      containsKey in interface net.minecraft.core.Registry<T>
    • freeze

      public net.minecraft.core.Registry<T> freeze()
      Specified by:
      freeze in interface net.minecraft.core.Registry<T>
    • createIntrusiveHolder

      public net.minecraft.core.Holder.Reference<T> createIntrusiveHolder(T p_206068_)
      Specified by:
      createIntrusiveHolder in interface net.minecraft.core.Registry<T>
    • getHolder

      public Optional<net.minecraft.core.Holder.Reference<T>> getHolder(int p_206051_)
      Specified by:
      getHolder in interface net.minecraft.core.Registry<T>
    • getHolder

      public Optional<net.minecraft.core.Holder.Reference<T>> getHolder(net.minecraft.resources.ResourceLocation resourceLocation)
      Specified by:
      getHolder in interface net.minecraft.core.Registry<T>
    • getHolder

      public Optional<net.minecraft.core.Holder.Reference<T>> getHolder(net.minecraft.resources.ResourceKey<T> p_206050_)
      Specified by:
      getHolder in interface net.minecraft.core.Registry<T>
    • wrapAsHolder

      public net.minecraft.core.Holder<T> wrapAsHolder(T p_263382_)
      Specified by:
      wrapAsHolder in interface net.minecraft.core.Registry<T>
    • holders

      public Stream<net.minecraft.core.Holder.Reference<T>> holders()
      Specified by:
      holders in interface net.minecraft.core.Registry<T>
    • getTag

      public Optional<net.minecraft.core.HolderSet.Named<T>> getTag(net.minecraft.tags.TagKey<T> p_206052_)
      Specified by:
      getTag in interface net.minecraft.core.Registry<T>
    • getOrCreateTag

      public net.minecraft.core.HolderSet.Named<T> getOrCreateTag(net.minecraft.tags.TagKey<T> p_206045_)
      Specified by:
      getOrCreateTag in interface net.minecraft.core.Registry<T>
    • getTags

      public Stream<com.mojang.datafixers.util.Pair<net.minecraft.tags.TagKey<T>,net.minecraft.core.HolderSet.Named<T>>> getTags()
      Specified by:
      getTags in interface net.minecraft.core.Registry<T>
    • getTagNames

      public Stream<net.minecraft.tags.TagKey<T>> getTagNames()
      Specified by:
      getTagNames in interface net.minecraft.core.Registry<T>
    • resetTags

      public void resetTags()
      Specified by:
      resetTags in interface net.minecraft.core.Registry<T>
    • bindTags

      public void bindTags(Map<net.minecraft.tags.TagKey<T>,List<net.minecraft.core.Holder<T>>> p_205997_)
      Specified by:
      bindTags in interface net.minecraft.core.Registry<T>
    • holderOwner

      public net.minecraft.core.HolderOwner<T> holderOwner()
      Specified by:
      holderOwner in interface net.minecraft.core.Registry<T>
    • asLookup

      public net.minecraft.core.HolderLookup.RegistryLookup<T> asLookup()
      Specified by:
      asLookup in interface net.minecraft.core.Registry<T>
    • iterator

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

      public boolean doesSync()
      Specified by:
      doesSync in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • getMaxId

      public int getMaxId()
      Specified by:
      getMaxId in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • addCallback

      public void addCallback(net.neoforged.neoforge.registries.callback.RegistryCallback<T> registryCallback)
      Specified by:
      addCallback in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • addAlias

      public void addAlias(net.minecraft.resources.ResourceLocation resourceLocation, net.minecraft.resources.ResourceLocation resourceLocation1)
      Specified by:
      addAlias in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • resolve

      public net.minecraft.resources.ResourceLocation resolve(net.minecraft.resources.ResourceLocation resourceLocation)
      Specified by:
      resolve in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • resolve

      public net.minecraft.resources.ResourceKey<T> resolve(net.minecraft.resources.ResourceKey<T> resourceKey)
      Specified by:
      resolve in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • getId

      public int getId(net.minecraft.resources.ResourceKey<T> resourceKey)
      Specified by:
      getId in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • getId

      public int getId(net.minecraft.resources.ResourceLocation resourceLocation)
      Specified by:
      getId in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • containsValue

      public boolean containsValue(T t)
      Specified by:
      containsValue in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • getData

      @Nullable public <A> A getData(net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> dataMapType, net.minecraft.resources.ResourceKey<T> resourceKey)
      Specified by:
      getData in interface net.neoforged.neoforge.registries.IRegistryExtension<T>
    • getDataMap

      public <A> Map<net.minecraft.resources.ResourceKey<T>,A> getDataMap(net.neoforged.neoforge.registries.datamaps.DataMapType<T,A> dataMapType)
      Specified by:
      getDataMap in interface net.neoforged.neoforge.registries.IRegistryExtension<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.
    • registryKey

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

      public net.minecraft.resources.ResourceLocation defaultId()
      Returns the value of the defaultId record component.
      Returns:
      the value of the defaultId record component
    • defaultValue

      public T defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component