package com.crazycrafter642.accelerometerrender.blocks; import com.crazycrafter642.accelerometerrender.Main; import com.crazycrafter642.accelerometerrender.init.ModBlocks; import com.crazycrafter642.accelerometerrender.init.ModItems; import com.crazycrafter642.accelerometerrender.util.IHasModel; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; public class BlockBase extends Block implements IHasModel { public BlockBase(String name, Material materialIn) { // Call the block constructor super(materialIn); // Set some inventory settings setUnlocalizedName(name); setRegistryName(name); // Register the block and item ModBlocks.BLOCKS.add(this); ModItems.ITEMS.add(new ItemBlock(this).setRegistryName( this.getRegistryName())); } @Override public void registerModels() { // Register the blocks item in the inventory Main.proxy.registerItemRenderer( Item.getItemFromBlock(this), 0, "inventory"); } }