Refined Storage

Refined Storage

77M Downloads

Crash with electrodynamics

DariusSG opened this issue ยท 10 comments

commented

This was first created on electrodynamics as the previous versions of electrodynamic works fine. I created this issue here as the author of electrodynamic wants to find out if the problem lies in electrodynamic.

Issue description:

The game crashes with electrodynamic ( version 0.5.0).

What happens:

The game crashes when loading/starting.

What you expected to happen:

The game loads fine

Steps to reproduce:

  1. Launch the game with both refined storage and electrodynamic.
  2. Wait for it to crash.

Version (make sure you are on the latest version before reporting):

  • Minecraft: 1.16.5
  • Forge: 36.2.9 (doesn't matter)
  • Refined Storage: All versions for 1.16.5

Does this issue occur on a server? yes

If a (crash)log is relevant for this issue, link it here:

[Log] (https://pastebin.com/rJwKksy9)
[Debug Log] (https://pastebin.com/yMZZqEP1)

commented

The crash report points to this line

Optional<ICraftingRecipe> foundRecipe = world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, inv, world);

I can only imagine that Electrodynamics is breaking the recipe manager?
nvm it seems like its loading the tooltip before the world is loaded?

commented

The crash report points to this line

Optional<ICraftingRecipe> foundRecipe = world.getRecipeManager().getRecipe(IRecipeType.CRAFTING, inv, world);

I can only imagine that Electrodynamics is breaking the recipe manager? nvm it seems like its loading the tooltip before the world is loaded?

Where does it seem like this?

commented
java.lang.NullPointerException: Initializing game
	at com.refinedmods.refinedstorage.apiimpl.autocrafting.CraftingPatternFactory.create(CraftingPatternFactory.java:57) ~[refinedstorage:1.9.15] {re:classloading}
	at com.refinedmods.refinedstorage.item.PatternItem.lambda$fromCache$1(PatternItem.java:59) ~[refinedstorage:1.9.15] {re:classloading}
	at java.util.HashMap.computeIfAbsent(HashMap.java:1127) ~[?:1.8.0_302] {}
	at com.refinedmods.refinedstorage.item.PatternItem.fromCache(PatternItem.java:57) ~[refinedstorage:1.9.15] {re:classloading}
	at com.refinedmods.refinedstorage.item.PatternItem.func_77624_a(PatternItem.java:79) ~[refinedstorage:1.9.15] {re:classloading}
	at net.minecraft.item.ItemStack.func_82840_a(ItemStack.java:578) ~[?:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack}
	at net.minecraft.client.Minecraft.func_213251_b(Minecraft.java:642) ~[?:?] 

The itemstack function is getTooltip(). The world or the recipe manager have to be null. I assumed it would be the world.

commented

I believe this is because ItemStack#setTag is called by IItemTemperate and IItemElectric in Electrodynamics during mod initialization.

This causes ItemStack#hasTag to evaluate to true on this line, eventually causing a NullPointerException when getRecipeManager is called in CraftingPatternFactory.

While this isn't an issue with Refined Storage itself, couldn't this be solved by adding a null check for world at some point before getRecipeManager is called?

commented

Close this. Someone figured out why :)

commented

Still having this crash as well, what's the solution?

commented

We can probably stop loading the tooltips if the world isn't available, fixing this bug.

commented

Wait, this is already fixed: 48873ab#diff-385fb3cc6029e1a3397a74bd0f779dfe5e3a2f07fde7a67a9ea12d619e1db8d4

See bug #3176

I don't think this is backported to 1.16.5 yet.

commented

I just downloaded the latest 1.16.5 version and it's still an issue. Hopefully they backport it soon^^

commented

New 1.16.5 version coming soon with this fix.