Merge pull request #2253 from kacpherek/fix/item-used-on-block-trigger

🤖 Agent: Read against the vanilla 26.3 sources (Fire item_used_on_block for block transforms, waxing, jukebox discs and vault keys) and proven in contrib-gate-21's union of 72 kacpherek PRs: 95 parity harnesses on playhorizon and the Mac mini, clippy, 1534 tests, lan_e2e 23 checks in-frame and with --server-thread. Thanks @kacpherek!
This commit is contained in:
Ludovic Marie
2026-10-27 11:35:01 +01:00
committed by GitHub
3 changed files with 8 additions and 0 deletions
+4
View File
@@ -9330,6 +9330,8 @@ impl Game<'_> {
else {
return Ok(false);
};
// BlockTransformer.transformBlock: ITEM_USED_ON_BLOCK before the swap.
self.trigger_block("minecraft:item_used_on_block", pos, stack);
self.level_set(pos, new)?;
// BlockTransformer.TransformParticle.send.
self.transform_particle(&particle, pos);
@@ -9602,6 +9604,8 @@ impl Game<'_> {
if let Some(waxed) = old.and_then(|old| self.res.transformers().waxed(registry, &old))
&& let Ok(state) = registry.resolve(&waxed)
{
// HoneycombItem.useOn: ITEM_USED_ON_BLOCK before the swap.
self.trigger_block("minecraft:item_used_on_block", hit.pos, stack);
self.level_set(hit.pos, state)?;
self.level_event_at(3003, hit.pos, 0);
self.audio.play(
@@ -91,6 +91,8 @@ impl Game<'_> {
self.set_has_record(pos, true);
self.start_song(pos, &song);
self.jukebox_changed(pos);
// ServerPlayerGameMode.useItemOn: the action was consumed.
self.trigger_block("minecraft:item_used_on_block", pos, stack);
true
}
/// Level event 1010: the song from the jukebox, and the "Now Playing" overlay.
+2
View File
@@ -169,6 +169,8 @@ impl Game<'_> {
self.consume_held();
}
}
// ServerPlayerGameMode.useItemOn: the action was consumed.
self.trigger_block("minecraft:item_used_on_block", pos, &stack);
Ok(true)
}
fn vault_events(&mut self, key: Pos, events: Vec<VaultEvent>) -> Result<()> {