From a83d6f33bea6bd2fc00197580b148edd3eaad3c8 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 26 Oct 2026 14:31:50 +0100 Subject: [PATCH] Campfire: a full campfire's use does not swing the arm CampfireBlock.useItemOn returns SUCCESS_SERVER (a swing) only when placeFood took the item, and CONSUME (no swing) when all four slots are taken. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game.rs | 5 +++-- crates/horizon-client/src/game/campfire.rs | 17 +++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 702a26025..c58b01024 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -8666,9 +8666,10 @@ impl Game<'_> { } if allow_block_actions && let Some(hit) = self.pick() - && self.use_on_campfire(hit.pos)? + && let Some(placed) = self.use_on_campfire(hit.pos)? { - return Ok(UseResult::Success { swing: true }); + // SUCCESS_SERVER swings; a full campfire's CONSUME does not. + return Ok(UseResult::Success { swing: placed }); } // BucketItem has no useOn: a guest's UseItemOn leaves it to UseItem. let bucket = horizon_client::items::bucket_contents(&stack.item); diff --git a/crates/horizon-client/src/game/campfire.rs b/crates/horizon-client/src/game/campfire.rs index 100675c30..c388b7561 100644 --- a/crates/horizon-client/src/game/campfire.rs +++ b/crates/horizon-client/src/game/campfire.rs @@ -22,21 +22,22 @@ impl Game<'_> { /// input (`RecipePropertySet.CAMPFIRE_INPUT`): on a server level the food /// goes into the first free slot (`placeFood`), and the use is consumed /// whether or not there was room. A client of a server leaves the placing - /// to the server. False when this isn't a campfire use, so the item's own - /// use runs. - pub(super) fn use_on_campfire(&mut self, pos: [i32; 3]) -> Result { + /// to the server. Whether the food went in; None when this isn't a + /// campfire use, so the item's own use runs. + pub(super) fn use_on_campfire(&mut self, pos: [i32; 3]) -> Result> { let state = self.world.block(pos[0], pos[1], pos[2]); if !is_campfire(&self.res.facts().get(state).name) { - return Ok(false); + return Ok(None); } let Some(held) = self.held().cloned() else { - return Ok(false); + return Ok(None); }; let Some(time) = self.res.recipes().cook(KIND, &held).map(|r| r.time as i32) else { - return Ok(false); + return Ok(None); }; + // A client of a server predicts the placing; the server decides. if self.remote.is_some() { - return Ok(true); + return Ok(Some(true)); } let key = (pos[0], pos[1], pos[2]); let placed = match self.world.block_entities.get_mut(&key) { @@ -58,7 +59,7 @@ impl Game<'_> { ); self.mark_block_entity_updated(key); } - Ok(true) + Ok(Some(placed)) } /// `CampfireBlockEntity.cookTick` of a lit campfire, `cooldownTick` of an