From 79c3896449584da2309eea8db8aad12d8e949eda Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 19:13:58 +0100 Subject: [PATCH 1/4] Respawn on a free column within the respawn radius around the world spawn --- crates/horizon-client/src/game.rs | 17 +++-- crates/horizon-client/src/game/end.rs | 10 ++- .../horizon-client/src/game/initial_spawn.rs | 69 +++++++++++++------ crates/horizon-client/src/game/lan_actions.rs | 8 +++ .../horizon-client/src/game/server_travel.rs | 37 +++++++++- 5 files changed, 110 insertions(+), 31 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 8448f0837..2d853cbe5 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -4253,11 +4253,18 @@ impl Game<'_> { if !(-1..=1).all(|dz| (-1..=1).all(|dx| self.streaming.is_lit(cx + dx, cz + dz))) { return Ok(()); } - // WorldSpawn: the stored column, lifted onto its current surface. - let y = self - .land_column(s.x.floor() as i32, s.z.floor() as i32) - .map_or(s.y, f64::from); - Vec3::new(s.x, y.max(s.y), s.z) + let column = [s.x.floor() as i32, s.y.floor() as i32, s.z.floor() as i32]; + if self.level.world_spawn == Some(column) { + // TeleportTransition.missingRespawnBlock: PlayerSpawnFinder + // around the world spawn, not its exact column. + self.respawn_spawn(column) + } else { + // A spawnpoint: the stored column, lifted onto its current surface. + let y = self + .land_column(column[0], column[2]) + .map_or(s.y, f64::from); + Vec3::new(s.x, y.max(s.y), s.z) + } }; let mut player = PlayerMotion::new(self.motion, feet)?; player.yaw = self.yaw; diff --git a/crates/horizon-client/src/game/end.rs b/crates/horizon-client/src/game/end.rs index 32d5113b0..f11d4a61c 100644 --- a/crates/horizon-client/src/game/end.rs +++ b/crates/horizon-client/src/game/end.rs @@ -578,9 +578,13 @@ impl Game<'_> { let s = self.level.spawn.unwrap_or([0.0, 64.0, 0.0]); target = Vec3::new(s[0].floor() + 0.5, s[1], s[2].floor() + 0.5); } - let y = self - .land_column(target.x.floor() as i32, target.z.floor() as i32) - .map_or(target.y, f64::from); + let (x, z) = (target.x.floor() as i32, target.z.floor() as i32); + // TeleportTransition.missingRespawnBlock: PlayerSpawnFinder around + // the world spawn. + if let Some(world) = self.level.world_spawn.filter(|w| w[0] == x && w[2] == z) { + return Ok((self.respawn_spawn(world), None)); + } + let y = self.land_column(x, z).map_or(target.y, f64::from); Ok((Vec3::new(target.x, y, target.z), None)) } diff --git a/crates/horizon-client/src/game/initial_spawn.rs b/crates/horizon-client/src/game/initial_spawn.rs index 3f7a071bb..bcea90337 100644 --- a/crates/horizon-client/src/game/initial_spawn.rs +++ b/crates/horizon-client/src/game/initial_spawn.rs @@ -121,33 +121,58 @@ impl Game<'_> { } Ok(Some([ox * 16 + 8, height, oz * 16 + 8])) } + /// PlayerSpawnFinder.findSpawn: the finder for a suggestion, its radius + /// the respawn radius cut to the world border. + fn spawn_finder(&self, suggestion: [i32; 3]) -> PlayerSpawnFinder { + if self.level.game_mode == 2 { + // Adventure mode: the suggestion itself. + let mut finder = PlayerSpawnFinder::new(suggestion, 0, |_| 0); + finder.next_candidate(); + return finder; + } + let mut radius = self.ui.rules.int("respawn_radius").max(0); + let to_border = self + .border + .distance(f64::from(suggestion[0]), f64::from(suggestion[2])) + .floor() as i32; + if to_border < radius { + radius = to_border; + } + if to_border <= 1 { + radius = 1; + } + PlayerSpawnFinder::new(suggestion, radius, |n| { + entity_random().next_int_bound(n).unwrap_or(0) + }) + } + /// PlayerSpawnFinder.findSpawn around the world spawn for a player placed + /// at once (TeleportTransition.createDefault and missingRespawnBlock): the + /// first free column within the respawn radius, the suggestion's own + /// column when none is. A candidate whose chunk is not loaded counts as + /// not free; the suggestion's chunk must be. + pub(super) fn respawn_spawn(&self, suggestion: [i32; 3]) -> Vec3 { + let mut finder = self.spawn_finder(suggestion); + while let Some(candidate) = finder.next_candidate() { + let SpawnCandidate::Column(x, z) = candidate else { + break; + }; + if !self.streaming.is_lit(x >> 4, z >> 4) { + continue; + } + if let Some(pos) = level_respawn_pos(&self.spawn_columns(), x, z) + && self.player_fits(pos) + { + return bottom_center(pos); + } + } + self.fixup_spawn_height(suggestion) + } /// PlayerSpawnFinder.findSpawn around the world spawn: the feet of a /// player who has no position yet. None while a candidate's chunk loads. pub(super) fn find_player_spawn(&mut self, suggestion: [i32; 3]) -> Result> { let mut finder = match self.player_spawn { Some(finder) => finder, - None if self.level.game_mode == 2 => { - // Adventure mode: the suggestion itself. - let mut finder = PlayerSpawnFinder::new(suggestion, 0, |_| 0); - finder.next_candidate(); - finder - } - None => { - let mut radius = self.ui.rules.int("respawn_radius").max(0); - let to_border = self - .border - .distance(f64::from(suggestion[0]), f64::from(suggestion[2])) - .floor() as i32; - if to_border < radius { - radius = to_border; - } - if to_border <= 1 { - radius = 1; - } - PlayerSpawnFinder::new(suggestion, radius, |n| { - entity_random().next_int_bound(n).unwrap_or(0) - }) - } + None => self.spawn_finder(suggestion), }; let found = loop { let Some(candidate) = finder.next_candidate() else { diff --git a/crates/horizon-client/src/game/lan_actions.rs b/crates/horizon-client/src/game/lan_actions.rs index 43bb573dc..dcb3c8919 100644 --- a/crates/horizon-client/src/game/lan_actions.rs +++ b/crates/horizon-client/src/game/lan_actions.rs @@ -1853,6 +1853,10 @@ impl Game<'_> { } if let Some(config) = elsewhere { self.respawn_trip(conn, config); + } else if in_frame_bed.is_none() && host.hub.guests[i].spawn.is_none() { + // TeleportTransition.createDefault: no point of its own, so the + // world spawn's free column once its chunks have loaded. + self.world_spawn_trip(conn); } if let Some(c) = in_frame_bed && self.dim == super::Dim::Overworld @@ -1871,6 +1875,10 @@ impl Game<'_> { host.hub.guests[i].yaw = yaw; [at.x, at.y, at.z] }); + if found.is_none() { + // TeleportTransition.missingRespawnBlock. + self.world_spawn_trip(conn); + } host.hub.teleport(i, Some(at)); } if away && let Err(e) = self.enter_level(Some(host), back) { diff --git a/crates/horizon-client/src/game/server_travel.rs b/crates/horizon-client/src/game/server_travel.rs index bcaf37a76..e22cd60e9 100644 --- a/crates/horizon-client/src/game/server_travel.rs +++ b/crates/horizon-client/src/game/server_travel.rs @@ -31,6 +31,9 @@ pub(super) struct Trip { /// A respawn at this point outside the Overworld, resolved through its /// block on arrival. respawn: Option, + /// A respawn at the world spawn, moved onto a free column within the + /// respawn radius once the chunks around it have loaded. + world_spawn: bool, /// Sent by a command: the player is already where it goes. placed: bool, } @@ -66,10 +69,11 @@ impl Game<'_> { /// in it (Nether portals count up their transition time, End portals /// take them at once). pub(super) fn tick_server_travel(&mut self, host: &mut LanHost) { + // Outside a server only the respawns at the world spawn wait for chunks. + self.arrive_server_trips(host); if self.options.dedicated.is_none() { return; } - self.arrive_server_trips(host); let conns: Vec = host .hub .guests @@ -253,6 +257,7 @@ impl Game<'_> { plan, gateway: None, respawn: None, + world_spawn: false, placed: false, }); if let Err(e) = self.enter_level(Some(host), source) { @@ -272,6 +277,7 @@ impl Game<'_> { plan: None, gateway: None, respawn: Some(config), + world_spawn: false, placed: false, }); } @@ -304,6 +310,27 @@ impl Game<'_> { } } + /// TeleportTransition.createDefault and missingRespawnBlock: the player + /// waits at the world spawn for its chunks, then PlayerSpawnFinder puts + /// it on a free column within the respawn radius. + pub(super) fn world_spawn_trip(&mut self, conn: u32) { + let Some([x, y, z]) = self.level.world_spawn else { + return; + }; + self.server_trips.retain(|t| !t.is(conn)); + self.server_trips.push(Trip { + conn, + dim: Dim::Overworld, + target: Vec3::new(f64::from(x) + 0.5, f64::from(y), f64::from(z) + 0.5), + end: false, + plan: None, + gateway: None, + respawn: None, + world_spawn: true, + placed: false, + }); + } + /// TeleportTransition.missingRespawnBlock: the world spawn, in the /// Overworld. fn respawn_at_world_spawn(&mut self, host: &mut LanHost, conn: u32) { @@ -318,6 +345,7 @@ impl Game<'_> { rotation: None, }); self.run_level_teleports(host); + self.world_spawn_trip(conn); } /// `TheEndGatewayBlockEntity.getPortalPosition` and the teleport within @@ -343,6 +371,7 @@ impl Game<'_> { plan: None, gateway: Some(job), respawn: None, + world_spawn: false, placed: false, }); } @@ -383,6 +412,11 @@ impl Game<'_> { continue; } } + } else if trip.world_spawn { + // PlayerSpawnFinder.findSpawn around the world spawn. + let suggestion = + [trip.target.x, trip.target.y, trip.target.z].map(|v| v.floor() as i32); + (self.respawn_spawn(suggestion), yaw) } else if let Some(job) = trip.gateway { match self.resolve_gateway(job, trip.target) { Ok(at) => (at, yaw), @@ -458,6 +492,7 @@ impl Game<'_> { plan: None, gateway: None, respawn: None, + world_spawn: false, placed: true, }); if let Err(e) = self.enter_level(Some(host), source) { From 2d70e55fbbffeb5c8b7105ca970a22d195332ef5 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Mon, 26 Oct 2026 21:21:42 +0100 Subject: [PATCH 2/4] Load the respawn search's candidate chunks instead of skipping unloaded ones --- crates/horizon-client/src/game.rs | 18 ++++- crates/horizon-client/src/game/end.rs | 33 +++++++-- .../horizon-client/src/game/initial_spawn.rs | 73 +++++++++---------- .../horizon-client/src/game/server_travel.rs | 34 +++++++-- 4 files changed, 106 insertions(+), 52 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 2d853cbe5..e6abe53b4 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -1366,6 +1366,9 @@ struct Game<'a> { spawn_spiral: horizon_client::world_spawn::ChunkSpiral, /// A new player's spawn search, while its candidates' chunks load. player_spawn: Option, + /// Chunks a respawn search waits for this tick, kept loading beside the + /// player's own (taken by `update_world`). + spawn_wait: Vec<(i32, i32)>, mobs: Vec, creatures: creatures::Creatures, sculk: sculk::SculkState, @@ -4256,8 +4259,12 @@ impl Game<'_> { let column = [s.x.floor() as i32, s.y.floor() as i32, s.z.floor() as i32]; if self.level.world_spawn == Some(column) { // TeleportTransition.missingRespawnBlock: PlayerSpawnFinder - // around the world spawn, not its exact column. - self.respawn_spawn(column) + // around the world spawn, not its exact column; its candidates' + // chunks load first. + let Some(feet) = self.find_player_spawn(column)? else { + return Ok(()); + }; + feet } else { // A spawnpoint: the stored column, lifted onto its current surface. let y = self @@ -11137,8 +11144,14 @@ impl Game<'_> { self.streaming.loading = self.options.execution_role.is_client() && self.loading_reason().is_some(); self.tick_pregen(); + let areas = self.streaming.extra.len(); + let waiting = std::mem::take(&mut self.spawn_wait); + self.streaming + .extra + .extend(waiting.into_iter().map(|chunk| (chunk, 0))); let (uploads, unloaded) = horizon_client::spans::time("streaming", || self.streaming.update(&mut self.world)); + self.streaming.extra.truncate(areas); if let Some(lod) = &mut self.lod { self.lod_observe .extend(uploads.iter().map(|(key, _)| (key.0, key.2))); @@ -12426,6 +12439,7 @@ impl<'a> Game<'a> { spawn_origin: None, spawn_spiral: Default::default(), player_spawn: None, + spawn_wait: Vec::new(), mobs: Vec::new(), creatures: Default::default(), sculk: Default::default(), diff --git a/crates/horizon-client/src/game/end.rs b/crates/horizon-client/src/game/end.rs index f11d4a61c..cffe3aa4b 100644 --- a/crates/horizon-client/src/game/end.rs +++ b/crates/horizon-client/src/game/end.rs @@ -11,6 +11,7 @@ use horizon_client::{ motion::PlayerMotion, particles::{ParticleOptions, ParticleType}, vanillagen::VanillaTerrain, + world_spawn::PlayerSpawnFinder, }; use horizon_core::{ geometry::Vec3, @@ -521,7 +522,15 @@ impl Game<'_> { let position = if let Some(job) = self.end.job.take() { self.resolve_gateway(job, target)? } else { - let (position, yaw) = self.end_arrival(target)?; + let mut finder = self.player_spawn.take(); + let arrival = self.end_arrival(target, &mut finder); + self.player_spawn = finder; + let Some((position, yaw)) = arrival? else { + // A spawn candidate's chunk is loading: try again next tick. + self.travelling = Some((player, target)); + self.end_travel = true; + return Ok(()); + }; if let Some(yaw) = yaw { self.yaw = yaw; player.yaw = yaw; @@ -546,7 +555,13 @@ impl Game<'_> { /// Where an End portal's traveller lands once `target` has loaded, and /// the yaw it faces there: the platform below the End's spawn point, /// facing west, or the top of the Overworld's spawn column. - pub(super) fn end_arrival(&mut self, target: Vec3) -> Result<(Vec3, Option)> { + /// None while a candidate of the world spawn's search loads (`finder` + /// keeps it, see `search_spawn`). + pub(super) fn end_arrival( + &mut self, + target: Vec3, + finder: &mut Option, + ) -> Result)>> { if self.dim == Dim::End { // EndPlatformFeature.createEndPlatform below the spawn point. let origin = [END_SPAWN[0], END_SPAWN[1] - 1, END_SPAWN[2]]; @@ -566,14 +581,14 @@ impl Game<'_> { } } // Direction.WEST.toYRot(). - return Ok((target, Some(90.0))); + return Ok(Some((target, Some(90.0)))); } // ServerPlayer.findRespawnPositionAndUseSpawnBlock: where the bed or // anchor puts the player, facing it; else onto the spawn column. let mut target = target; if let Some(c) = self.respawn_config.filter(|c| c.dim == self.dim) { if let Some((at, yaw)) = self.find_respawn_and_use(c, false)? { - return Ok((at, Some(yaw))); + return Ok(Some((at, Some(yaw)))); } let s = self.level.spawn.unwrap_or([0.0, 64.0, 0.0]); target = Vec3::new(s[0].floor() + 0.5, s[1], s[2].floor() + 0.5); @@ -582,10 +597,16 @@ impl Game<'_> { // TeleportTransition.missingRespawnBlock: PlayerSpawnFinder around // the world spawn. if let Some(world) = self.level.world_spawn.filter(|w| w[0] == x && w[2] == z) { - return Ok((self.respawn_spawn(world), None)); + return Ok(match self.search_spawn(world, finder) { + Ok(at) => Some((at, None)), + Err(chunk) => { + self.spawn_wait.push(chunk); + None + } + }); } let y = self.land_column(x, z).map_or(target.y, f64::from); - Ok((Vec3::new(target.x, y, target.z), None)) + Ok(Some((Vec3::new(target.x, y, target.z), None))) } /// Dying away from the Overworld respawns at the world spawn there. diff --git a/crates/horizon-client/src/game/initial_spawn.rs b/crates/horizon-client/src/game/initial_spawn.rs index bcea90337..d4c48c140 100644 --- a/crates/horizon-client/src/game/initial_spawn.rs +++ b/crates/horizon-client/src/game/initial_spawn.rs @@ -145,61 +145,58 @@ impl Game<'_> { entity_random().next_int_bound(n).unwrap_or(0) }) } - /// PlayerSpawnFinder.findSpawn around the world spawn for a player placed - /// at once (TeleportTransition.createDefault and missingRespawnBlock): the - /// first free column within the respawn radius, the suggestion's own - /// column when none is. A candidate whose chunk is not loaded counts as - /// not free; the suggestion's chunk must be. - pub(super) fn respawn_spawn(&self, suggestion: [i32; 3]) -> Vec3 { - let mut finder = self.spawn_finder(suggestion); - while let Some(candidate) = finder.next_candidate() { - let SpawnCandidate::Column(x, z) = candidate else { - break; - }; - if !self.streaming.is_lit(x >> 4, z >> 4) { - continue; - } - if let Some(pos) = level_respawn_pos(&self.spawn_columns(), x, z) - && self.player_fits(pos) - { - return bottom_center(pos); - } - } - self.fixup_spawn_height(suggestion) - } - /// PlayerSpawnFinder.findSpawn around the world spawn: the feet of a - /// player who has no position yet. None while a candidate's chunk loads. - pub(super) fn find_player_spawn(&mut self, suggestion: [i32; 3]) -> Result> { - let mut finder = match self.player_spawn { - Some(finder) => finder, - None => self.spawn_finder(suggestion), - }; - let found = loop { + /// PlayerSpawnFinder.findSpawn around the world spawn, as far as the loaded + /// chunks allow: the feet of the first free column within the respawn + /// radius, else the suggestion's own column. The finder waits in `state` + /// (None to begin); Err gives the chunk of the candidate being waited for, + /// which the caller must have loaded (the finder tries at most 1024 + /// columns). + pub(super) fn search_spawn( + &self, + suggestion: [i32; 3], + state: &mut Option, + ) -> std::result::Result { + let mut finder = state + .take() + .unwrap_or_else(|| self.spawn_finder(suggestion)); + let suggestion = finder.suggestion; + loop { let Some(candidate) = finder.next_candidate() else { - break Some(self.fixup_spawn_height(suggestion)); + return Ok(self.fixup_spawn_height(suggestion)); }; let (x, z) = match candidate { SpawnCandidate::Column(x, z) => (x, z), SpawnCandidate::Suggestion => (suggestion[0], suggestion[2]), }; if !self.streaming.is_lit(x >> 4, z >> 4) { - self.streaming.center = (x >> 4, z >> 4); finder.retry(); - break None; + *state = Some(finder); + return Err((x >> 4, z >> 4)); } match candidate { SpawnCandidate::Column(x, z) => { if let Some(pos) = level_respawn_pos(&self.spawn_columns(), x, z) && self.player_fits(pos) { - break Some(bottom_center(pos)); + return Ok(bottom_center(pos)); } } - SpawnCandidate::Suggestion => break Some(self.fixup_spawn_height(suggestion)), + SpawnCandidate::Suggestion => return Ok(self.fixup_spawn_height(suggestion)), } - }; - self.player_spawn = found.is_none().then_some(finder); - Ok(found) + } + } + /// PlayerSpawnFinder.findSpawn around the world spawn: the feet of a + /// player who has no position yet. None while a candidate's chunk loads. + pub(super) fn find_player_spawn(&mut self, suggestion: [i32; 3]) -> Result> { + let mut state = self.player_spawn.take(); + match self.search_spawn(suggestion, &mut state) { + Ok(feet) => Ok(Some(feet)), + Err(chunk) => { + self.streaming.center = chunk; + self.player_spawn = state; + Ok(None) + } + } } /// PlayerSpawnFinder.noCollisionNoLiquid: a player's box standing at the /// block's bottom centre touches no block or liquid. diff --git a/crates/horizon-client/src/game/server_travel.rs b/crates/horizon-client/src/game/server_travel.rs index e22cd60e9..ac983dff1 100644 --- a/crates/horizon-client/src/game/server_travel.rs +++ b/crates/horizon-client/src/game/server_travel.rs @@ -11,7 +11,7 @@ use super::end::GatewayJob; use super::nether_portal::{PLAYER_DELAY, Plan}; use super::respawn_anchor::RespawnConfig; use super::{Dim, Game, lan::LanHost}; -use horizon_client::{lan::hub::TickCtx, text::Text}; +use horizon_client::{lan::hub::TickCtx, text::Text, world_spawn::PlayerSpawnFinder}; use horizon_core::{geometry::Vec3, position::BlockPos}; use horizon_protocol::packets::play::{self, Clientbound as C}; @@ -34,6 +34,8 @@ pub(super) struct Trip { /// A respawn at the world spawn, moved onto a free column within the /// respawn radius once the chunks around it have loaded. world_spawn: bool, + /// The search for that column while a candidate's chunk loads. + finder: Option, /// Sent by a command: the player is already where it goes. placed: bool, } @@ -258,6 +260,7 @@ impl Game<'_> { gateway: None, respawn: None, world_spawn: false, + finder: None, placed: false, }); if let Err(e) = self.enter_level(Some(host), source) { @@ -278,6 +281,7 @@ impl Game<'_> { gateway: None, respawn: Some(config), world_spawn: false, + finder: None, placed: false, }); } @@ -327,6 +331,7 @@ impl Game<'_> { gateway: None, respawn: None, world_spawn: true, + finder: None, placed: false, }); } @@ -372,6 +377,7 @@ impl Game<'_> { gateway: Some(job), respawn: None, world_spawn: false, + finder: None, placed: false, }); } @@ -398,7 +404,7 @@ impl Game<'_> { k += 1; continue; } - let trip = self.server_trips.remove(k); + let mut trip = self.server_trips.remove(k); if trip.placed { continue; } @@ -416,7 +422,15 @@ impl Game<'_> { // PlayerSpawnFinder.findSpawn around the world spawn. let suggestion = [trip.target.x, trip.target.y, trip.target.z].map(|v| v.floor() as i32); - (self.respawn_spawn(suggestion), yaw) + match self.search_spawn(suggestion, &mut trip.finder) { + Ok(at) => (at, yaw), + Err(chunk) => { + self.spawn_wait.push(chunk); + self.server_trips.insert(k, trip); + k += 1; + continue; + } + } } else if let Some(job) = trip.gateway { match self.resolve_gateway(job, trip.target) { Ok(at) => (at, yaw), @@ -426,12 +440,19 @@ impl Game<'_> { } } } else if trip.end { - let arrival = match self.as_guest(host, trip.conn, |g| g.end_arrival(trip.target)) { + let arrival = match self.as_guest(host, trip.conn, |g| { + g.end_arrival(trip.target, &mut trip.finder) + }) { Some(arrival) => arrival, - None => self.end_arrival(trip.target), + None => self.end_arrival(trip.target, &mut trip.finder), }; match arrival { - Ok((at, turned)) => (at, turned.unwrap_or(yaw)), + Ok(Some((at, turned))) => (at, turned.unwrap_or(yaw)), + Ok(None) => { + self.server_trips.insert(k, trip); + k += 1; + continue; + } Err(e) => { log::error!("End arrival: {e}"); (trip.target, yaw) @@ -493,6 +514,7 @@ impl Game<'_> { gateway: None, respawn: None, world_spawn: false, + finder: None, placed: true, }); if let Err(e) = self.enter_level(Some(host), source) { From e350b87b3c28480c672943e832ff38aae5fce02a Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 15:07:40 +0100 Subject: [PATCH 3/4] End portal exits pass no spawn finder main's item and mob End portal exit calls end_arrival, which now takes the respawn search's finder; in the End it only builds the platform. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/nether_portal.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/nether_portal.rs b/crates/horizon-client/src/game/nether_portal.rs index c8142284a..261e0cd10 100644 --- a/crates/horizon-client/src/game/nether_portal.rs +++ b/crates/horizon-client/src/game/nether_portal.rs @@ -297,7 +297,8 @@ impl Game<'_> { let p = plan.approximate; let centre = Vec3::new(f64::from(p.x) + 0.5, f64::from(p.y), f64::from(p.z) + 0.5); if plan.dim == Dim::End { - if let Err(e) = self.end_arrival(centre) { + // In the End the arrival only builds the platform: no spawn search. + if let Err(e) = self.end_arrival(centre, &mut None) { log::error!("End platform: {e}"); } return centre; From 1bd74d1b2f358bb878ddf432539fc5bcc015d6cd Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 16:35:07 +0100 Subject: [PATCH 4/4] Skip the world spawn trip's teleport when the respawn already put the player there Vanilla teleports a respawning player once; the second, identical move showed up in the dedicated_server, pearl_death and cursor_death harnesses. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/server_travel.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/horizon-client/src/game/server_travel.rs b/crates/horizon-client/src/game/server_travel.rs index ac983dff1..e516d3f67 100644 --- a/crates/horizon-client/src/game/server_travel.rs +++ b/crates/horizon-client/src/game/server_travel.rs @@ -423,6 +423,9 @@ impl Game<'_> { let suggestion = [trip.target.x, trip.target.y, trip.target.z].map(|v| v.floor() as i32); match self.search_spawn(suggestion, &mut trip.finder) { + // The respawn already put the player on this column: + // vanilla teleports once, so no second move. + Ok(at) if host.hub.guests[i].position == [at.x, at.y, at.z] => continue, Ok(at) => (at, yaw), Err(chunk) => { self.spawn_wait.push(chunk);