[PR #7375] [MERGED] Port map: rest-025's moving-piston methods are answered #7563

Closed
opened 2026-11-03 07:19:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7375
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: chore/vol-e-rest-025


📝 Commits (1)

  • 30d23de Port map: the PistonMovingBlockEntity methods rest-025 left unanswered

📊 Changes

1 file changed (+10 additions, -0 deletions)

View changed files

📝 tools/port_map/rest-025.tsv (+10 -0)

📄 Description

Rows of tools/port_map/rest-025.tsv (14 rows before this change, 24 after, map-check clean against 26.3). The batch answered one PistonMovingBlockEntity method and left the other ten that Horizon ports; they now have rows.

Rows added

row where
PistonMovingBlockEntity.tick crates/horizon-world/src/level/pistons.rs::Sim::moving_piston_tick
PistonMovingBlockEntity.finalTick crates/horizon-world/src/level/pistons.rs::Sim::moving_piston_final_tick
PistonMovingBlockEntity.getExtendedProgress crates/horizon-world/src/piston_push.rs::extended_progress
PistonMovingBlockEntity.getMovement crates/horizon-world/src/piston_push.rs::get_movement
PistonMovingBlockEntity.moveByPositionAndProgress crates/horizon-world/src/piston_push.rs::move_by_position_and_progress
PistonMovingBlockEntity.matchesStickyCritera crates/horizon-world/src/piston_push.rs::matches_sticky_criteria
PistonMovingBlockEntity.getCollisionRelatedBlockState crates/horizon-world/src/piston_push.rs::uses_moved_state
PistonMovingBlockEntity.fixEntityWithinPistonBase crates/horizon-world/src/piston_push.rs::fix_within_piston_base
PistonMovingBlockEntity.saveAdditional crates/horizon-client/src/game/persist.rs::Game::moving_piston_to_nbt
PistonMovingBlockEntity.loadAdditional crates/horizon-client/src/game/persist.rs::Game::moving_piston_from_nbt

All ten are port: each named function's doc comment cites the vanilla method, and the bodies read as the method does.

  • tick (pistons.rs:212) advances progressO and reports the push moveCollidedEntities would make at the new progress; the entity move itself is the caller's, because the tick has no entity list — the doc says so, and piston_pushes is where the push lands.
  • finalTick (pistons.rs:186) keeps vanilla's early-out (progressO >= 1.0 and not a client), then drops the moving piston and places either air (a source piston) or the moved state with a shape update, followed by the oriented neighbour update.
  • The six piston_push.rs functions are the geometric half of the push: travel distance in blocks (extended_progress), the overlap of an entity with the block it is pushed out of (get_movement), the moved box (move_by_position_and_progress), the sticky test on the block ahead (matches_sticky_criteria), the collision state (uses_moved_state), and the drag of an entity still inside a retracting source piston (fix_within_piston_base).
  • saveAdditional/loadAdditional (persist.rs:287 and :303) write and read blockState, facing (the 3D data value as a byte, Direction.LEGACY_ID_CODEC), progress, extending and source, in the compound the entity's own id, x, y, z sit in.

Left out of the file, deliberately

PistonMovingBlockEntity.getCollisionShape (the ledger points at BlockCollisionRegistry::pistons, which is only the accessor for the piston shape bindings), moveEntityByPiston and moveStuckEntities (the ledger's guesses, Game::move_pushed and Game::push_for_piston, are Entity.move(MoverType.PISTON, …) and the push loop), and the one-line accessors (getProgress, getXOff, getYOff, getZOff, getDirection, isExtending, isSourcePiston, getMovedState, …). A row there would name a function that is not the method.

Map-check:

PORT_LEDGER_OUT=/tmp/led-volE2 python3 tools/port_ledger.py map-check tools/port_map/rest-025.tsv
24 rows, no problems.

Proven: each where cell resolves under map-check, and each cited function's doc comment names the vanilla method it is filed under; the bodies were read for tick, finalTick, saveAdditional and loadAdditional (the early-out, the source-piston air case, the field list and the legacy facing byte).

Not proven: the six piston_push.rs geometries were matched on their doc comments and signatures, not line by line against vanilla's arithmetic; a difference in one of the offset formulas would not show up in this pass. I did not run a piston push in game.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7375 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/vol-e-rest-025` --- ### 📝 Commits (1) - [`30d23de`](https://github.com/horizon-rust/horizon/commit/30d23de3b32303bb34be3b4fb59ac8a1bf9ab132) Port map: the PistonMovingBlockEntity methods rest-025 left unanswered ### 📊 Changes **1 file changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tools/port_map/rest-025.tsv` (+10 -0) </details> ### 📄 Description Rows of `tools/port_map/rest-025.tsv` (14 rows before this change, 24 after, map-check clean against 26.3). The batch answered one `PistonMovingBlockEntity` method and left the other ten that Horizon ports; they now have rows. **Rows added** | row | where | | --- | --- | | `PistonMovingBlockEntity.tick` | `crates/horizon-world/src/level/pistons.rs::Sim::moving_piston_tick` | | `PistonMovingBlockEntity.finalTick` | `crates/horizon-world/src/level/pistons.rs::Sim::moving_piston_final_tick` | | `PistonMovingBlockEntity.getExtendedProgress` | `crates/horizon-world/src/piston_push.rs::extended_progress` | | `PistonMovingBlockEntity.getMovement` | `crates/horizon-world/src/piston_push.rs::get_movement` | | `PistonMovingBlockEntity.moveByPositionAndProgress` | `crates/horizon-world/src/piston_push.rs::move_by_position_and_progress` | | `PistonMovingBlockEntity.matchesStickyCritera` | `crates/horizon-world/src/piston_push.rs::matches_sticky_criteria` | | `PistonMovingBlockEntity.getCollisionRelatedBlockState` | `crates/horizon-world/src/piston_push.rs::uses_moved_state` | | `PistonMovingBlockEntity.fixEntityWithinPistonBase` | `crates/horizon-world/src/piston_push.rs::fix_within_piston_base` | | `PistonMovingBlockEntity.saveAdditional` | `crates/horizon-client/src/game/persist.rs::Game::moving_piston_to_nbt` | | `PistonMovingBlockEntity.loadAdditional` | `crates/horizon-client/src/game/persist.rs::Game::moving_piston_from_nbt` | All ten are `port`: each named function's doc comment cites the vanilla method, and the bodies read as the method does. - `tick` (pistons.rs:212) advances `progressO` and reports the push `moveCollidedEntities` would make at the new progress; the entity move itself is the caller's, because the tick has no entity list — the doc says so, and `piston_pushes` is where the push lands. - `finalTick` (pistons.rs:186) keeps vanilla's early-out (`progressO >= 1.0` and not a client), then drops the moving piston and places either air (a source piston) or the moved state with a shape update, followed by the oriented neighbour update. - The six `piston_push.rs` functions are the geometric half of the push: travel distance in blocks (`extended_progress`), the overlap of an entity with the block it is pushed out of (`get_movement`), the moved box (`move_by_position_and_progress`), the sticky test on the block ahead (`matches_sticky_criteria`), the collision state (`uses_moved_state`), and the drag of an entity still inside a retracting source piston (`fix_within_piston_base`). - `saveAdditional`/`loadAdditional` (persist.rs:287 and :303) write and read `blockState`, `facing` (the 3D data value as a byte, `Direction.LEGACY_ID_CODEC`), `progress`, `extending` and `source`, in the compound the entity's own `id`, `x`, `y`, `z` sit in. **Left out of the file, deliberately** `PistonMovingBlockEntity.getCollisionShape` (the ledger points at `BlockCollisionRegistry::pistons`, which is only the accessor for the piston shape bindings), `moveEntityByPiston` and `moveStuckEntities` (the ledger's guesses, `Game::move_pushed` and `Game::push_for_piston`, are `Entity.move(MoverType.PISTON, …)` and the push loop), and the one-line accessors (`getProgress`, `getXOff`, `getYOff`, `getZOff`, `getDirection`, `isExtending`, `isSourcePiston`, `getMovedState`, …). A row there would name a function that is not the method. Map-check: ``` PORT_LEDGER_OUT=/tmp/led-volE2 python3 tools/port_ledger.py map-check tools/port_map/rest-025.tsv 24 rows, no problems. ``` **Proven:** each `where` cell resolves under map-check, and each cited function's doc comment names the vanilla method it is filed under; the bodies were read for `tick`, `finalTick`, `saveAdditional` and `loadAdditional` (the early-out, the source-piston air case, the field list and the legacy facing byte). **Not proven:** the six `piston_push.rs` geometries were matched on their doc comments and signatures, not line by line against vanilla's arithmetic; a difference in one of the offset formulas would not show up in this pass. I did not run a piston push in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 07:19:52 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7563
No description provided.