Advertisement
CaptainSpaceCat

DivinityBlocks.java

May 7th, 2015
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. //goes in mod.divinity.init
  2.  
  3. package mod.divinity.init;
  4.  
  5. import mod.divinity.Reference;
  6. import mod.divinity.blocks.DivBlocks;
  7. import net.minecraft.block.Block;
  8. import net.minecraft.block.material.Material;
  9. import net.minecraft.client.Minecraft;
  10. import net.minecraft.client.resources.model.ModelResourceLocation;
  11. import net.minecraft.item.Item;
  12. import net.minecraftforge.fml.common.registry.GameRegistry;
  13.  
  14. public class DivinityBlocks {
  15.    
  16.     public static Block tenebrium_ore;
  17.    
  18.     public static void init() {
  19.         tenebrium_ore = new DivBlocks(Material.rock).setUnlocalizedName("tenebrium_ore");
  20.     }
  21.    
  22.     public static void register() {
  23.         GameRegistry.registerBlock(tenebrium_ore, tenebrium_ore.getUnlocalizedName().substring(5));
  24.     }
  25.    
  26.     public static void registerRenders() {
  27.         registerRender(tenebrium_ore);
  28.     }
  29.    
  30.     public static void registerRender(Block block) {
  31.         Item item = Item.getItemFromBlock(tenebrium_ore);
  32.         Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement