[PR #1081] [MERGED] Shears carve pumpkins (PumpkinBlock.useItemOn) #3030

Closed
opened 2026-11-02 16:00:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: fix/shears-carve-pumpkin


📝 Commits (1)

  • 8186bab Shears carve pumpkins (PumpkinBlock.useItemOn)

📊 Changes

7 files changed (+176 additions, -34 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/dispense_fixture.rs (+17 -6)
📝 crates/horizon-client/src/game/dispenser.rs (+1 -14)
📝 crates/horizon-client/src/game/golems.rs (+18 -0)
➕ crates/horizon-client/src/game/pumpkin.rs (+88 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaDispenserOracle.java (+7 -3)
📝 tools/test_use_item_on_parity.py (+40 -11)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Fixes #1067. Reported by Tydragon on Discord: thanks!

What

Using shears on a pumpkin now carves it, as vanilla's PumpkinBlock.useItemOn does:

  • 4 pumpkin seeds from the minecraft:carve/pumpkin loot table (its own random sequence) drop as an item at the carved face (pos + 0.5 + dir * 0.65, y + 0.1), with vanilla's velocity drawn from the level random and no pickup delay.
  • block.pumpkin.carve, then carved_pumpkin facing the clicked side (towards the player when the top or bottom is clicked), the shears lose 1 durability, game event minecraft:shear, the used:minecraft:shears stat and the item_used_on_block trigger.
  • The carved head goes through the golem check like a placed one, so carving the head of a snow or iron golem frame spawns the golem (set_golem_head, shared with the dispenser's carved pumpkin).

How

  • game/pumpkin.rs: the use, called from use_hand after the decorated pot.
  • game/golems.rs: set_golem_head; dispenser.rs uses it.
  • Harness: tools/test_use_item_on_parity.py gains pumpkin cases (pumpkin, carved pumpkin or melon, shears at several damage levels, main or off hand, any yaw and face). The use fixture and the oracle take an optional yaw and face.

Proof

Run on one integration commit holding all five B3 branches, rebased on origin/main 85f65a69, on the Mac mini:

cargo fmt --all --check                                         ok
set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings   exit 0, 0 errors
cargo test -p horizon-client                                    1052 passed, 0 failed
  • tools/test_use_item_on_parity.py on this branch: 4000/4000 cases match, 133 of them carvings. Without the use_pumpkin hook, those 133 differ. In the integration run, every case except #1052's new obstruction cases matched.

tools/parity.py --changed origin/main: this branch changes game.rs, so it selects all 325 harnesses. Today's Mac mini (load ~70 from other agents' parity runs) couldn't finish the main baseline within the 2 h job limit; it was still building probes. CI's parity job runs the same --changed selection for this PR on the runner. Known failure on main: mob_ai drowned_* (#290).

Needs Ludovic

Nothing. Not included: shearing beehives by hand (BeehiveBlock.useItemOn; only dispensers do it). It's noted under LATER in the parity notes.

🤖 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/1081 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/shears-carve-pumpkin` --- ### 📝 Commits (1) - [`8186bab`](https://github.com/horizon-rust/horizon/commit/8186baba8b8c3e0b33e59ebdef1d7e110018d987) Shears carve pumpkins (PumpkinBlock.useItemOn) ### 📊 Changes **7 files changed** (+176 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/dispense_fixture.rs` (+17 -6) 📝 `crates/horizon-client/src/game/dispenser.rs` (+1 -14) 📝 `crates/horizon-client/src/game/golems.rs` (+18 -0) ➕ `crates/horizon-client/src/game/pumpkin.rs` (+88 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaDispenserOracle.java` (+7 -3) 📝 `tools/test_use_item_on_parity.py` (+40 -11) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1067. Reported by **Tydragon** on Discord: thanks! ## What Using shears on a pumpkin now carves it, as vanilla's `PumpkinBlock.useItemOn` does: - 4 pumpkin seeds from the `minecraft:carve/pumpkin` loot table (its own random sequence) drop as an item at the carved face (`pos + 0.5 + dir * 0.65`, `y + 0.1`), with vanilla's velocity drawn from the level random and no pickup delay. - `block.pumpkin.carve`, then `carved_pumpkin` facing the clicked side (towards the player when the top or bottom is clicked), the shears lose 1 durability, game event `minecraft:shear`, the `used:minecraft:shears` stat and the `item_used_on_block` trigger. - The carved head goes through the golem check like a placed one, so carving the head of a snow or iron golem frame spawns the golem (`set_golem_head`, shared with the dispenser's carved pumpkin). ## How - `game/pumpkin.rs`: the use, called from `use_hand` after the decorated pot. - `game/golems.rs`: `set_golem_head`; `dispenser.rs` uses it. - Harness: `tools/test_use_item_on_parity.py` gains pumpkin cases (pumpkin, carved pumpkin or melon, shears at several damage levels, main or off hand, any yaw and face). The use fixture and the oracle take an optional `yaw` and `face`. ## Proof Run on one integration commit holding all five B3 branches, rebased on origin/main `85f65a69`, on the Mac mini: ``` cargo fmt --all --check ok set -o pipefail; cargo clippy --workspace --all-targets -- -D warnings exit 0, 0 errors cargo test -p horizon-client 1052 passed, 0 failed ``` - `tools/test_use_item_on_parity.py` on this branch: **4000/4000** cases match, 133 of them carvings. Without the `use_pumpkin` hook, those 133 differ. In the integration run, every case except #1052's new obstruction cases matched. `tools/parity.py --changed origin/main`: this branch changes `game.rs`, so it selects all 325 harnesses. Today's Mac mini (load ~70 from other agents' parity runs) couldn't finish the main baseline within the 2 h job limit; it was still building probes. CI's parity job runs the same `--changed` selection for this PR on the runner. Known failure on main: mob_ai drowned_* (#290). ## Needs Ludovic Nothing. Not included: shearing beehives by hand (`BeehiveBlock.useItemOn`; only dispensers do it). It's noted under LATER in the parity notes. 🤖 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 16:00:55 +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#3030
No description provided.