Skip to content

Commit 0be8e2f

Browse files
committed
fix: Error when attempting spawn and any player is in a different world
1 parent cae0c73 commit 0be8e2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

geary-papermc-spawning/src/main/kotlin/com/mineinabyss/geary/papermc/spawning/choosing/SpawnLocationChooser.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ class SpawnLocationChooser(
2727
}
2828

2929
// Ensure not near ANY player
30-
if (onlinePlayers.any { it.location.distanceSquared(spawnLocation) < config.minDistance * config.minDistance })
30+
if (onlinePlayers.any {
31+
it.location.world == spawnLocation.world && it.location.distanceSquared(spawnLocation) < config.minDistance * config.minDistance
32+
})
3133
return null
3234

3335
return spawnLocation

0 commit comments

Comments
 (0)