Interface IRegistryDelegate<T>

Type Parameters:
T - the type of thing we're holding onto
All Superinterfaces:
Supplier<T>
All Known Implementing Classes:
RegistryDelegate

public interface IRegistryDelegate<T> extends Supplier<T>
A registry delegate for holding references to items or blocks These should be safe to use in things like lists though aliased items and blocks will not have object identity with respect to their delegate.
Author:
cpw
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Get the referent pointed at by this delegate.
    Get the unique resource location for this delegate.
    Get the delegate type.
  • Method Details

    • get

      T get()
      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 Supplier<T>
      Returns:
      The referred object
    • name

      Get the unique resource location for this delegate. Completely static after registration has completed, and will never change.
      Returns:
      The name
    • type

      Class<T> type()
      Get the delegate type. It will be dependent on the registry this delegate is sourced from.
      Returns:
      The type of delegate