Package foundry.veil.platform.registry
Interface RegistryObject<T>
- Type Parameters:
T- the operand of the object
- All Superinterfaces:
Supplier<T>
Represents a lazy wrapper for registry object.
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.Holder<T> asHolder()Gets this object wrapped in a vanillaHolder.get()Gets the object behind this wrapper.default net.minecraft.resources.ResourceLocationgetId()Gets the id of the object.net.minecraft.resources.ResourceKey<T> Gets theResourceKeyof the registry of the object wrapped.boolean
-
Method Details
-
getResourceKey
net.minecraft.resources.ResourceKey<T> getResourceKey()Gets theResourceKeyof the registry of the object wrapped.- Returns:
- the
ResourceKeyof the registry
-
getId
default net.minecraft.resources.ResourceLocation getId()Gets the id of the object.- Returns:
- the id of the object
-
isPresent
boolean isPresent()- Returns:
- If the initializer has been registered and assigned
-
get
T get()Gets the object behind this wrapper.- Specified by:
getin interfaceSupplier<T>- Returns:
- the object behind this wrapper
- Throws:
NullPointerException- IfisPresent()returnsfalse
-
asHolder
net.minecraft.core.Holder<T> asHolder()Gets this object wrapped in a vanillaHolder.- Returns:
- the holder
-