[PR #4900] [MERGED] Game tests run in any dimension #5929

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4900
Author: @levzzz5154
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @levzzz5154

Base: main ← Head: parity/T5-gametest-dims


📝 Commits (2)

  • 3ef3272 Game tests run in any dimension: per-dimension grids, level swapped in for placement, levels with tests keep ticking
  • c418e97 Merge remote-tracking branch 'hr/main' into parity/T5-gametest-dims

📊 Changes

4 files changed (+215 additions, -48 deletions)

View changed files

📝 crates/horizon-client/src/game/commands/test_runs.rs (+33 -10)
📝 crates/horizon-client/src/game/game_tests.rs (+172 -38)
📝 crates/horizon-client/src/game/levels.rs (+9 -0)
📝 crates/horizon-client/src/game/test_entities.rs (+1 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3520

What

Game tests run in the level their test is defined for, as in vanilla 26.3.

Rows:

  • TestCommand.toGameTestInfo: a test whose dimension is another level is no longer rejected; only an unknown dimension (or, in the deprecated in-frame mode, one the game cannot enter) is.
  • StructureGridSpawner.gridFor: one grid per dimension, created when its first test is placed, starting at createTestPositionAround for that level (the source's column, three blocks south, on that level's surface; the chunk is loaded first, playerAndTestInfo). The surface is now read at the source's own column, as vanilla does, not three blocks south.
  • GameTestRunner.spawn / GameTestInfo.prepareTestStructure: run with the test's level in place (enter_level), loading and forcing the chunks of the test box (vanilla's getChunk is synchronous).
  • GameTestRunner.runBatch (clearBetweenBatches, StructureGridSpawner.onBatchStart): clear each test in its own level; forced chunks are released in every level.
  • MinecraftServer.tickChildren: a level with a running or pending test is ticked even with no player in it, so GameTestTicker reaches it.

Vanilla followed

GameTestRunner, GameTestInfo, StructureGridSpawner, TestCommand.createTestPositionAround.

Tests

Unit tests for per-dimension grid state and level wake-up (cargo test -p horizon-client --bins game_tests). Not run in the game: harnesses are left to CI. Known gap: findSelectedTestPositionsAcrossDimensions (existing test blocks in other levels) is not ported.

🤖 Generated with Claude Code


🔄 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/4900 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/T5-gametest-dims` --- ### 📝 Commits (2) - [`3ef3272`](https://github.com/horizon-rust/horizon/commit/3ef3272ee225dbf66105e3ba673eac6bd26d1728) Game tests run in any dimension: per-dimension grids, level swapped in for placement, levels with tests keep ticking - [`c418e97`](https://github.com/horizon-rust/horizon/commit/c418e970be8b5668b4d3b25fbe709c2fb60b088f) Merge remote-tracking branch 'hr/main' into parity/T5-gametest-dims ### 📊 Changes **4 files changed** (+215 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands/test_runs.rs` (+33 -10) 📝 `crates/horizon-client/src/game/game_tests.rs` (+172 -38) 📝 `crates/horizon-client/src/game/levels.rs` (+9 -0) 📝 `crates/horizon-client/src/game/test_entities.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520 ## What Game tests run in the level their test is defined for, as in vanilla 26.3. Rows: - `TestCommand.toGameTestInfo`: a test whose `dimension` is another level is no longer rejected; only an unknown dimension (or, in the deprecated in-frame mode, one the game cannot enter) is. - `StructureGridSpawner.gridFor`: one grid per dimension, created when its first test is placed, starting at `createTestPositionAround` for that level (the source's column, three blocks south, on that level's surface; the chunk is loaded first, `playerAndTestInfo`). The surface is now read at the source's own column, as vanilla does, not three blocks south. - `GameTestRunner.spawn` / `GameTestInfo.prepareTestStructure`: run with the test's level in place (`enter_level`), loading and forcing the chunks of the test box (vanilla's `getChunk` is synchronous). - `GameTestRunner.runBatch` (`clearBetweenBatches`, `StructureGridSpawner.onBatchStart`): clear each test in its own level; forced chunks are released in every level. - `MinecraftServer.tickChildren`: a level with a running or pending test is ticked even with no player in it, so `GameTestTicker` reaches it. ## Vanilla followed `GameTestRunner`, `GameTestInfo`, `StructureGridSpawner`, `TestCommand.createTestPositionAround`. ## Tests Unit tests for per-dimension grid state and level wake-up (`cargo test -p horizon-client --bins game_tests`). Not run in the game: harnesses are left to CI. Known gap: `findSelectedTestPositionsAcrossDimensions` (existing test blocks in other levels) is not ported. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:59 +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#5929
No description provided.