Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. package init;
  2.  
  3. import com.Dr_Blockenstein.MoreFood.Reference;
  4.  
  5. import items.ItemRawbacon;
  6. import net.minecraft.client.Minecraft;
  7. import net.minecraft.client.renderer.block.model.ModelResourceLocation;
  8. import net.minecraft.item.Item;
  9. import net.minecraftforge.fml.common.registry.GameRegistry;
  10. import net.minecraftforge.registries.IForgeRegistryEntry;
  11.  
  12. public class ModItems {
  13.  
  14. // this is raw bacon
  15.  
  16. public static Item rawbacon;
  17.  
  18. public static void init() {
  19. rawbacon = new ItemRawbacon();
  20. }
  21. // the lines below this have the problem in .register
  22. public static void register() {
  23. GameRegistry.register(rawbacon);
  24. }
  25.  
  26. public static void registerRenders() {
  27. registerRender(rawbacon);
  28. }
  29.  
  30. private static void registerRender(Item item) {
  31. Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
  32. // this line is not in the code but the code above this with the Minecraft.getMinecraft is one line in eclipse.
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement