TheIllusiveC4 / Curios

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

[Bug]: Blocks do not drop their loot tables after destroying #425

Open Tiviacz1337 opened 4 days ago

Tiviacz1337 commented 4 days ago

Minecraft Version

1.20.6

What happened?

I was implementing compatibility for my mod and noticed that curios breaks ability to destroy blocks throwing an error. Seems like you try to set experience drop everytime and it throws an error when block drops 0 experience, because value must be positive

How do you trigger this bug?

  1. Install Curios API
  2. Set survival game mode
  3. Destroy any block
  4. Block do not drop, error prints in console

Loader

NeoForge

Loader Version

NeoForge - 20.6.119

Mod Version

Curios 8.0.1+1.20.6

Relevant Log Outputs

https://hastebin.com/share/emabusawen.perl

TheIllusiveC4 commented 4 days ago

This is rather strange, because the code that's being referenced shouldn't exist in your version of NeoForge. This was a bug that they fixed in 20.6.116.

https://github.com/neoforged/NeoForge/blob/6c2f2b017e7e194fba32905392a70077ea2d0508/src/main/java/net/neoforged/neoforge/event/level/BlockDropsEvent.java#L126

It now only checks for a non-negative value, so 0 is valid. In addition, I've just tested this myself and cannot reproduce this issue. But I do see in your log that it seems like you're loading 20.6.119, so I honestly can't explain the discrepancy. Maybe remove and refresh the dependency? Or maybe the block you're destroying is returning a negative value for some reason?

Tiviacz1337 commented 3 days ago

I'll refresh the environment to load proper neo and update here