[PR #320] [MERGED] Trial spawners run in game #2489

Closed
opened 2026-11-02 15:56:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/320
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: feat/trial-spawners-game


📝 Commits (2)

  • ca76075 Trial spawner state machine, checked against vanilla
  • ed3d1e1 Trial spawners run in game

📊 Changes

16 files changed (+1950 additions, -66 deletions)

View changed files

📝 crates/horizon-client/examples/natural_spawn_fixture.rs (+272 -2)
📝 crates/horizon-client/src/containers.rs (+19 -5)
📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/natural_spawning.rs (+1 -1)
📝 crates/horizon-client/src/game/spawner.rs (+14 -4)
➕ crates/horizon-client/src/game/trial_spawner.rs (+230 -0)
📝 crates/horizon-client/src/mobs.rs (+2 -0)
📝 crates/horizon-client/src/mobs/spawner.rs (+58 -23)
➕ crates/horizon-client/src/mobs/trial_spawner.rs (+886 -0)
📝 crates/horizon-client/src/mobs/world.rs (+58 -27)
📝 crates/horizon-client/src/save.rs (+2 -0)
📝 crates/horizon-client/src/structure_blocks.rs (+24 -0)
📝 crates/horizon-client/src/vanillagen.rs (+3 -0)
📝 crates/horizon-world/src/loot.rs (+25 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaNaturalSpawnOracle.java (+113 -4)
➕ tools/test_trial_spawner_parity.py (+238 -0)

📄 Description

Part of #223. Thanks to Cosmic (Online5277) for the report. Stacked on #319, which must merge first.

Trial spawners now work in game:

  • The block entity is kept: generated chambers keep their spawner configs, and saves write and read them.
  • It ticks on the server with the level random and the loot random sequences, through #319's state machine.
  • Mobs spawn through the ordinary spawner's path, with persistence required as in vanilla (EntitySpawnReason.TRIAL_SPAWNER).
  • Rewards are ejected as items from the top of the spawner (DefaultDispenseItemBehavior.spawnItem, accuracy 2, up), with their enchantments, potions and ominous bottle levels.
  • The block's trial_spawner_state and ominous follow, with level events 3011–3014 and the shutter sounds.

Checked in game, on a fresh world with seed 12345 at the spider spawners (-2594, -25/-18, 158):

  • In survival the spawner goes waiting_for_players → active and spawns spiders.
  • Once they are killed it goes ejecting_reward, ejects a reward (cooked chicken from spawners/trial_chamber/consumables), then goes to cooldown.

Not yet (next PRs): client visuals (flames, spinning mob, textures), ominous spawners, vaults, decorated pot loot.

Self-check

  • fmt and clippy (-D warnings): clean.
  • Tests: all pass except the flaky title::tests::delete_refuses_an_open_world_then_removes_it_with_its_lock, which passes on its own both here and on origin/main.
  • test_trial_spawner_parity: 2,500 match.
  • test_spawner_parity: 6,000 match.
  • test_natural_spawn_parity: 15,500 match.
  • test_chunk_generation_parity --structures-only --filter trial_chambers: 0 differences.

🤖 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/320 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/trial-spawners-game` --- ### 📝 Commits (2) - [`ca76075`](https://github.com/horizon-rust/horizon/commit/ca76075cc965fccd5b4b7dca16e891422f9f43ea) Trial spawner state machine, checked against vanilla - [`ed3d1e1`](https://github.com/horizon-rust/horizon/commit/ed3d1e1168ccb32db7c238bb4ba9ac43ea7bcd1c) Trial spawners run in game ### 📊 Changes **16 files changed** (+1950 additions, -66 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/natural_spawn_fixture.rs` (+272 -2) 📝 `crates/horizon-client/src/containers.rs` (+19 -5) 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/natural_spawning.rs` (+1 -1) 📝 `crates/horizon-client/src/game/spawner.rs` (+14 -4) ➕ `crates/horizon-client/src/game/trial_spawner.rs` (+230 -0) 📝 `crates/horizon-client/src/mobs.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/spawner.rs` (+58 -23) ➕ `crates/horizon-client/src/mobs/trial_spawner.rs` (+886 -0) 📝 `crates/horizon-client/src/mobs/world.rs` (+58 -27) 📝 `crates/horizon-client/src/save.rs` (+2 -0) 📝 `crates/horizon-client/src/structure_blocks.rs` (+24 -0) 📝 `crates/horizon-client/src/vanillagen.rs` (+3 -0) 📝 `crates/horizon-world/src/loot.rs` (+25 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaNaturalSpawnOracle.java` (+113 -4) ➕ `tools/test_trial_spawner_parity.py` (+238 -0) </details> ### 📄 Description Part of #223. Thanks to Cosmic (Online5277) for the report. Stacked on #319, which must merge first. Trial spawners now work in game: - The block entity is kept: generated chambers keep their spawner configs, and saves write and read them. - It ticks on the server with the level random and the loot random sequences, through #319's state machine. - Mobs spawn through the ordinary spawner's path, with persistence required as in vanilla (`EntitySpawnReason.TRIAL_SPAWNER`). - Rewards are ejected as items from the top of the spawner (`DefaultDispenseItemBehavior.spawnItem`, accuracy 2, up), with their enchantments, potions and ominous bottle levels. - The block's `trial_spawner_state` and `ominous` follow, with level events 3011–3014 and the shutter sounds. Checked in game, on a fresh world with seed 12345 at the spider spawners (-2594, -25/-18, 158): - In survival the spawner goes `waiting_for_players` → `active` and spawns spiders. - Once they are killed it goes `ejecting_reward`, ejects a reward (cooked chicken from `spawners/trial_chamber/consumables`), then goes to `cooldown`. Not yet (next PRs): client visuals (flames, spinning mob, textures), ominous spawners, vaults, decorated pot loot. ## Self-check - fmt and clippy (`-D warnings`): clean. - Tests: all pass except the flaky `title::tests::delete_refuses_an_open_world_then_removes_it_with_its_lock`, which passes on its own both here and on origin/main. - `test_trial_spawner_parity`: 2,500 match. - `test_spawner_parity`: 6,000 match. - `test_natural_spawn_parity`: 15,500 match. - `test_chunk_generation_parity --structures-only --filter trial_chambers`: 0 differences. 🤖 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-02 15:56:37 +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#2489
No description provided.