From d6d3184e37062998bb482384c4c984ab3662064f Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 6 Mar 2017 11:35:57 +0000 Subject: [PATCH] Fixed players can't join if spawn-radius is higher than the player's view distance TODO: use this properly instead of calculating a count --- src/pocketmine/Player.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 1de4e297a..788633f71 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -429,6 +429,9 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade public function setViewDistance(int $distance){ $this->viewDistance = $this->server->getAllowedViewDistance($distance); + + $this->spawnThreshold = (int) min($this->viewDistance, $this->server->getProperty("chunk-sending.spawn-radius")) ** 2 * M_PI; + $pk = new ChunkRadiusUpdatedPacket(); $pk->radius = $this->viewDistance; $this->dataPacket($pk);