[PR #1976] [MERGED] Tick End gateways' server copies on a server without a window #3906

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

📋 Pull Request Information

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

Base: main ← Head: fix/1526-gateway-cooldown


📝 Commits (1)

  • 2c0d9cc Tick End gateways' server copies on a server without a window

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/block_entity_anims.rs (+30 -0)

📄 Description

Fixes #1526.

What and why

On the server thread (and on a dedicated server), an End gateway took the player once and then never
again until the world was reopened.

Entering a gateway starts its 40 tick cooldown on the server's copy of the gateway
(EndGatewayBlock.entityInside → triggerCooldown). That copy's ticker, portalTick, which counts the
cooldown down, only ran inside the client block-entity pass (tick_block_entity_anims). That pass returns
at once when there is no renderer, and the server thread's Game has none, so the cooldown stayed at 40
forever and every later entityInside was refused. Reopening the world made a fresh copy, which is why a
restart "fixed" it.

Now a Game without a renderer still runs portalTick on the gateways it keeps a server copy of (the ones
entities have used), in block-ticking chunks, and sends triggerCooldown's block event when the age reaches
a multiple of 2400, as vanilla's server ticker does. The in-frame path (with a renderer) is unchanged.

Vanilla reference

  • TheEndGatewayBlockEntity.portalTick (server ticker): age++, the cooldown counts down, or
    triggerCooldown every 2400 ticks of age; beamAnimationTick is the client's.
  • EndGatewayBlock.getTicker: the server ticker on a server level.
  • Level.tickBlockEntities: only in shouldTickBlocksAt chunks.

Checked in game with horizon-ctl: an end_gateway set at 702 100 0 in the End (more than 512 blocks from
the centre, so it leads to the End spawn), walked into three times with 6 s between trips:

Path trip 1 trip 2 trip 3
server thread (default) travels travels travels
--in-frame travels travels travels

No harness drives a gateway on the server thread; the harnesses next to the change still pass:

  • test_block_entity_anim_parity.py: 296/296 cases match (20804 ticked steps), block entity animation parity ok
  • test_end_gateway_parity.py: client and server 754,877 end-gateway output lines match Rust
  • test_block_entity_tickers_parity.py: 3000 scenarios, 21199 of 21199 ticks match vanilla

Self-check

I did not paste a tools/pr_ready.py block: I work on Windows, where tools/parity.py cannot run (it needs
fcntl) and three horizon-client tests fail on upstream/main as well
(crash::tests::stacks_start_at_the_panicking_frame,
packs::cache::tests::directory_inputs_config_and_owned_output_recovery,
save::tests::session_lock_is_exclusive). cargo fmt --all -- --check passes; CI runs clippy and the
tests on Linux, and the harnesses above were run one by one (python tools/test_<name>_parity.py).


🔄 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/1976 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1526-gateway-cooldown` --- ### 📝 Commits (1) - [`2c0d9cc`](https://github.com/horizon-rust/horizon/commit/2c0d9cc30efe46a2d1c39c9d06cb86b825ff840b) Tick End gateways' server copies on a server without a window ### 📊 Changes **1 file changed** (+30 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+30 -0) </details> ### 📄 Description Fixes #1526. ## What and why On the server thread (and on a dedicated server), an End gateway took the player once and then never again until the world was reopened. Entering a gateway starts its 40 tick cooldown on the server's copy of the gateway (`EndGatewayBlock.entityInside` → `triggerCooldown`). That copy's ticker, `portalTick`, which counts the cooldown down, only ran inside the client block-entity pass (`tick_block_entity_anims`). That pass returns at once when there is no renderer, and the server thread's `Game` has none, so the cooldown stayed at 40 forever and every later `entityInside` was refused. Reopening the world made a fresh copy, which is why a restart "fixed" it. Now a `Game` without a renderer still runs `portalTick` on the gateways it keeps a server copy of (the ones entities have used), in block-ticking chunks, and sends `triggerCooldown`'s block event when the age reaches a multiple of 2400, as vanilla's server ticker does. The in-frame path (with a renderer) is unchanged. ## Vanilla reference - `TheEndGatewayBlockEntity.portalTick` (server ticker): `age++`, the cooldown counts down, or `triggerCooldown` every 2400 ticks of age; `beamAnimationTick` is the client's. - `EndGatewayBlock.getTicker`: the server ticker on a server level. - `Level.tickBlockEntities`: only in `shouldTickBlocksAt` chunks. Checked in game with `horizon-ctl`: an `end_gateway` set at 702 100 0 in the End (more than 512 blocks from the centre, so it leads to the End spawn), walked into three times with 6 s between trips: | Path | trip 1 | trip 2 | trip 3 | | --- | --- | --- | --- | | server thread (default) | travels | travels | travels | | `--in-frame` | travels | travels | travels | No harness drives a gateway on the server thread; the harnesses next to the change still pass: - `test_block_entity_anim_parity.py`: 296/296 cases match (20804 ticked steps), block entity animation parity ok - `test_end_gateway_parity.py`: client and server 754,877 end-gateway output lines match Rust - `test_block_entity_tickers_parity.py`: 3000 scenarios, 21199 of 21199 ticks match vanilla ## Self-check I did not paste a `tools/pr_ready.py` block: I work on Windows, where `tools/parity.py` cannot run (it needs `fcntl`) and three horizon-client tests fail on upstream/main as well (`crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`, `save::tests::session_lock_is_exclusive`). `cargo fmt --all -- --check` passes; CI runs clippy and the tests on Linux, and the harnesses above were run one by one (`python tools/test_<name>_parity.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:10 +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#3906
No description provided.