Advertisement
Guest User

Untitled

a guest
Aug 1st, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. main class:
  2.  
  3. OliveLeaves = new BasicBlock(Material.WOOD, MapColor.WOOD, "OliveLeaves");
  4.  
  5.  
  6. public class BasicBlock extends Block {
  7.  
  8. public BasicBlock(Material blockMaterialIn, MapColor blockMapColorIn, String blockName) {
  9. super(blockMaterialIn, blockMapColorIn);
  10. setCreativeTab(testmod.testtab);
  11. setRegistryName(blockName);
  12. setUnlocalizedName(blockName);
  13. GameRegistry.register(new ItemBlock(this).setRegistryName(this.getRegistryName()));
  14. }
  15.  
  16. @SideOnly(Side.CLIENT)
  17. public void initModel() {
  18. ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
  19. }
  20. }
  21.  
  22.  
  23. json files:
  24.  
  25. blockstates > OliveLeaves.json:
  26.  
  27. {
  28. "variants": {
  29. "inventory": { "model": "testmod:OliveLeaves" }
  30. }
  31. }
  32.  
  33. models > block > OliveLeaves.json
  34.  
  35. {
  36. "parent": "block/cube_all",
  37. "textures": {
  38. "all": "jerrysmod:blocks/OliveLeaves"
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement