feat: expand movement simulation parity - #6
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe simulator expands Bedrock movement coverage with pose-aware collision, equipment-based enchantments, block effects, bubble columns, riptide, crawling, gliding, slow falling, liquid updates, and movement-parity tests. README documentation now describes the added providers and capabilities. ChangesMovement simulation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Simulator
participant BubbleColumnProvider
participant MovementEquipmentProvider
participant WorldLiquid
Simulator->>WorldLiquid: detect touching liquid
Simulator->>MovementEquipmentProvider: read Riptide level and leather boots
Simulator->>BubbleColumnProvider: query bubble-column direction
BubbleColumnProvider-->>Simulator: return direction and surface context
Simulator->>Simulator: apply bubble acceleration or riptide impulse
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bubble.go`:
- Around line 50-60: Update the bubble-column processing loop to apply an
impulse only once per tick: after finding the first applicable column cell,
apply its direction and stop further cell processing. Preserve the existing
liquid-above and air checks, and add an integration test covering an AABB
spanning two bubble-column blocks to verify only one impulse is applied.
In `@liquid.go`:
- Around line 85-89: Update the Depth Strider selection in the equipment branch
to fall back to the legacy DepthStriderProvider when EnchantmentDepthStrider
reports level zero, while preserving equipment as authoritative for positive
levels and the existing clamping to 0–3. Add coverage for equipment with level
zero combined with an inventory DepthStriderProvider.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e24a8f37-fccd-46ee-a2da-e078c2e0e9a6
📒 Files selected for processing (17)
README.mdblock_effects.goblock_effects_test.gobubble.gobubble_test.goconstants.godynamic_collision_test.goinput.gointerfaces.goliquid.gomovement.gomovement_environment_test.goparity_test.goplayer_features_test.gosimulation.gosimulator.gosimulator_test.go
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
liquid.go (1)
53-57: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHonor
PressingDescendat the liquid surface.The new descent impulse can be immediately erased by
updateSwimTravelwhen the player looks upward: that clamp only checks!state.WantDownSlow, whilePressingDescendis also set for sneaking andDescendBlock. Skip the surface clamp whenstate.PressingDescendis true, and add an upward-pitch regression test.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@liquid.go` around lines 53 - 57, Update the liquid surface clamp in updateSwimTravel to also skip clamping when state.PressingDescend is true, preserving the descent impulse for sneaking and DescendBlock while looking upward. Add an upward-pitch regression test covering PressingDescend at the liquid surface.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@liquid.go`:
- Around line 53-57: Update the liquid surface clamp in updateSwimTravel to also
skip clamping when state.PressingDescend is true, preserving the descent impulse
for sneaking and DescendBlock while looking upward. Add an upward-pitch
regression test covering PressingDescend at the liquid surface.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5c5c2fe3-c5f4-4ca3-9f34-f9f39027144b
📒 Files selected for processing (18)
bedrock_semantics_test.goblock_effects.goblock_effects_test.gobubble.gobubble_test.goconstants.godynamic_collision_test.goinput.gointerfaces.goliquid.goliquid_test.gomovement.gomovement_environment_test.goparity_test.goplayer_features_test.gosimulation.gosimulator.gosimulator_test.go
🚧 Files skipped from review as they are similar to previous changes (7)
- movement_environment_test.go
- bubble.go
- bedrock_semantics_test.go
- bubble_test.go
- player_features_test.go
- dynamic_collision_test.go
- block_effects_test.go
Summary
mainWhy
bedsim covered core ground, collision, gliding, and teleport physics but was missing several client movement paths and had a handful of numeric differences. These gaps could produce authoritative position or velocity divergence for players interacting with liquids, special blocks, poses, and movement-affecting equipment.
Impact
World adapters may optionally implement
BubbleColumnProviderandMovementCollisionProvider. Player integrations may provideMovementEquipmentProviderfor Depth Strider, Soul Speed, Swift Sneak, Riptide, and leather-boots behavior. Existing providers remain supported, including the legacy inventory-based Depth Strider extension.The README documents the new optional capabilities and pose dimensions.
Validation
go test ./...go test -race ./...go vet ./...git diff --checkSummary by CodeRabbit