Curios API (Forge/NeoForge)

Curios API (Forge/NeoForge)

140M Downloads

[Bug]: 20.6.113-BETA neoforge crash

TheSlayerMC opened this issue ยท 6 comments

commented

Minecraft Version

1.20.6

What happened?

CuriosEventHandler line 471 needs to be updated to suit latest version of forge

How do you trigger this bug?

Devspace

Loader

NeoForge

Loader Version

20.6.113

Mod Version

Curios 8.0.0

Relevant Log Outputs

No response

commented

As of 8.0.0-beta6, unless the drop has an experience value the block wont drop anything as it sets a negative value in the experience

This should now be fixed on NeoForge's side as of their 20.6.116 version.

commented

Can confirm, breaking any block causes the game to crash due to the method setExpToDrop being absent. This was moved to BlockDropsEvent instead, with a different method name for the setter

commented

Breaking for example, a grass block (anything that doesnt have an XP drop)

Here

commented

As of 8.0.0-beta6, unless the drop has an experience value the block wont drop anything as it sets a negative value in the experience

java.lang.IllegalArgumentException: May not set a negative experience drop.

commented

As of 8.0.0-beta6, unless the drop has an experience value the block wont drop anything as it sets a negative value in the experience

Is there a specific example of this behavior? From what I can tell, IBlockExtension#getExpDrop defaults to 0 so it shouldn't be negative unless a mod specifically sets it to be negative for some reason.

commented

This may be a NeoForge bug, depending on how the event is intended to be implemented. The experience is not negative, it is 0 as expected. The problem is that NeoForge checks for a positive experience value:

Preconditions.checkArgument(experience > 0, "May not set a negative experience drop.");

A value of 0 will fail this check; however, the error message implies that it should only error on negative values. It's possible that this is intended and the error message is misleading, but I doubt that is the case because otherwise there doesn't seem to be a way to zero out the experience drops without also canceling the item drops in the event.