Slimefun / Slimefun4

Slimefun 4 - A unique Spigot/Paper plugin that looks and feels like a modpack. We've been giving you backpacks, jetpacks, reactors and much more since 2013.
GNU General Public License v3.0
964 stars 547 forks source link

Enabling `call-explosion-event` will not drop Slimefun blocks when breaking it using explosive tools. #3601

Open variananora opened 2 years ago

variananora commented 2 years ago

❗ Checklist

📍 Description

Enabling call-explosive-event on explosive tools caused only the targeted Slimefun blocks to be dropped and drop nothing on the exploded part. This only happens to Slimefun blocks, vanilla blocks will drop just fine. Also this seems to clear block storage data on that coordinate as well.

📑 Reproduction Steps

  1. Enable call-explosive-event on explosive pickaxe
  2. Try to break Slimefun blocks
  3. See it only drops the one you are hitting with it

💡 Expected Behavior

It should drop all the Slimefun blocks

📷 Screenshots / Videos

https://youtu.be/OG7TwUCqqzg

📜 Server Log

No response

📂 /error-reports/ folder

No response

💻 Server Software

Paper

🎮 Minecraft Version

1.19.x

⭐ Slimefun version

This Server uses the following setup of Slimefun:
Paper git-Paper-42 (MC: 1.19)
Slimefun DEV - 1015 (git 2c4f886f)
Metrics-Module #28
Java 17

Installed Addons: (2)
  CMILib v1.2.1.0
  CMI v9.2.0.3

🧭 Other plugins

Plugins (7): CMI, CMILib, Multiverse-Core, Slimefun, Vault, VoidGen, WorldEdit
FN-FAL113 commented 2 years ago

I spent most of my time debugging this, the returned list from the blockExplodeEvent inside the ExplosiveTool.class are mutated and something is messing with it in the internals, its not giving the expected list given from the constructor of the block explode event and is being mutated after the event is called and doing a call to #blockList() returns only air blocks while the solid blocks are being filtered for a reason I can't really tell why.

FN-FAL113 commented 2 years ago

image an image of the original block list that are intentionally filtered (should also contain air blocks if unfiltered) for debugging versus the block explode event block list which only returns air blocks even though the original block list with the solid blocks destroyed are passed in the constructor of the event

comonier commented 1 year ago

Players from my server reported explosive pickaxe is breaking only 1 block and not 3x3 Letme know - if there is something i can do to help. I not use slimefun addons, only master: Slimefun4 - DEV 1047 (git 84008)

iTwins commented 1 year ago

I'm pretty sure I found the culprit: line 52 of ExplosionsListener.java If you follow the methodcalls it takes you to line 88 and 89 where the blockstorage is cleared (as mentioned in the issue description) and the material is set to AIR (which would explain the debug commented previously) This is also the only BlockExplodeEvent eventhandler Github could find, which further proves my suspicions