Curios API (Forge/NeoForge)

Curios API (Forge/NeoForge)

140M Downloads

[1.18.1] Game sometimes crashes when exploring new chunks when curios is installed

NJL5390 opened this issue ยท 9 comments

commented

Versions (Be specific, do not write "latest"):

  • Curios: 5.0.4.0
  • Forge: 39.0.8

Observed Behavior: Game crashes after a varying amount of time exploring.

Expected Behavior: The game would not crash.

Steps to Reproduce:

  1. Load up a new world with curios installed.
  2. Wait for the chunks to load in and explore new chunks afterward.
  3. After a varying amount of time, the game just crashes with the crash report seen below. (Note that you may not even get to step 2 before the game crashes).

Crash Log: https://gist.github.com/NJL5390/7b823cf5ac09b42992ea68d29b01c303

commented

I'm using this to investigate a problem with mixins and FML btw. It seems that the mixin is loading from the wrong place if you have multiple copies of the mod in the mods folder, which is incorrect behaviour.

commented

This is the same crash log I get on my server too. Something related to the new change to Fortune

commented

Was just about to report the same, yes. Pretty much the same crash log and all. I wasn't able to recreate this in singleplayer (and had to downgrade the mod on the server immediately for playability), but the exact circumstances seemed to be a player approaching chunks that housed a dungeon, which would seem to agree that it's an issue with the Fortune loot changes given all the chests within.

commented

Just want to jump in and throw my info for this crash into the mix. I've been able to replicate the crash without generating new chunks after the initial world load. I'm able to stand in my base and it will eventually crash. It seems to be related to the applyFortune mixin

https://pastebin.com/LPC1gmE9
https://pastebin.com/pvuRTFkb
https://pastebin.com/4Bnaqn9t

commented

Someone else has just opened an issue about this for the latest 5.0.4.1 version that was supposed to fix this so I'd like to ask, can anyone that experienced this issue above confirm or deny if the latest update fixed this issue for them?

commented

Question to all: do you have multiple copies of curios in your mods folder - say 5.0.4.0 and 5.0.4.1 ?

Can you please verify if you do and remove the older version if so, and see if the problem reproduces?

commented

With my testing I can confirm that this issue appears to have been fixed by the latest update (5.0.4.1).

Question to all: do you have multiple copies of curios in your mods folder - say 5.0.4.0 and 5.0.4.1 ?

I do not have multiple copies of the mod in my mods folder, just the latest update (5.0.4.1).

commented

For reference, and to provide more context about the nature of the issue:

Originally, in 5.0.4.0, I had this code:

CuriosMixinHooks.getFortuneLevel(lootContext.getParam(LootContextParams.THIS_ENTITY),

The issue is caused by attempting to obtain an entity reference from the loot context when there is none, which will throw a NoSuchElementException error when using this particular method. Minecraft has a different method, LootContext#getParamOrNull, that does not throw this exception that I needed to use instead.

So in 5.0.4.1, the code currently looks like this:

return fortune + CuriosMixinHooks.getFortuneLevel(lootContext);

Entity entity = lootContext.getParamOrNull(LootContextParams.THIS_ENTITY);

The mystifying part is that cpw reported a crash that looks identical to the ones in this thread, but for 5.0.4.1. Which, to my eyes, shouldn't technically be possible since I am no longer using the same method, the method I am using should not be throwing an exception, and the method should now be passing through the CuriosMixinHooks class (which is absent in the stacktrace).

While I suspect this may be an isolated incident of somehow have the older version loaded instead, it's hard for me to conclude that definitively since his log does show the latest version being loaded. Thus I'd like to do my due diligence and leave the issue open for a while to see if there's something more going on here that I may have missed.

commented

Ah that's interesting. It would certainly explain how that would still be happening. So was the crash in your instance due to an older copy of the mod in your mods folder?