Picked up frog leg from quark then crash... 1.12.2
Sageking10 opened this issue ยท 2 comments
I Used the AutoRegLib-1.3-31 version on the latest version of quark and the latest version of forge (1.12.2 - 14.23.5.2838). I Killed a Frog and picked up its leg. Shortly after the game crashed and gave me this. https://paste.dimdev.org/okiwefajoy.mccrash
EDIT: apparently, this crash happens when a mob drops something with this mob installed.
@yrsegal
This seems more like a workaround than a fix.
Why is the Runnable null
in the first place? Is that expected behavior?
It looks like to me that passing null
to addAction
can never serve any purpose. So having addAction
throw a NPE and then fixing the caller sounds like a better solution.
Edit:
Actually, upon looking at Quark, I realized that this isn't ever getting called with null
(might still want to add the check for good measure) but instead it's getting called from other threads and pendingActions
is an ArrayDeque
which isn't thread-safe.
So this is definitely not the right way to fix it.
Edit 2:
While on the topic:
Why does this even exist in the first place? I.e. why not just use Minecraft.addScheduledTask
?
As is this will additionally cause compatibility issues with BetterPortals because BP hooks Minecraft.addScheduledTask
to determine which world a particular runnable belongs to and will then make sure it's run in that context. It doesn't hook the pendingActions
list so everything will just be ran in the main world.