[PR #4873] [MERGED] Game tests: entity removal, force-loaded chunks #5907

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

📋 Pull Request Information

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

Base: main ← Head: parity/T3-test-verify


📝 Commits (2)

  • 88fd421 Game tests: remove entities in a cleared test area and on success, force-load the test's chunks
  • f4d91f2 Merge hr/main into parity/T3-test-verify

📊 Changes

4 files changed (+188 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/game_tests.rs (+19 -13)
➕ crates/horizon-client/src/game/test_entities.rs (+143 -0)
📝 crates/horizon-client/src/game/test_instances.rs (+25 -2)

📄 Description

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

Part of #3520 (game-test framework, after #4816, #4824, #4833, #4853).

Rows

  • StructureUtils.clearSpaceForStructure: besides the blocks, now clears the block ticks and events of the area and discards every entity but players whose box meets it (level.getEntitiesOfClass(Entity.class, bounds, !Player) then Entity::discard). /test clear* and the structure placement go through it.
  • TestInstanceBlockEntity.placeStructure: forceLoadChunks (every chunk of the structure box is force-loaded, so the level keeps ticking) and removeEntities (getTestBounds(), the structure box inflated by the padding) as vanilla.
  • GameTestInfo.succeed: discards the entities in getStructureBounds().inflate(1.0).
  • GameTestRunner.runBatch listener: when a batch is done, or a failure halts a haltOnError run, every forced chunk of the level is released (setChunkForced(.., false)).

What changed

New game/test_entities.rs (discard_entities_in, force_load_test_chunks, release_forced_chunks); clear_test_space, place_test_structure, the runner's batch end and Info::succeed call them. Mobs are marked removed (vanishing without death), the other entity lists are filtered by box. The dragon is not removed (no box in the lists); entities Horizon does not simulate count by position.

Vanilla followed

StructureUtils.clearSpaceForStructure, TestInstanceBlockEntity.placeStructure/removeEntities/forceLoadChunks, GameTestInfo.succeed, GameTestRunner.runBatch.

Tests

test_entities::tests (box conversion, inflate, open intersection). fmt, clippy -D warnings clean. Not run in-game. Note: main's remote.rs goat horn return; fails to build (#4870); this branch does not touch it.

🤖 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/4873 **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/T3-test-verify` --- ### 📝 Commits (2) - [`88fd421`](https://github.com/horizon-rust/horizon/commit/88fd4212692d511c6bd93c29c8b071a31600506d) Game tests: remove entities in a cleared test area and on success, force-load the test's chunks - [`f4d91f2`](https://github.com/horizon-rust/horizon/commit/f4d91f2fbb5ca0886a9a6944f733e46e996a2244) Merge hr/main into parity/T3-test-verify ### 📊 Changes **4 files changed** (+188 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/game_tests.rs` (+19 -13) ➕ `crates/horizon-client/src/game/test_entities.rs` (+143 -0) 📝 `crates/horizon-client/src/game/test_instances.rs` (+25 -2) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520 (game-test framework, after #4816, #4824, #4833, #4853). ## Rows - `StructureUtils.clearSpaceForStructure`: besides the blocks, now clears the block ticks and events of the area and discards every entity but players whose box meets it (`level.getEntitiesOfClass(Entity.class, bounds, !Player)` then `Entity::discard`). `/test clear*` and the structure placement go through it. - `TestInstanceBlockEntity.placeStructure`: `forceLoadChunks` (every chunk of the structure box is force-loaded, so the level keeps ticking) and `removeEntities` (`getTestBounds()`, the structure box inflated by the padding) as vanilla. - `GameTestInfo.succeed`: discards the entities in `getStructureBounds().inflate(1.0)`. - `GameTestRunner.runBatch` listener: when a batch is done, or a failure halts a `haltOnError` run, every forced chunk of the level is released (`setChunkForced(.., false)`). ## What changed New `game/test_entities.rs` (`discard_entities_in`, `force_load_test_chunks`, `release_forced_chunks`); `clear_test_space`, `place_test_structure`, the runner's batch end and `Info::succeed` call them. Mobs are marked `removed` (vanishing without death), the other entity lists are filtered by box. The dragon is not removed (no box in the lists); entities Horizon does not simulate count by position. ## Vanilla followed `StructureUtils.clearSpaceForStructure`, `TestInstanceBlockEntity.placeStructure/removeEntities/forceLoadChunks`, `GameTestInfo.succeed`, `GameTestRunner.runBatch`. ## Tests `test_entities::tests` (box conversion, inflate, open intersection). fmt, clippy `-D warnings` clean. Not run in-game. Note: main's `remote.rs` goat horn `return;` fails to build (#4870); this branch does not touch it. 🤖 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:50 +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#5907
No description provided.