Skip to content

Instantly share code, notes, and snippets.

@JamiesWhiteShirt
Last active July 9, 2017 18:41
Show Gist options
  • Save JamiesWhiteShirt/dd16b680c65099c12df78f451a08c2c0 to your computer and use it in GitHub Desktop.
Save JamiesWhiteShirt/dd16b680c65099c12df78f451a08c2c0 to your computer and use it in GitHub Desktop.
Common anti-patterns in Minecraft Modding
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"));
}
}
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