Advertisement
CaptainSpaceCat

DivinityItems.java

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