[PR #433] [MERGED] Give trial chamber pots their loot, sherds and insertion #2562

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

📋 Pull Request Information

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

Base: main ← Head: feat/trial-pots


📝 Commits (5)

  • 2567a4a Add the vault's server logic with a parity harness
  • 2c07b5e Wire vaults into the game
  • 3ac3efe Save round-trip: a vault's next state update moves with the clock
  • ed54271 Show trial spawner and vault visuals
  • c4f915c Give trial chamber pots their loot, sherds and insertion

📊 Changes

20 files changed (+2248 additions, -55 deletions)

View changed files

📝 crates/horizon-client/examples/natural_spawn_fixture.rs (+201 -2)
📝 crates/horizon-client/src/containers.rs (+9 -0)
📝 crates/horizon-client/src/game.rs (+24 -0)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+27 -9)
➕ crates/horizon-client/src/game/decorated_pot.rs (+152 -0)
📝 crates/horizon-client/src/game/spawner.rs (+29 -12)
📝 crates/horizon-client/src/game/spill.rs (+33 -0)
📝 crates/horizon-client/src/game/trial_spawner.rs (+28 -15)
➕ crates/horizon-client/src/game/trial_visuals.rs (+333 -0)
➕ crates/horizon-client/src/game/vault.rs (+242 -0)
📝 crates/horizon-client/src/lib.rs (+1 -0)
📝 crates/horizon-client/src/mobs/spawner.rs (+15 -10)
📝 crates/horizon-client/src/save.rs (+2 -0)
📝 crates/horizon-client/src/structure_blocks.rs (+3 -0)
📝 crates/horizon-client/src/vanillagen.rs (+32 -0)
➕ crates/horizon-client/src/vault.rs (+771 -0)
📝 crates/horizon-world/src/loot.rs (+14 -3)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaNaturalSpawnOracle.java (+105 -3)
📝 tools/test_save_roundtrip_parity.py (+2 -1)
➕ tools/test_vault_parity.py (+225 -0)

📄 Description

Part of #223. Stack: #410 → #417 → #422 → this one (based on feat/trial-visuals) → #439.

Trial chamber pots were empty: generated chunks dropped the NBT of every block entity Horizon doesn't model, so a pot lost its LootTable (and its sherds) as soon as its chunk was generated.

  • Generated block entities kept: vanillagen now keeps the unmodelled block entities (decorated pots, brushable blocks) in the chunk's saved block entities, as a loaded chunk already does.
  • Loot unpacked (RandomizableContainer.unpackLootTable): the first time the pot's item is read (broken, or used), its table fills its one slot and is removed. The roll draws from LootTableSeed, else the table's random sequence, else the level random, as LootContext.Builder.create does. LootData::fill_with is fill drawing from any random.
  • Sherds render from the saved block entity (the flow, guster and scrape pots).
  • Insertion: DecoratedPotBlock.useItemOn (a matching or first item goes in: wobble, decorated_pot.insert with its pitch, the dust plume, the block_change game event, the item-used stat) and useWithoutItem (refused: insert_fail and the negative wobble). A hand-placed pot gets its block entity record on first use.

Verified in game (offscreen, seed 12345, fresh world, trial chamber at 137 -24 -537):

  • breaking corridor pots dropped their loot (4 arrows; 2 arrows; 2 iron ingots);
  • a diamond and an emerald were refused by pots holding other items;
  • 2 emeralds inserted into a placed pot in survival left the inventory and dropped back when it broke;
  • the scrape pot shows its pattern.

No new harness: the loot roll reuses the chest fill path (now fill_with). The pot loot tables have one pool and one slot, so no split or shuffle draws. The rest is block behaviour checked in game.

Self-check: fmt, clippy -D warnings (horizon-client, horizon-world), cargo test -p horizon-client (700 lib + integration) pass.

