Two bugs in CollisionDetector caused persistent Y-axis bouncing (0.6 block
oscillation) while walking on flat ground:
1. GetAxisStepOrder used a complex 6-branch sorting that often placed
horizontal axes before Y. Vanilla's Direction.Axis.axisStepOrder always
resolves Y first, then the larger horizontal axis. Replaced with the
simple two-case vanilla logic.
2. The horizontal-blocked checks (blockedX/blockedZ) used exact != which
triggered on floating-point noise (~1e-15) from sin/cos in movement
input. Vanilla uses Mth.equal (1e-5 threshold). This false positive
caused step-up to fire every few ticks on flat terrain.
Also includes DescendTemplate robustness fixes from the previous session
(fail on unintended climbing, suppress forward input on climbable blocks).
Made-with: Cursor
- Introduced a comprehensive physics engine that replicates Minecraft's movement mechanics, including player input handling, gravity, and collision detection.
- Added classes for player physics, movement input, and collision detection, ensuring accurate simulation of player interactions with the game world.
- Integrated AABB (Axis-Aligned Bounding Box) structures for precise collision detection against blocks.
- Enhanced movement capabilities with support for jumping, sneaking, and sprinting, along with step-up mechanics for navigating terrain.
These changes significantly improve the realism and responsiveness of player movement within the game environment.