Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | None | 0 0
  1. Renderer class:
  2.  
  3. package com.Nitrodev.WarehouseStorage.client.render.items;
  4.  
  5. import com.Nitrodev.WarehouseStorage.WarehouseStorage;
  6. import com.Nitrodev.WarehouseStorage.items.ModItems;
  7. import net.minecraft.client.Minecraft;
  8. import net.minecraft.client.resources.model.ModelResourceLocation;
  9. import net.minecraft.item.Item;
  10.  
  11. /**
  12.  * Created by Jukka on 22.12.2015.
  13.  */
  14. public class ItemRenderRegister {
  15.  
  16.     public static String modid = WarehouseStorage.MODID;
  17.  
  18.     public static void registerItemRenderer() {
  19.         reg(ModItems.itemPlank);
  20.     }
  21.  
  22.     public static void reg(Item item) {
  23.         Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
  24.                 .register(ModItems.itemPlank, 0, new ModelResourceLocation(modid + ":" + item.getUnlocalizedName().substring(5)));
  25.     }
  26. }
  27.  
  28. Model .json file:
  29.  
  30. {
  31.   "parent":"builtin/generated",
  32.   "textures": {
  33.       "layer0":"WarehouseStorage:items/item_plank.png"
  34.   },
  35.   "display": {
  36.       "thirdperson": {
  37.           "rotation": [ -90, 0, 0 ],
  38.           "translation": [0, 1, -3 ],
  39.           "scale": [ 0.55, 0.55, 0.55 ]
  40.       },
  41.       "firstperson": {
  42.           "rotation": [ 0, -135, 25 ],
  43.           "translation": [0, 4, 2 ],
  44.           "scale": [ 1.7, 1.7, 1.7 ]
  45.       }
  46.   }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement