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.net.minecraft.resources.ResourceLocation
getId()
Gets the id of the object.net.minecraft.resources.ResourceKey
<T> Gets theResourceKey
of the registry of the object wrapped.boolean
-
Method Details
-
getResourceKey
net.minecraft.resources.ResourceKey<T> getResourceKey()Gets theResourceKey
of the registry of the object wrapped.- Returns:
- the
ResourceKey
of the registry
-
getId
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:
get
in 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
-