purpleposeidon / Factorization

It's factorization.
MIT License
28 stars 24 forks source link

OreDict Registrations of certain Items are faulty causing CoFH-Core to crash. #20

Closed GregoriusT closed 4 years ago

GregoriusT commented 4 years ago

I know this Mod is pretty much not being developed anymore for 1.7.10, but I will leave this Issue here for others to see.

This File has several mentions of OreDictionary.registerOre with Items (not Blocks) being passed as parameter before they have been entered into the Item Registry. This results in the Items being invalid at the time of registration, causing CoFH-Core to think their Item IDs are 0 and storing that Data in their already quite faulty HashMaps.

https://github.com/purpleposeidon/Factorization/blob/c40517e52791d0bb036ca86675b28d71cd0ac4e0/src/main/java/factorization/common/Registry.java

As soon as I try to fix this type of Issue within GT6 like I always do, CoFH-Core will crash for no good reason because whenever I get to register your Items they are in the Item Registry and then actually DO have an ID that is not 0, which then ofcourse does make the same Items have unequal IDs resulting in CoFH-Core violating Java Standards by having identical Items use a different Hashcode.

So if you actually still do anything with this Mod, please put those OreDict Registrations after putting all Items into the Item Registry.

Here is a List of the 6 Items (7 Entries) that have this Issue that I debug logged out:

ERROR: class factorization.shared.ItemCraftingComponent from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: sludge ERROR: class factorization.shared.ItemCraftingComponent from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: ingotSilver ERROR: class factorization.shared.ItemCraftingComponent from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: ingotLead ERROR: class factorization.shared.ItemCraftingComponent from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: ingotFzDarkIron ERROR: class factorization.charge.ItemAcidBottle from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: sulfuricAcid ERROR: class factorization.charge.ItemAcidBottle from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: bottleSulfuricAcid ERROR: class factorization.charge.ItemAcidBottle from the Mod factorization has been registered to the OreDict before being registered as an Item/Block as: aquaRegia

asiekierka commented 4 years ago

Duplicate of https://github.com/purpleposeidon/Factorization/issues/5