Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2015
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. state json:
  2.  
  3. {
  4. "variants": {
  5. "color=white": <some model here>,
  6. "color=orange": <some other model here>,
  7. ...
  8. "color=black": <16th model here>
  9. }
  10. }
  11.  
  12.  
  13. Currently we have to manually make 16 different item jsons that inherit from 16 separate block jsons.
  14.  
  15. But we can do better by putting every variant inside the blockstate json, and using setCustomMRL right?
  16.  
  17.  
  18. state json
  19. {
  20. "forge_marker": 1
  21. "variants": {
  22. "color": {
  23. "white": { "model": "someModel", "textures": ... },
  24. ...
  25. "black": { "model": "lastModel", "textures": ... }
  26. },
  27. "inventory_white":
  28. "inventory_orange":
  29. "inventory_magenta":
  30. "inventory_black":
  31. }
  32. }
  33.  
  34. code:
  35. ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation("mymod:myitem", "inventory_white"))
  36. ModelLoader.setCustomModelResourceLocation(item, 1, new ModelResourceLocation("mymod:myitem", "inventory_orange"))
  37. ModelLoader.setCustomModelResourceLocation(item, 2, new ModelResourceLocation("mymod:myitem", "inventory_magenta"))
  38. ...
  39. ModelLoader.setCustomModelResourceLocation(item, 15, new ModelResourceLocation("mymod:myitem", "inventory_black"))
  40.  
  41. Except inside those inventory_<X> blocks, we can't inherit the model from the variants above (or I'm doing it wrong)...so we just end up giving another definition for the exact same model. So in reality we did no better than just copying all those 16 item jsons into this file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement