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 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-23 20:05:12 +02:00
parent 8a4ebcc553
commit f74d2fd5f4
2 changed files with 15 additions and 0 deletions
+5
View File
@@ -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,
@@ -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<bool> {
let kind = self.bonemeal_kind(state)?;
Some(matches!(
kind,
Kind::Grass | Kind::Nylium | Kind::Netherrack | Kind::FeaturePlacer
))
}
fn bonemeal_kind(&self, state: BlockStateId) -> Option<Kind> {
let data = self.data(state);
if !data.implements(Interface::Bonemealable) {