TheIllusiveC4 / Curios

Minecraft Mod: A flexible and expandable accessory/equipment API for users and developers.
https://www.curseforge.com/minecraft/mc-mods/curios
Other
179 stars 72 forks source link

[Bug]: 20.6.113-BETA neoforge crash #419

Closed TheSlayerMC closed 3 months ago

TheSlayerMC commented 3 months ago

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

Drullkus commented 3 months ago

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

TheSlayerMC commented 3 months ago

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.

TheIllusiveC4 commented 3 months ago

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.

TheSlayerMC commented 3 months ago

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

Here

TheIllusiveC4 commented 3 months ago

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.

TheIllusiveC4 commented 3 months ago

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.