Last active
July 9, 2017 20:44
-
-
Save JamiesWhiteShirt/f73557c0467b5ed2f6781b8c8ccaea23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void registerModels() { | |
// ... | |
registerBlockModel(LWBlocks.SEALED_BARREL, "sealed_barrel"); | |
// ... | |
} | |
private static void registerBlockModel(Block block, String name) { | |
registerItemModel(Item.getItemFromBlock(block), name); | |
} | |
private static void registerItemModel(Item item, String name) { | |
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(new ResourceLocation(LeatherWorks.MODID, name), "inventory")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
public static final Block SEALED_BARREL = simply(new BlockEmpty(), "sealed_barrel").setCreativeTab(LeatherWorks.LeatherTab); | |
private static Block simply(Block block, String name) { | |
return block.setRegistryName(LeatherWorks.MODID, name).setUnlocalizedName(LeatherWorks.MODID + "." + name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment