Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main class:
- OliveLeaves = new BasicBlock(Material.WOOD, MapColor.WOOD, "OliveLeaves");
- public class BasicBlock extends Block {
- public BasicBlock(Material blockMaterialIn, MapColor blockMapColorIn, String blockName) {
- super(blockMaterialIn, blockMapColorIn);
- setCreativeTab(testmod.testtab);
- setRegistryName(blockName);
- setUnlocalizedName(blockName);
- GameRegistry.register(new ItemBlock(this).setRegistryName(this.getRegistryName()));
- }
- @SideOnly(Side.CLIENT)
- public void initModel() {
- ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
- }
- }
- json files:
- blockstates > OliveLeaves.json:
- {
- "variants": {
- "inventory": { "model": "testmod:OliveLeaves" }
- }
- }
- models > block > OliveLeaves.json
- {
- "parent": "block/cube_all",
- "textures": {
- "all": "jerrysmod:blocks/OliveLeaves"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement