|
|
|
@ -1,7 +1,10 @@
|
|
|
|
|
package com.technovision.tutorial.util;
|
|
|
|
|
|
|
|
|
|
import com.technovision.tutorial.Tutorial;
|
|
|
|
|
import com.technovision.tutorial.blocks.BlockItemBase;
|
|
|
|
|
import com.technovision.tutorial.blocks.RubyBlock;
|
|
|
|
|
import com.technovision.tutorial.items.ItemBase;
|
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
|
import net.minecraft.item.Item;
|
|
|
|
|
import net.minecraftforge.fml.RegistryObject;
|
|
|
|
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
|
|
|
@ -11,12 +14,20 @@ import net.minecraftforge.registries.ForgeRegistries;
|
|
|
|
|
public class RegistryHandler {
|
|
|
|
|
|
|
|
|
|
public static final DeferredRegister<Item> ITEMS = new DeferredRegister<>(ForgeRegistries.ITEMS, Tutorial.MOD_ID);
|
|
|
|
|
public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, Tutorial.MOD_ID);
|
|
|
|
|
|
|
|
|
|
public static void init() {
|
|
|
|
|
ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
|
|
|
|
|
BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Items
|
|
|
|
|
public static final RegistryObject<Item> RUBY = ITEMS.register("ruby", ItemBase::new);
|
|
|
|
|
|
|
|
|
|
// Blocks
|
|
|
|
|
public static final RegistryObject<Block> RUBY_BLOCK = BLOCKS.register("ruby_block", RubyBlock::new);
|
|
|
|
|
|
|
|
|
|
// Block Items
|
|
|
|
|
public static final RegistryObject<Item> RUBY_BLOCK_ITEM = ITEMS.register("ruby_block", () -> new BlockItemBase(RUBY_BLOCK.get()));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|