mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
* fix(entity): reset fall distance on Spectator/Creative gamemode switch Prevents fall damage when a player switches to Spectator mid-fall and then back to Survival before landing. This is a pragmatic workaround — vanilla achieves this through multiple independent defense layers (noPhysics, per-tick reset, on_ground force, mayfly check) rather than an explicit reset. The TODOs in the code track the remaining gaps for a full vanilla-faithful implementation. Fixes #2372 * docs(entity): document Creative fall-distance over-forgiveness edge case Add TODO clarifying that once vanilla fall-damage layers 1-4 are implemented, the reset should be restricted to Spectator only. In vanilla a non-flying Creative player keeps fallDistance across a Survival switch (guarded by abilities.mayfly in causeFallDamage); resetting here over-forgives that edge case. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: condense fall damage comment to reference vanilla methods Reduced comment from 23 lines to 6 by: - Removing detailed explanations of vanilla defense layers - Directly referencing Player.aiStep() and Player.causeFallDamage() - Keeping only actionable TODOs - Switching to /* */ style --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>