diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 1e1fb8226..b8cb97a53 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -191,6 +191,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ protected $viewDistance; protected $chunksPerTick; + protected $spawnThreshold; /** @var null|Position */ private $spawnPosition = null; @@ -429,6 +430,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->port = $port; $this->clientID = $clientID; $this->chunksPerTick = (int) $this->server->getProperty("chunk-sending.per-tick", 4); + $this->spawnThreshold = (int) $this->server->getProperty("chunk-sending.spawn-threshold", 56); $this->spawnPosition = null; $this->gamemode = $this->server->getGamemode(); $this->setLevel($this->server->getDefaultLevel(), true); @@ -610,18 +612,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{ $this->level->requestChunk($X, $Z, $this, LevelProvider::ORDER_ZXY); } - if(count($this->usedChunks) >= 8 and $this->spawned === false){ - $spawned = 0; - foreach($this->usedChunks as $d){ - if($d === true){ - $spawned++; - } - } - - if($spawned < 4){ - return; - } - + if(count($this->usedChunks) >= $this->spawnThreshold and $this->spawned === false){ $this->spawned = true; $this->sendSettings(); diff --git a/src/pocketmine/resources/pocketmine.yml b/src/pocketmine/resources/pocketmine.yml index c03810d32..5d8928d81 100644 --- a/src/pocketmine/resources/pocketmine.yml +++ b/src/pocketmine/resources/pocketmine.yml @@ -46,6 +46,8 @@ chunk-sending: per-tick: 8 #Amount of chunks sent around each player max-chunks: 256 + #Amount of chunks that need to be sent before spawning the player + spawn-threshold: 56 chunk-ticking: #Max amount of chunks processed each tick