Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Item Tooltip Fetch should not have Player specified #1659

Open
3 of 7 tasks
lcy0x1 opened this issue Jun 13, 2024 · 0 comments
Open
3 of 7 tasks

[Bug] Item Tooltip Fetch should not have Player specified #1659

lcy0x1 opened this issue Jun 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lcy0x1
Copy link

lcy0x1 commented Jun 13, 2024

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/l2library@2.4.27/dev.xkmc.l2library.capability.conditionals.ConditionalData.getData(ConditionalData.java:51)
	at TRANSFORMER/curseofpandora@0.0NONE/dev.xkmc.curseofpandora.event.ClientSpellText.onTooltip(ClientSpellText.java:43)
	at TRANSFORMER/curseofpandora@0.0NONE/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/forge@47.2.32/net.minecraftforge.event.ForgeEventFactory.onItemTooltip(ForgeEventFactory.java:360)
	at TRANSFORMER/minecraft@1.20.1/net.minecraft.world.item.ItemStack.m_41651_(ItemStack.java:763)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition.tryGetItemStackToolTip(ItemEntryDefinition.java:231)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.plugin.client.entry.ItemEntryDefinition$ItemEntryRenderer.getTooltip(ItemEntryDefinition.java:369)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.impl.common.entry.AbstractEntryStack.getTooltip(AbstractEntryStack.java:195)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.impl.client.search.argument.type.TooltipArgumentType.tryGetEntryStackTooltip(TooltipArgumentType.java:90)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.impl.client.search.argument.type.TooltipArgumentType.cacheData(TooltipArgumentType.java:75)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.impl.client.search.argument.type.TooltipArgumentType.cacheData(TooltipArgumentType.java:45)
	at TRANSFORMER/roughlyenoughitems@12.1.725/me.shedaniel.rei.impl.client.search.argument.ArgumentCache.cacheStacks(ArgumentCache.java:138)
	at TRANSFORMER/roughlyenoughitems@12.1.725/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
@lcy0x1 lcy0x1 added the bug Something isn't working label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant