[PR #7146] [MERGED] use_item_on: a placed jukebox keeps its record and has_record #7373

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7146
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: chore/use-item-on-jukebox-case


📝 Commits (1)

  • 6e6deab use_item_on: a placed jukebox keeps its record and has_record

📊 Changes

1 file changed (+20 additions, -0 deletions)

View changed files

📝 tools/test_use_item_on_parity.py (+20 -0)

📄 Description

Vanilla 26.3's JukeboxBlock.setPlacedBy reads the placed item's block_entity_data and sets HAS_RECORD when it carries a RecordItem, so a jukebox placed from a Creative pick with a disc inside keeps the disc and a right click hands it back.

The behaviour is already on main (BlockEntity::for_block makes the jukebox's block entity and Game::jukebox_placed sets the state); this PR only adds the harness case that pins it, which the parity suite lacked.

Proven:

  • python3 tools/parity.py use_item_on with the new jukebox_case (Creative jukebox item carrying block_entity_data with a record, placed on stone, dirt and grass) -> PASS use_item_on, 1 passed, 0 failed, probes built in 245s, harness 16s.
  • With the same case and the jukebox arms removed from BlockEntity::for_block and setPlacedBy, that harness failed: jukebox on stone: 36 differing (dirt 35, grass_block 23), vanilla ending on state 8633 (has_record=true) with inv 0,1,0 0 {count:1,id:"minecraft:music_disc_13"} and Horizon on 8634 (has_record=false) with no inventory line. So the case catches the regression it is meant to.

Not proven: nothing in a real client; the harness runs the game headlessly. The in-game check is the case itself: in Creative, Ctrl+pick a jukebox holding a disc, place it, and see the disc in the model and get it back on a right click.


🔄 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/7146 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `chore/use-item-on-jukebox-case` --- ### 📝 Commits (1) - [`6e6deab`](https://github.com/horizon-rust/horizon/commit/6e6deabda91c43deb01c60c9df68179d0fdfc07c) use_item_on: a placed jukebox keeps its record and has_record ### 📊 Changes **1 file changed** (+20 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tools/test_use_item_on_parity.py` (+20 -0) </details> ### 📄 Description Vanilla 26.3's `JukeboxBlock.setPlacedBy` reads the placed item's `block_entity_data` and sets `HAS_RECORD` when it carries a `RecordItem`, so a jukebox placed from a Creative pick with a disc inside keeps the disc and a right click hands it back. The behaviour is already on `main` (`BlockEntity::for_block` makes the jukebox's block entity and `Game::jukebox_placed` sets the state); this PR only adds the harness case that pins it, which the parity suite lacked. **Proven:** - `python3 tools/parity.py use_item_on` with the new `jukebox_case` (Creative jukebox item carrying `block_entity_data` with a record, placed on stone, dirt and grass) -> `PASS use_item_on`, `1 passed, 0 failed`, probes built in 245s, harness 16s. - With the same case and the jukebox arms removed from `BlockEntity::for_block` and `setPlacedBy`, that harness failed: `jukebox on stone: 36 differing` (dirt 35, grass_block 23), vanilla ending on state 8633 (`has_record=true`) with `inv 0,1,0 0 {count:1,id:"minecraft:music_disc_13"}` and Horizon on 8634 (`has_record=false`) with no inventory line. So the case catches the regression it is meant to. **Not proven:** nothing in a real client; the harness runs the game headlessly. The in-game check is the case itself: in Creative, Ctrl+pick a jukebox holding a disc, place it, and see the disc in the model and get it back on a right click. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:38:33 +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#7373
No description provided.