Closed lellasone closed 3 months ago
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.
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.
This issue occurs when only Valkyrien Skies and addons are installed and no other mods
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:
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
latest.log