diff --git a/src/player/Player.php b/src/player/Player.php index 10265f466f..8a8ba1ce29 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -271,9 +271,11 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ $world = $spawnLocation->getWorld(); //load the spawn chunk so we can see the terrain - $world->registerChunkLoader($this->chunkLoader, $spawnLocation->getFloorX() >> Chunk::COORD_BIT_SIZE, $spawnLocation->getFloorZ() >> Chunk::COORD_BIT_SIZE, true); - $world->registerChunkListener($this, $spawnLocation->getFloorX() >> Chunk::COORD_BIT_SIZE, $spawnLocation->getFloorZ() >> Chunk::COORD_BIT_SIZE); - $this->usedChunks[World::chunkHash($spawnLocation->getFloorX() >> Chunk::COORD_BIT_SIZE, $spawnLocation->getFloorZ() >> Chunk::COORD_BIT_SIZE)] = UsedChunkStatus::NEEDED(); + $xSpawnChunk = $spawnLocation->getFloorX() >> Chunk::COORD_BIT_SIZE; + $zSpawnChunk = $spawnLocation->getFloorZ() >> Chunk::COORD_BIT_SIZE; + $world->registerChunkLoader($this->chunkLoader, $xSpawnChunk, $zSpawnChunk, true); + $world->registerChunkListener($this, $xSpawnChunk, $zSpawnChunk); + $this->usedChunks[World::chunkHash($xSpawnChunk, $zSpawnChunk)] = UsedChunkStatus::NEEDED(); parent::__construct($spawnLocation, $this->playerInfo->getSkin(), $namedtag); }