Ballon blocks broken by explosion do not impact ship flotation.
lellasone opened this issue · 2 comments
This issue occurs when only Valkyrien Skies and addons are installed and no other mods
- I have tested this issue and it occurs when no other mods are installed
Minecraft Version
1.20
Mod Loader
Forge
Issue description
Expected Behavior: Airship balloons cease to operate when destroyed. This means that as balloons are damaged onboard a ship it will lose lift and fall out of the sky.
Observed Behavior: Airship balloons broken by hand behave as expected, but balloons broken by fire or explosion continue to operate even once gone.
I have tested this in a clean install with only VS and Eureka installed.
The two "ships" prior to any damage.
The two "ships" after damaging the left ship by hand and the right ship with TnT.
Issue reproduction
How to reproduce:
- Create a test world with VS and Eureka installed.
- Construct two ships consisting of 12 oak planks one ship helm, and three balloons as shown in figure 1. *
- Activate both ships.
- Manually break 2 balloons on one ship, and use tnt to destroy 2 balloons on the other ship.
Expected Result: Both ships sink to the ground.
Actual Result: The hand-broken ship sinks to the ground, but the tnt ship continues to fly as if the balloons still existed.
Logs
Okay, after a bit more poking around the issue seems to be that fire and tnt don't actually call "destroy". Instead, they replace the damaged block with air directly (or at least fire does). Forge does however have "onBlockExploded" and "onCaughtFire".
Assuming those work the way I'd expect, adding balloon decrement code to both should make ships behave intuitively in 90% of damage cases. It would introduce a multi-count bug during fires, but I expect the result to feel pretty intuitive in actual game play.
I don't have a dev environment for modding, but if/when I get one set up I'll do some experimenting and report back.
@lellasone Thanks for the helpful information and well documented reproduction steps.
#316 has been created with a fix for this issue, as well as similar issues that could occur for Floaters, Anchors and Helms.
Turns out the destroy
method only applied when a player broke the block, as you figured out. Replacing this method with onRemove
fixed the issue, as this seems to be called whenever a block is destroyed.