Last active
July 9, 2017 18:41
-
-
Save JamiesWhiteShirt/dd16b680c65099c12df78f451a08c2c0 to your computer and use it in GitHub Desktop.
Common anti-patterns in Minecraft Modding
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 class BlockBase extends Block { | |
public BlockBase(Material materialIn, ResourceLocation registryName) { | |
super(materialIn); | |
this.setRegistryName(registryName); | |
this.setUnlocalizedName(registryName.toString()); | |
} | |
public void registerModel() { | |
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "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 class ItemBase extends Item { | |
public ItemBase(ResourceLocation registryName) { | |
this.setRegistryName(registryName); | |
this.setUnlocalizedName(registryName.toString()); | |
} | |
public void registerModel() { | |
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment