Interface RegisterFunction<T>
- Type Parameters:
T- the type being registered (e.g.Item,Block)
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface used by Electroblob's Wizardry Redux registration helpers to perform actual registrations
into the different loaders' registries (Forge, Fabric).
We use this inside our registration helpers to abstract away the differences between platforms while still allowing for type safety and compile-time checks. After all the registration process is finished, each loader handle the registration of the deferred objects by calling the provided implementation of this interface.
-
Method Summary
-
Method Details
-
register
void register(net.minecraft.core.Registry<T> registry, net.minecraft.resources.ResourceLocation id, T obj) Register a single object into the suppliedRegistryunder the givenResourceLocation.Implementations should bridge to the platform-specific registration call (Forge/Fabric or other) and ensure the provided object is registered under the supplied id.
- Parameters:
registry- theRegistryto register into, may benullwhen the registry instance is not required by the callerid- theResourceLocationto register the object underobj- the object instance to register
-