Package org.moddingx.libx.registration
Class RegistrationContext
java.lang.Object
org.moddingx.libx.registration.RegistrationContext
- Direct Known Subclasses:
SetupContext
Provides some data that is present during registration like the id and registry key of the object
being registered.
-
Constructor Summary
ConstructorDescriptionRegistrationContext
(ModXRegistration mod, net.minecraft.resources.ResourceLocation id, net.minecraft.resources.ResourceKey<?> key) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocation
id()
Gets the id of the object being registered.Optional<net.minecraft.resources.ResourceKey<?>>
key()
Gets theResourceKey
of the object being registered.mod()
Gets the mod to which object belongs.Optional<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>>
registry()
Gets the registry key of the registry the object is registered in.
-
Constructor Details
-
RegistrationContext
public RegistrationContext(ModXRegistration mod, net.minecraft.resources.ResourceLocation id, @Nullable net.minecraft.resources.ResourceKey<?> key)
-
-
Method Details
-
mod
Gets the mod to which object belongs. -
id
public net.minecraft.resources.ResourceLocation id()Gets the id of the object being registered. -
key
Gets theResourceKey
of the object being registered. If the object is registered without a registry key, theOptional
will be empty. -
registry
public Optional<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>> registry()Gets the registry key of the registry the object is registered in. If the object is registered without a registry key, theOptional
will be empty.
-