Class ForgeItemRegistrar
java.lang.Object
net.xun.lib.forge.internal.registries.ForgeItemRegistrar
- All Implemented Interfaces:
ItemRegistrar
Internal Forge implementation of item registration using deferred registers.
Not part of the public API - use through
RegistrationServices infrastructure.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends net.minecraft.world.item.Item>
Supplier<T> registerItem(String name, Supplier<T> supplier) Registers an item with the mod registry.static voidsetRegistry(net.minecraftforge.eventbus.api.IEventBus modEventBus) Internal initialization method for binding registry to event bus
-
Constructor Details
-
ForgeItemRegistrar
public ForgeItemRegistrar()
-
-
Method Details
-
registerItem
public <T extends net.minecraft.world.item.Item> Supplier<T> registerItem(String name, Supplier<T> supplier) Registers an item with the mod registry.Registers with Forge's deferred registry system
- Specified by:
registerItemin interfaceItemRegistrar- Type Parameters:
T- Type of item being registered- Parameters:
name- Unique registry name for the item (id)supplier- Factory for creating the instance- Returns:
- Registered item supplier that can resolve the instance
-
setRegistry
public static void setRegistry(net.minecraftforge.eventbus.api.IEventBus modEventBus) Internal initialization method for binding registry to event bus- Parameters:
modEventBus- The mod's primary event bus
-