[PR #2121] [MERGED] Keep a happy ghast solid and still under a rider who gets off it (server thread) #4023

Closed
opened 2026-11-03 04:14:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2121
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/1938-ghast-dismount


📝 Commits (5)

  • 946f47b Keep a happy ghast solid and still under a rider who gets off it
  • 452fca8 Merge origin/main into fix/1938-ghast-dismount
  • 3a5dd71 Merge origin/main into fix/1938-ghast-dismount
  • 7d54dc4 Merge origin/main into fix/1938-ghast-dismount (picks up main's rabbit-arm fix, #2716)
  • f90cdb0 Merge origin/main into fix/1938-ghast-dismount

📊 Changes

4 files changed (+64 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+11 -0)
📝 crates/horizon-client/src/game/remote.rs (+38 -0)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+4 -0)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+11 -0)

📄 Description

What and why

Getting off a harnessed happy ghast on the server thread (single player's default) should leave you standing on its back, with the ghast held still. Instead you drop through it to the ground and the ghast flies off.

Cause, from reading the code and watching it with the test build:

  • The server never told the window that the ghast is on its still timeout. Vanilla syncs STAYS_STILL, and a client ghast is solid to the player while it is set (HappyGhast.canBeCollidedWith). Here the window only had the "feet at or above the top" test, which fails by a rounding error or a hair of ghast movement. The player was teleported to the ghast's exact top and started falling on the first tick, even with a ghast that had been hovering for nine seconds.
  • The window's copy of the ghast also trails the server's (stepped interpolation; a vanilla client simulates the ghast it rides). After a dismount in motion it could sit below the landing spot and then rise into the rider's feet.
  • Once the player fell out of the scan box, the server's scanPlayerAboveGhast stopped refreshing the timeout, so after half a second the ghast flew away.

Fix:

  • The server sends STAYS_STILL (entity data index 19) for a ghast on a still timeout and marks it as needing precise positions, as vanilla does in HappyGhast.aiStep.
  • The window reads that flag as the still timeout.
  • When the server takes the local player off a happy ghast, the window assumes the still timeout at once (removePassenger), and when the dismount teleport arrives it puts its copy of the ghast under the landing spot.

How I saw it: with the test build, summon minecraft:happy_ghast, give a white harness, right click twice (harness, mount), hold space for 2 seconds, then sneak. Polling state and entities every 20 ms: the player is teleported onto the top, falls straight through (in 0.9 s it is on the ground at y 120), and the ghast moves off. With --in-frame the same steps leave the player on the ghast and the ghast still, so only the server-thread path was wrong.

Fixes #1938.

Vanilla reference

  • HappyGhast.STAYS_STILL, syncStayStillFlag, isOnStillTimeout, setServerStillTimeout, removePassenger
  • HappyGhast.canBeCollidedWith, HappyGhast.getDismountLocationForPassenger, HappyGhast.aiStep (setRequiresPrecisePosition)
  • ServerPlayer.dismountTo, ClientPacketListener.handleSetEntityPassengersPacket

Self-check

cargo check -p horizon-client passes.


🔄 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/2121 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1938-ghast-dismount` --- ### 📝 Commits (5) - [`946f47b`](https://github.com/horizon-rust/horizon/commit/946f47b3ec6c79f21a67e4637f24869285321de4) Keep a happy ghast solid and still under a rider who gets off it - [`452fca8`](https://github.com/horizon-rust/horizon/commit/452fca8bdd12e7aed28113f987d4e85ae0e15d99) Merge origin/main into fix/1938-ghast-dismount - [`3a5dd71`](https://github.com/horizon-rust/horizon/commit/3a5dd71152617e885201cb1e7b259500b2a55543) Merge origin/main into fix/1938-ghast-dismount - [`7d54dc4`](https://github.com/horizon-rust/horizon/commit/7d54dc4eaa62723378a11cd90af9a3cdae53ce6c) Merge origin/main into fix/1938-ghast-dismount (picks up main's rabbit-arm fix, #2716) - [`f90cdb0`](https://github.com/horizon-rust/horizon/commit/f90cdb04a57694b6529f11ce6b9a247f27084d4f) Merge origin/main into fix/1938-ghast-dismount ### 📊 Changes **4 files changed** (+64 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+11 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+38 -0) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+4 -0) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+11 -0) </details> ### 📄 Description ## What and why Getting off a harnessed happy ghast on the server thread (single player's default) should leave you standing on its back, with the ghast held still. Instead you drop through it to the ground and the ghast flies off. Cause, from reading the code and watching it with the test build: - The server never told the window that the ghast is on its still timeout. Vanilla syncs `STAYS_STILL`, and a client ghast is solid to the player while it is set (`HappyGhast.canBeCollidedWith`). Here the window only had the "feet at or above the top" test, which fails by a rounding error or a hair of ghast movement. The player was teleported to the ghast's exact top and started falling on the first tick, even with a ghast that had been hovering for nine seconds. - The window's copy of the ghast also trails the server's (stepped interpolation; a vanilla client simulates the ghast it rides). After a dismount in motion it could sit below the landing spot and then rise into the rider's feet. - Once the player fell out of the scan box, the server's `scanPlayerAboveGhast` stopped refreshing the timeout, so after half a second the ghast flew away. Fix: - The server sends `STAYS_STILL` (entity data index 19) for a ghast on a still timeout and marks it as needing precise positions, as vanilla does in `HappyGhast.aiStep`. - The window reads that flag as the still timeout. - When the server takes the local player off a happy ghast, the window assumes the still timeout at once (`removePassenger`), and when the dismount teleport arrives it puts its copy of the ghast under the landing spot. How I saw it: with the test build, `summon minecraft:happy_ghast`, give a white harness, right click twice (harness, mount), hold space for 2 seconds, then sneak. Polling `state` and `entities` every 20 ms: the player is teleported onto the top, falls straight through (in 0.9 s it is on the ground at y 120), and the ghast moves off. With `--in-frame` the same steps leave the player on the ghast and the ghast still, so only the server-thread path was wrong. Fixes #1938. ## Vanilla reference - `HappyGhast.STAYS_STILL`, `syncStayStillFlag`, `isOnStillTimeout`, `setServerStillTimeout`, `removePassenger` - `HappyGhast.canBeCollidedWith`, `HappyGhast.getDismountLocationForPassenger`, `HappyGhast.aiStep` (`setRequiresPrecisePosition`) - `ServerPlayer.dismountTo`, `ClientPacketListener.handleSetEntityPassengersPacket` ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:05 +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#4023
No description provided.