From 3b586ff9038e97bb475973552edfc31b3a857c7e Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 05:48:29 +0100 Subject: [PATCH] Server players: one helper finishes a landing's block updates, turtle eggs too The server's player tick dropped FallEvent::Destroy, so an egg a guest broke by landing left its neighbours unupdated. Both paths now share the same helper. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game.rs | 32 +++++++++---------- crates/horizon-client/src/game/lan_actions.rs | 11 +------ 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index e25732bdd..a42efebdc 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -4046,6 +4046,20 @@ impl Game<'_> { self.capture_loaded_world(); Ok(()) } + /// Landing rules (farmland trampling, turtle eggs) wrote or removed the block + /// raw: finish `Level.setBlock`'s neighbour updates, so a crop on trampled + /// farmland breaks. The local player's and every server player's landings. + fn landing_block_updates(&mut self, event: &horizon_client::landing::FallEvent) { + use horizon_client::landing::FallEvent; + let (position, flags) = match *event { + FallEvent::Write { + position, flags, .. + } => (position, flags as i32), + FallEvent::Destroy { position, .. } => (position, level_flags::UPDATE_ALL), + _ => return, + }; + self.with_level(|b, level, ticks| b.notify_written(level, ticks, position, flags)); + } fn tick(&mut self) -> Result<()> { self.tick_debug_keys()?; self.tick_debug_charts(); @@ -4260,23 +4274,7 @@ impl Game<'_> { }; self.audio.play(name, Some(feet), volume, pitch); } - MotionEvent::Fall(horizon_client::landing::FallEvent::Write { - position, - flags, - .. - }) => { - // Landing rules (farmland trampling, turtle eggs) wrote the block raw. - self.with_level(|b, level, ticks| { - b.notify_written(level, ticks, position, flags as i32) - }); - } - MotionEvent::Fall(horizon_client::landing::FallEvent::Destroy { - position, .. - }) => { - self.with_level(|b, level, ticks| { - b.notify_written(level, ticks, position, level_flags::UPDATE_ALL) - }); - } + MotionEvent::Fall(event) => self.landing_block_updates(&event), MotionEvent::Snowflake { position, velocity } => self.snowflake(position, velocity), MotionEvent::EnterBlock { state } => self.trigger_enter_block(state), MotionEvent::InsidePortal { pos } => self.player_inside_nether_portal(pos), diff --git a/crates/horizon-client/src/game/lan_actions.rs b/crates/horizon-client/src/game/lan_actions.rs index 21cb7dcf4..d0f16a0d6 100644 --- a/crates/horizon-client/src/game/lan_actions.rs +++ b/crates/horizon-client/src/game/lan_actions.rs @@ -2044,16 +2044,7 @@ impl Game<'_> { for event in events { match event { MotionEvent::HurtSound(sound) => self.player_hurt_sound(sound, at), - MotionEvent::Fall(horizon_client::landing::FallEvent::Write { - position, - flags, - .. - }) => { - // Landing wrote the raw state: finish Level.setBlock's neighbour updates. - self.with_level(|b, level, ticks| { - b.notify_written(level, ticks, position, flags as i32) - }); - } + MotionEvent::Fall(event) => self.landing_block_updates(&event), _ => {} } }