MalisisDoors

MalisisDoors

48M Downloads

OreDictionary complaint when registering vanilla doors

DrPlantabyte opened this issue ยท 1 comments

commented

Hello!

I'm the author of the Base Metals mod and my users have run into a small compatibility issue that I would like to resolve.

Specifically, when I invoke thew following in the Base Metals initialization method to setup the OreDictionary for recipes:

net.minecraftforge.oredict.OreDictionary.registerOre("door", net.minecraft.init.Items.iron_door);

I get the following complaint in the log:

[12:39:37] [Client thread/WARN] [FML]: ****************************************
[12:39:37] [Client thread/WARN] [FML]: * A broken ore dictionary registration with name doorIron has occurred. It adds an item (type: class net.malisis.doors.item.DoorItem) which is currently unknown to the game registry. This dictionary item can only support a single value when registered with ores like this, and NO I am not going to turn this spam off. Just register your ore dictionary entries after the GameRegistry.
TO USERS: YES this is a BUG in the mod Base Metals report it to them!
[12:39:37] [Client thread/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOreImpl(OreDictionary.java:462)
[12:39:37] [Client thread/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:436)
[12:39:37] [Client thread/WARN] [FML]: * at net.minecraftforge.oredict.OreDictionary.registerOre(OreDictionary.java:434)
[12:39:37] [Client thread/WARN] [FML]: * at cyano.basemetals.init.Recipes.initVanillaRecipes(Recipes.java:64)
[12:39:37] [Client thread/WARN] [FML]: * at cyano.basemetals.init.Recipes.init(Recipes.java:30)
[12:39:37] [Client thread/WARN] [FML]: * at cyano.basemetals.BaseMetals.init(BaseMetals.java:186)...
[12:39:37] [Client thread/WARN] [FML]: ****************************************

The log entry blames Base Metals, but the offending code deals only with vanilla items and I have no troubles with any of the new items created by Base Metals (including custom doors).

I don't know if this is just log spam (which I'm happy to ignore) or a sign of deeper problems. It appears to me that the OreDictionary (or maybe Malisis Core) does not know about your door replacement in the net.minecraft.init.Items class at the time when Base Metals initializes.

Can I safely ignore this? If not, then what is the fix?

commented

I had a hard time finding the code responsible until I realised it wasn't implemented yet in the Forge version I use in dev...
The culprit : https://github.com/MinecraftForge/MinecraftForge/blob/master/src/main/java/net/minecraftforge/oredict/OreDictionary.java#L458-L460

The delegate.name() is set when you register the item (or block).
But because I never register the replacements for Vanilla doors (I manually insert them in the registry), the delegate name is never set for the item, and FML thinks it's not registered at all which is false.

All in all, I think the warning can safely be ignored, but I will try to fix it anyway for the next update.