Package net.minecraftforge.registries
Interface IRegistryDelegate<T>
-
- Type Parameters:
T
- the type of thing we're holding onto
- All Superinterfaces:
java.util.function.Supplier<T>
- All Known Implementing Classes:
RegistryDelegate
public interface IRegistryDelegate<T> extends java.util.function.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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
get()
Get the referent pointed at by this delegate.ResourceLocation
name()
Get the unique resource location for this delegate.java.lang.Class<T>
type()
Get the delegate type.
-
-
-
Method Detail
-
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 interfacejava.util.function.Supplier<T>
- Returns:
- The referred object
-
name
ResourceLocation name()
Get the unique resource location for this delegate. Completely static after registration has completed, and will never change.- Returns:
- The name
-
type
java.lang.Class<T> type()
Get the delegate type. It will be dependent on the registry this delegate is sourced from.- Returns:
- The type of delegate
-
-