Skip to content

Instantly share code, notes, and snippets.

@Dockter
Created September 19, 2017 05:01
Show Gist options
  • Save Dockter/a3de1023a6ba281f5095ce6500642541 to your computer and use it in GitHub Desktop.
Save Dockter/a3de1023a6ba281f5095ce6500642541 to your computer and use it in GitHub Desktop.
public <ITEM extends Item> ITEM addItem(ITEM item, String name) {
String qualName = assetKey + ":" + name;
item.setUnlocalizedName(qualName);
item.setRegistryName(assetKey, name);
ForgeRegistries.ITEMS.register(item);
System.out.printf("BaseMod.addItem: Registered %s as %s\n", item, name);
if (debugBlockRegistration)
if (creativeTab != null) {
if (debugCreativeTabs)
System.out.printf("BaseMod.addItem: Setting creativeTab of %s to %s\n", name, creativeTab);
item.setCreativeTab(creativeTab);
}
registeredItems.add(item);
return item;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment