From 282556870fd2a56e8819f94c2638e7e1f37c39db Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:34:55 +0100 Subject: [PATCH] Cushions: pass when occupied, burn when placed in fire, entity_place Checked against the 26.3 bytecode (tools/rea_vanilla.py): - Cushion.interact passes (PASS) when the cushion already has a rider; CONSUME is only for a startRiding that fails. - CushionItem.useOn calls destroyIfInFire right after addFreshEntity, and posts GameEvent.ENTITY_PLACE from the player. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/cushions.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/crates/horizon-client/src/game/cushions.rs b/crates/horizon-client/src/game/cushions.rs index 501a8028d..0847321d6 100644 --- a/crates/horizon-client/src/game/cushions.rs +++ b/crates/horizon-client/src/game/cushions.rs @@ -89,6 +89,8 @@ impl horizon_client::cushion::World for PlacementWorld<'_, '_> { { false } + // ShulkerBoxBlock: suffocating while closed; a box seen open + // here is rare enough to count as closed. _ if name.ends_with("shulker_box") => true, _ => { facts.full_collision @@ -234,12 +236,23 @@ impl Game<'_> { self.world .modified .insert((attached[0] >> 4, attached[2] >> 4)); + // `destroyIfInFire`: placed into fire, it breaks at once. + let placed = self.cushions.len() - 1; + if self.cushion_in_fire(&self.cushions[placed]) { + self.break_cushion(placed, false); + } self.audio.play( "minecraft:entity.cushion.place", Some([position.x, position.y, position.z]), 0.75, 0.8, ); + let ctx = self.who_context(Some(horizon_client::mobs::Who::Player), None); + self.post_game_event( + "minecraft:entity_place", + [position.x, position.y, position.z], + ctx, + ); if !self.creative { self.consume_held(); } @@ -264,10 +277,9 @@ impl Game<'_> { .lan .as_ref() .is_some_and(|h| h.hub.guests.iter().any(|g| g.vehicle == Some(id))); - // `Cushion.interact`: a vehicle it cannot seat returns CONSUME. + // `Cushion.interact`: an occupied cushion (`isVehicle`) passes. if occupied { - self.swing_arm(); - return true; + return false; } // `Player.startRiding` gives up the vehicle it already has; the // client never sends that click, so pass instead.