🤖 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/433 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/trial-pots` --- ### 📝 Commits (5) - [`2567a4a`](https://github.com/horizon-rust/horizon/commit/2567a4a41aaeb13318756d2deba5331d81f61d63) Add the vault's server logic with a parity harness - [`2c07b5e`](https://github.com/horizon-rust/horizon/commit/2c07b5e621805ec33cdc198615be7a25c0a7742f) Wire vaults into the game - [`3ac3efe`](https://github.com/horizon-rust/horizon/commit/3ac3efe749c8d7cba9a1b768d070290a81d33606) Save round-trip: a vault's next state update moves with the clock - [`ed54271`](https://github.com/horizon-rust/horizon/commit/ed5427197f78d0118a81a712d79069d210c3cffd) Show trial spawner and vault visuals - [`c4f915c`](https://github.com/horizon-rust/horizon/commit/c4f915c9d121c75985549145db9f6fd8ce07afe5) Give trial chamber pots their loot, sherds and insertion ### 📊 Changes **20 files changed** (+2248 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/natural_spawn_fixture.rs` (+201 -2) 📝 `crates/horizon-client/src/containers.rs` (+9 -0) 📝 `crates/horizon-client/src/game.rs` (+24 -0) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+27 -9) ➕ `crates/horizon-client/src/game/decorated_pot.rs` (+152 -0) 📝 `crates/horizon-client/src/game/spawner.rs` (+29 -12) 📝 `crates/horizon-client/src/game/spill.rs` (+33 -0) 📝 `crates/horizon-client/src/game/trial_spawner.rs` (+28 -15) ➕ `crates/horizon-client/src/game/trial_visuals.rs` (+333 -0) ➕ `crates/horizon-client/src/game/vault.rs` (+242 -0) 📝 `crates/horizon-client/src/lib.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs/spawner.rs` (+15 -10) 📝 `crates/horizon-client/src/save.rs` (+2 -0) 📝 `crates/horizon-client/src/structure_blocks.rs` (+3 -0) 📝 `crates/horizon-client/src/vanillagen.rs` (+32 -0) ➕ `crates/horizon-client/src/vault.rs` (+771 -0) 📝 `crates/horizon-world/src/loot.rs` (+14 -3) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaNaturalSpawnOracle.java` (+105 -3) 📝 `tools/test_save_roundtrip_parity.py` (+2 -1) ➕ `tools/test_vault_parity.py` (+225 -0) </details> ### 📄 Description Part of #223. Stack: #410 → #417 → #422 → this one (based on `feat/trial-visuals`) → #439. Trial chamber pots were empty: generated chunks dropped the NBT of every block entity Horizon doesn't model, so a pot lost its `LootTable` (and its sherds) as soon as its chunk was generated. - **Generated block entities kept**: `vanillagen` now keeps the unmodelled block entities (decorated pots, brushable blocks) in the chunk's saved block entities, as a loaded chunk already does. - **Loot unpacked** (`RandomizableContainer.unpackLootTable`): the first time the pot's item is read (broken, or used), its table fills its one slot and is removed. The roll draws from `LootTableSeed`, else the table's random sequence, else the level random, as `LootContext.Builder.create` does. `LootData::fill_with` is `fill` drawing from any random. - **Sherds** render from the saved block entity (the flow, guster and scrape pots). - **Insertion**: `DecoratedPotBlock.useItemOn` (a matching or first item goes in: wobble, `decorated_pot.insert` with its pitch, the dust plume, the block_change game event, the item-used stat) and `useWithoutItem` (refused: `insert_fail` and the negative wobble). A hand-placed pot gets its block entity record on first use. Verified in game (offscreen, seed 12345, fresh world, trial chamber at 137 -24 -537): - breaking corridor pots dropped their loot (4 arrows; 2 arrows; 2 iron ingots); - a diamond and an emerald were refused by pots holding other items; - 2 emeralds inserted into a placed pot in survival left the inventory and dropped back when it broke; - the scrape pot shows its pattern. No new harness: the loot roll reuses the chest `fill` path (now `fill_with`). The pot loot tables have one pool and one slot, so no split or shuffle draws. The rest is block behaviour checked in game. Self-check: fmt, clippy `-D warnings` (horizon-client, horizon-world), `cargo test -p horizon-client` (700 lib + integration) pass. 🤖 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:57:13 +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#2562
No description provided.