[PR #3064] [MERGED] trial spawner: a spawn egg sets its mob, as overrideEntityToSpawn does #4778

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

📋 Pull Request Information

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

Base: main ← Head: trial-spawner-spawn-egg


📝 Commits (1)

  • 557a827 trial spawner: a spawn egg sets its mob, as overrideEntityToSpawn does

📊 Changes

3 files changed (+130 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/game/spawner.rs (+25 -15)
📝 crates/horizon-client/src/game/trial_spawner.rs (+1 -1)
📝 crates/horizon-client/src/mobs/trial_spawner.rs (+104 -0)

📄 Description

What and why

A spawn egg on a trial spawner did nothing, so a placed one stayed inactive with an empty cage. The egg now sets its mob: both configs spawn only that mob (saved inline), the spawner's data resets and its state goes back to inactive. Fixes #3041.

Vanilla reference

SpawnEggItem.useOn → TrialSpawnerBlockEntity.setEntityId → TrialSpawner.overrideEntityToSpawn: data.reset(), FullConfig.overrideEntity (TrialSpawnerConfig.withSpawning on both configs, Holder.direct), setState(INACTIVE). The inline config is written as TrialSpawnerConfig.DIRECT_CODEC writes it (fields at their default left out). Test: a_spawn_egg_overrides_both_configs_inline.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 56f968e11, 2 min 53 s)

Check Result
Scope ✅ 3 files, +130 −16
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 398 run, FAILED (failures=16, errors=8, skipped=1) (1 min 6 s)
rustfmt ✅ (10 s)
clippy ✅ (18 s)
tests: horizon-client ❌ 1093 passed, 2 failed (57 s)
doc tests ✅ 0 passed (18 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on Windows: save::session_lock_is_exclusive, crash::stacks_start_at_the_panicking_frame and the Python tests (they call python3, the Microsoft Store stub here) fail there and are unrelated.


🔄 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/3064 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `trial-spawner-spawn-egg` --- ### 📝 Commits (1) - [`557a827`](https://github.com/horizon-rust/horizon/commit/557a82738300caee38e0465f64fe0766e8af9290) trial spawner: a spawn egg sets its mob, as overrideEntityToSpawn does ### 📊 Changes **3 files changed** (+130 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/spawner.rs` (+25 -15) 📝 `crates/horizon-client/src/game/trial_spawner.rs` (+1 -1) 📝 `crates/horizon-client/src/mobs/trial_spawner.rs` (+104 -0) </details> ### 📄 Description ## What and why A spawn egg on a trial spawner did nothing, so a placed one stayed `inactive` with an empty cage. The egg now sets its mob: both configs spawn only that mob (saved inline), the spawner's data resets and its state goes back to `inactive`. Fixes #3041. ## Vanilla reference `SpawnEggItem.useOn` → `TrialSpawnerBlockEntity.setEntityId` → `TrialSpawner.overrideEntityToSpawn`: `data.reset()`, `FullConfig.overrideEntity` (`TrialSpawnerConfig.withSpawning` on both configs, `Holder.direct`), `setState(INACTIVE)`. The inline config is written as `TrialSpawnerConfig.DIRECT_CODEC` writes it (fields at their default left out). Test: `a_spawn_egg_overrides_both_configs_inline`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 56f968e11, 2 min 53 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +130 −16 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 398 run, FAILED (failures=16, errors=8, skipped=1) (1 min 6 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (18 s) | | tests: horizon-client | ❌ 1093 passed, 2 failed (57 s) | | doc tests | ✅ 0 passed (18 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on Windows: `save::session_lock_is_exclusive`, `crash::stacks_start_at_the_panicking_frame` and the Python tests (they call `python3`, the Microsoft Store stub here) fail there and are unrelated. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:52 +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#4778
No description provided.