Roughly Enough Items Forge (Unused CF Project, Use the Merged One)

Roughly Enough Items Forge (Unused CF Project, Use the Merged One)

348k Downloads

[Bug] Item Tooltip Fetch should not have Player specified

lcy0x1 opened this issue ยท 0 comments

commented

What happened?

I found a rare crash when my mod is used with REI in a large modpack, caused by concurrent query of player capability data from my mod while updating player data. I traced back and found the problem here:

https://github.com/shedaniel/RoughlyEnoughItems/blob/ee6aa88ada9e4d1034cb754a8997f8a0996e9cab/runtime/src/main/java/me/shedaniel/rei/plugin/client/entry/ItemEntryDefinition.java#L231C51-L231C76

When building search tree asynchronously, to avoid concurrency issue, the player should not be specified. I understand that sometimes mods could crash without it. Maybe if it throws exception when player is specified, try again with null player?

What mod loaders are you seeing the problem on?

Forge

What do you think this bug is of?

  • Visual
  • Recipe Lookup
  • Cheat Mode
  • Plugin Integration / JEI Plugin Compatibility
  • Others

Relevant log output

java.lang.NullPointerException: Cannot invoke "java.util.HashMap.get(Object)" because "this.copy" is null
	at TRANSFORMER/[email protected]/dev.xkmc.l2library.capability.conditionals.ConditionalData.getData(ConditionalData.java:51)
	at TRANSFORMER/[email protected]/dev.xkmc.curseofpandora.event.ClientSpellText.onTooltip(ClientSpellText.java:43)
	at TRANSFORMER/[email protected]/dev.xkmc.curseofpandora.event.__ClientSpellText_onTooltip_ItemTooltipEvent.invoke(.dynamic)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:315)
	at MC-BOOTSTRAP/net.minecraftforge.eventbus/net.minecraftforge.eventbus.EventBus.post(EventBus.java:296)
	at TRANSFORMER/[email protected]/net.minecraftforge.event.ForgeEventFactory.onItemTooltip(ForgeEventFactory.java:360)
	at TRANSFORMER/[email protected]/net.minecraft.world.item.ItemStack.m_41651_(ItemStack.java:763)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition.tryGetItemStackToolTip(ItemEntryDefinition.java:231)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition$ItemEntryRenderer.getTooltip(ItemEntryDefinition.java:369)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.impl.common.entry.AbstractEntryStack.getTooltip(AbstractEntryStack.java:195)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.impl.client.search.argument.type.TooltipArgumentType.tryGetEntryStackTooltip(TooltipArgumentType.java:90)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.impl.client.search.argument.type.TooltipArgumentType.cacheData(TooltipArgumentType.java:75)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.impl.client.search.argument.type.TooltipArgumentType.cacheData(TooltipArgumentType.java:45)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.impl.client.search.argument.ArgumentCache.cacheStacks(ArgumentCache.java:138)
	at TRANSFORMER/[email protected]/me.shedaniel.rei.impl.client.search.argument.ArgumentCache.lambda$cache$1(ArgumentCache.java:110)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)

Anything else?

No response

By submitting this issue, I have included the necessary logs by pasting the contents into the correct location or attaching the file as an upload.

  • Yes, and I did not use any paste services other than GitHub Gists.

By submitting this issue, I have confirmed my REI and REI's dependencies are up to date.

  • Yes