Class RegistryDelegate<T>

java.lang.Object
net.minecraftforge.registries.RegistryDelegate<T>
All Implemented Interfaces:
Supplier<T>, IRegistryDelegate<T>

final class RegistryDelegate<T> extends Object implements IRegistryDelegate<T>
  • Field Details

  • Constructor Details

    • RegistryDelegate

      public RegistryDelegate(T referent, Class<T> type)
  • Method Details

    • get

      public T get()
      Description copied from interface: IRegistryDelegate
      Get the referent pointed at by this delegate. This will be the currently active item or block, and will change as world saves come and go. Note that item.delegate.get() may NOT be the same object as item, due to item and block substitution.
      Specified by:
      get in interface IRegistryDelegate<T>
      Specified by:
      get in interface Supplier<T>
      Returns:
      The referred object
    • name

      public ResourceLocation name()
      Description copied from interface: IRegistryDelegate
      Get the unique resource location for this delegate. Completely static after registration has completed, and will never change.
      Specified by:
      name in interface IRegistryDelegate<T>
      Returns:
      The name
    • type

      public Class<T> type()
      Description copied from interface: IRegistryDelegate
      Get the delegate type. It will be dependent on the registry this delegate is sourced from.
      Specified by:
      type in interface IRegistryDelegate<T>
      Returns:
      The type of delegate
    • changeReference

      void changeReference(T newTarget)
    • setName

      public void setName(ResourceLocation name)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object