WolfyScript / CustomCrafting

Spigot based plugin to create your own custom Recipes & Items. Designed to be easy to use with in-game GUI and tons of configuration possibilities.
https://modrinth.com/plugin/customcrafting
GNU General Public License v3.0
114 stars 36 forks source link

Bug with wind charges when are launched to a cauldron. 1.21 minecraft #384

Closed OMarcoGPO closed 3 months ago

OMarcoGPO commented 3 months ago

What happened?

When a wind charge is launched to a cauldron that has already clicked (for the customcrafting gui), the cauldron will provocate a explosion (like a creeper explosion). image image

How can the bug be reproduced?

  1. Place a cauldron
  2. Interact with the cauldron (the bug will not work without this step)
  3. Launch a wind charge to the cauldron
  4. The bug will happen.

Expected Behaviour?

The wind charge must not make a explosion

Plugin version

Customcrafting 4.16.9.1, WolfyUtilities 4.17-beta.6

Server software

Paper 1.21

Relevant log output

No code error output

Submit issue

WolfyScript commented 3 months ago

That is the weirdest issue I got ever xD Neither WolfyUtils nor CustomCrafting should cause explosions like ever, but I did reproduce the issue, so there is definitely something going wrong.
This one will be interesting to debug. I'll keep you updated about further findings.

WolfyScript commented 3 months ago

Turns out, Wind Charges use the same explosion event in Spigot as TNT and any other explosions.
The issue is in the underlying explosion behaviour of the custom block storage (used to store persistent data on blocks) in WolfyUtils, which treats each explosion as destructive.

I need to figure out to detect different types of explosions and when I am at it improve the code from 2 years ago...
Spigot added API for this: https://hub.spigotmc.org/jira/browse/SPIGOT-7799
However, I cannot use the API without dropping support for pre-1.21 versions 🤔

This is also a note, so future me knows what is going on