T - The base registry type, must be a concrete base class, do not use subclasses or wild cards.public class DeferredRegister<T extends IForgeRegistryEntry<T>>
extends java.lang.Object
private static final DeferredRegister- ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, MODID); private static final DeferredRegister
BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, MODID); public static final RegistryObject ROCK_BLOCK = BLOCKS.register("rock", () -> new Block(Block.Properties.create(Material.ROCK))); public static final RegistryObject - ROCK_ITEM = ITEMS.register("rock", () -> new BlockItem(ROCK_BLOCK.get(), new Item.Properties().group(ItemGroup.MISC))); public ExampleMod() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); }
| コンストラクタと説明 | 
|---|
| DeferredRegister(IForgeRegistry<T> reg,
                java.lang.String modid) | 
| 修飾子とタイプ | メソッドと説明 | 
|---|---|
| java.util.Collection<RegistryObject<T>> | getEntries() | 
| void | register(IEventBus bus)Adds our event handler to the specified event bus, this MUST be called in order for this class to function. | 
| <I extends T> | register(java.lang.String name,
        java.util.function.Supplier<? extends I> sup)Adds a new supplier to the list of entries to be registered, and returns a RegistryObject that will be populated with the created entry automatically. | 
public DeferredRegister(IForgeRegistry<T> reg, java.lang.String modid)
public <I extends T> RegistryObject<I> register(java.lang.String name, java.util.function.Supplier<? extends I> sup)
name - The new entry's name, it will automatically have the modid prefixed.sup - A factory for the new entry, it should return a new instance every time it is called.public void register(IEventBus bus)
bus - The Mod Specific event bus.public java.util.Collection<RegistryObject<T>> getEntries()