Change how blocks/items are registered (desc)
tterrag is a meany face and yelled at me for using class.getSimpleName(). So here's an API-friendly re-work of the registration system. This allows all our Items/Blocks to be obtained via the API. Just add a new enum.
This commit is contained in:
parent
2a028414b1
commit
fdfcb5c5b7
69 changed files with 260 additions and 15 deletions
|
@ -360,6 +360,14 @@ public class ModItems
|
|||
|
||||
private static Item registerItem(Item item)
|
||||
{
|
||||
return registerItem(item, item.getClass().getSimpleName());
|
||||
if (item.getRegistryName() == null) {
|
||||
BloodMagic.instance.getLogger().error("Attempted to register Item {} without setting a registry name. Item will not be registered. Please report this.", item.getClass().getCanonicalName());
|
||||
return item;
|
||||
}
|
||||
|
||||
if (!ConfigHandler.itemBlacklist.contains(item.getRegistryName().split(":")[1]))
|
||||
GameRegistry.registerItem(item);
|
||||
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue