copygirl / WearableBackpacks

Minecraft mod which adds beautiful, balanced backpacks
MIT License
61 stars 35 forks source link

Null Pointer Issue during registry #80

Closed DomAmato closed 6 years ago

DomAmato commented 6 years ago

Someone notified me of this issue on one of my mods but its actually an issue with this mod. https://pastebin.com/kNUuJX8m

Basically this: https://github.com/copygirl/WearableBackpacks/blob/master/src/main/java/net/mcft/copy/backpacks/block/BlockBackpack.java#L54

I think you can get rid of that and just add in another line in the lang files? Unless there is a reason the unlocalized name needs to be dynamic that I am not seeing?

AlphaSparqy commented 6 years ago

Dom, I'm pretty sure there is something going on in your mod. I referenced the issue on your curseforge page, however I get the exact same problem (NPE), with rabbit-gui, roboticraft, and ironbackpacks. I am able to use IronBackpacks with 359 other mods (granted many are library mods, etc, but forge reports it as 359). I set up an instance with just the 3 mods to generate the following crash report.

https://pastebin.com/1iTYSp3d

I've also put the issue on IronBackpacks Git here

https://github.com/gr8pefish/IronBackpacks/issues/242

AlphaSparqy commented 6 years ago

IronBackpacks code causing NPE, only with Roboticraft installed.

@Override public String getUnlocalizedName(ItemStack stack) { BackpackUpgrade backpackUpgrade = getUpgrade(stack); if (backpackUpgrade.isNull()) return super.getUnlocalizedName(stack);

return "upgrade.ironbackpacks." + backpackUpgrade.getIdentifier().getResourcePath();

}

WearableBackpacks code causing NPE, only with Roboticraft Installed.

@Override public String getUnlocalizedName() { // Just use the item's unlocalized name for this block. return MiscUtils.getItemFromBlock(this).getUnlocalizedName(); }

It would seem, that the .getUnlocalizedNamed() is the commonality?

AlphaSparqy commented 6 years ago

Also, if you look at the stack traces,

WearableBackpacks is actually getting knocked out by this portion at com.dyn.robot.RegistrationHandler.registerBlocks(RegistrationHandler.java:75) Your registration handler for blocks.

IronBackpacks is actually getting knocked out by this portion at com.dyn.robot.RegistrationHandler.registerItems(RegistrationHandler.java:180) Your registration handler for items.

AlphaSparqy commented 6 years ago

Just some further info to isolate it.

I don't have the Roboticraft API loaded (well maybe I do? I don't give minecraft internet access, but there is a robot.py that must've came with the .jar) however the blocks.py, and the items.py are both being created and are populated with a good load of blocks/items.

DomAmato commented 6 years ago

this was fixed with the most recent release of roboticraft

copygirl commented 6 years ago

Thank you both! Sorry for the lack of response, I have pushed WBs aside for now and was hoping asiekierka might respond.