[PR #5032] [MERGED] feat: place flowers and plants in flower pots (#4844) #6015

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5032
Author: @Sticky-Bug
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/flower-pot-plant


📝 Commits (3)

  • 06f4fe1 feat: place flowers and plants in flower pots (#4844)
  • 9dba250 Merge main: the pot answers through useItemOn's branch, and the generic arm fires item_used_on_block
  • 06d1db6 Merge remote-tracking branch 'origin/main' into feat/flower-pot-plant

📊 Changes

7 files changed (+133 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+11 -0)
📝 crates/horizon-world/src/level/data.rs (+19 -0)
📝 crates/horizon-world/src/level/data/cache.rs (+2 -0)
📝 crates/horizon-world/src/level/interact.rs (+45 -0)
📝 crates/horizon-world/src/level/mod.rs (+6 -0)
📝 crates/horizon-world/src/level/tests.rs (+47 -1)
📝 tools/port_map/game2-013.tsv (+3 -3)

📄 Description

Fixes #4844

What and why

Right-clicking an empty flower pot with a flower, sapling, mushroom, or other plant item now places it into the pot matching vanilla FlowerPotBlock.useItemOn:

  • Constructs and caches potted_by_content in Behaviours for all 39 minecraft:potted_* blocks.
  • On placing a plant into an empty pot: transitions the block to the corresponding potted state, emits minecraft:block_change, consumes 1 item, increments the pot_flower custom stat, and triggers item_used_on_block criteria.
  • Right-clicking a potted flower pot with another plant returns InteractionResult::Consume.
  • Updates tools/port_map/game2-013.tsv.
  • Adds unit tests covering multiple plants, saplings, mushrooms, and interaction edge cases.

Self-check

  • cargo fmt -- --check passes
  • cargo clippy -p horizon-world -p horizon-client --lib -- -D warnings passes
  • cargo test -p horizon-world --lib flowers_and_saplings_can_be_placed_in_flower_pots passes

🔄 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/5032 **Author:** [@Sticky-Bug](https://github.com/Sticky-Bug) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/flower-pot-plant` --- ### 📝 Commits (3) - [`06f4fe1`](https://github.com/horizon-rust/horizon/commit/06f4fe173c8728ad331d7e73a8265a810d4d668d) feat: place flowers and plants in flower pots (#4844) - [`9dba250`](https://github.com/horizon-rust/horizon/commit/9dba2508fa02bdaef44e030eead1f558bb7ce78d) Merge main: the pot answers through useItemOn's branch, and the generic arm fires item_used_on_block - [`06d1db6`](https://github.com/horizon-rust/horizon/commit/06d1db6295caf1f93f79b4811ce62f5e59b38806) Merge remote-tracking branch 'origin/main' into feat/flower-pot-plant ### 📊 Changes **7 files changed** (+133 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+11 -0) 📝 `crates/horizon-world/src/level/data.rs` (+19 -0) 📝 `crates/horizon-world/src/level/data/cache.rs` (+2 -0) 📝 `crates/horizon-world/src/level/interact.rs` (+45 -0) 📝 `crates/horizon-world/src/level/mod.rs` (+6 -0) 📝 `crates/horizon-world/src/level/tests.rs` (+47 -1) 📝 `tools/port_map/game2-013.tsv` (+3 -3) </details> ### 📄 Description Fixes #4844 ### What and why Right-clicking an empty flower pot with a flower, sapling, mushroom, or other plant item now places it into the pot matching vanilla `FlowerPotBlock.useItemOn`: - Constructs and caches `potted_by_content` in `Behaviours` for all 39 `minecraft:potted_*` blocks. - On placing a plant into an empty pot: transitions the block to the corresponding potted state, emits `minecraft:block_change`, consumes 1 item, increments the `pot_flower` custom stat, and triggers `item_used_on_block` criteria. - Right-clicking a potted flower pot with another plant returns `InteractionResult::Consume`. - Updates `tools/port_map/game2-013.tsv`. - Adds unit tests covering multiple plants, saplings, mushrooms, and interaction edge cases. ### Self-check - `cargo fmt -- --check` passes - `cargo clippy -p horizon-world -p horizon-client --lib -- -D warnings` passes - `cargo test -p horizon-world --lib flowers_and_saplings_can_be_placed_in_flower_pots` passes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:38 +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#6015
No description provided.