From f74d2fd5f4bf68dea276f4cc35b9d193c4932944 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Fri, 23 Oct 2026 20:05:12 +0200 Subject: [PATCH] Restore Guest::send_all and Behaviours::bone_meal_spreads: main builds again #1432 deleted both as unused; #1424 (level events) and #1425 (scoreboard) merged after it and call them, so horizon-client's binary failed with E0599 at level_particles.rs:54 and scoreboard.rs:338. Both functions come back unchanged from 4d7f30f14^1. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/lan/guest.rs | 5 +++++ crates/horizon-world/src/level/bonemeal.rs | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/crates/horizon-client/src/lan/guest.rs b/crates/horizon-client/src/lan/guest.rs index 652aec57e..84e768879 100644 --- a/crates/horizon-client/src/lan/guest.rs +++ b/crates/horizon-client/src/lan/guest.rs @@ -363,6 +363,11 @@ impl Guest { pub fn send(&self, packet: &play::Clientbound) { self.sender.send(packet.encode()); } + pub fn send_all(&self, packets: &[play::Clientbound]) { + for p in packets { + self.send(p); + } + } pub fn chunk(&self) -> (i32, i32) { ( (self.position[0].floor() as i32) >> 4, diff --git a/crates/horizon-world/src/level/bonemeal.rs b/crates/horizon-world/src/level/bonemeal.rs index ef52ca625..274512138 100644 --- a/crates/horizon-world/src/level/bonemeal.rs +++ b/crates/horizon-world/src/level/bonemeal.rs @@ -160,6 +160,16 @@ impl Behaviours { ) -> bool { self.sim(level, ticks).grow_water_plant(pos, face) } + /// The `BonemealableBlock.Type` particle spread of a block at level event + /// 1505: Some(true) for `NEIGHBOR_SPREADER` (particles over a 3-block + /// area above), Some(false) for `GROWER`, None when not bonemealable. + pub fn bone_meal_spreads(&self, state: BlockStateId) -> Option { + let kind = self.bonemeal_kind(state)?; + Some(matches!( + kind, + Kind::Grass | Kind::Nylium | Kind::Netherrack | Kind::FeaturePlacer + )) + } fn bonemeal_kind(&self, state: BlockStateId) -> Option { let data = self.data(state); if !data.implements(Interface::Bonemealable) {