gr8pefish / IronBackpacks

A Minecraft mod that adds portable storage in the form of tiered backpacks with modular upgrades.
GNU General Public License v3.0
60 stars 33 forks source link

Bad "interaction" with Roboticraft resulting in crash on launch #237

Closed vrork closed 6 years ago

vrork commented 6 years ago

Crashing on launch; https://gist.github.com/vrork/c52f4e128eae3ab91a81a5369b917971

TehNut commented 6 years ago

This is the absolute most cancerous bit of code I have ever come across. This issue is 100% on their end.

DomAmato commented 6 years ago

wait so your code is causing a null pointer and its a problem on my end? lets be serious now

ChloeDawn commented 6 years ago

@DomAmato Your code is failing for the same reason you hardcode against vanilla instances here. Until you can write your registry in a way that doesn't require actively avoiding those item classes, the problem is on your end.

DomAmato commented 6 years ago

I'm definitely not saying that the registry is perfect and there is probably a better way but the code that is failing is in iron backpacks on this line: https://github.com/gr8pefish/IronBackpacks/blob/dev-1.12/src/main/java/gr8pefish/ironbackpacks/item/ItemUpgrade.java#L36

For some reason getUpgrade(stack) is returning null so your isNull() doesn't work because the object is null. Realistically checking that backpackUpgrade == null || backpackUpgrade.isNull() would prevent the crash.

If calling getDisplayName on the subitems returned by your mod item is causing a null pointer I don't think its fair to say that its my registry's fault.

DomAmato commented 6 years ago

alright i moved the registry creation into the post init phase and tested it along side the most recent master here and it didnt crash so hopefully that fixes all this