From 732dac6fc147087c2acf8f60d1a2db5bfc7243a6 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 12 Nov 2022 14:43:22 +0000 Subject: [PATCH] Player: revert accidental change from ef100b248b72dbe0238abd202c4d1ac11ff375ee --- src/player/Player.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/player/Player.php b/src/player/Player.php index 500e8b800..904bf5793 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -300,6 +300,14 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ $this->chunkLoader = new PlayerChunkLoader($spawnLocation); + $world = $spawnLocation->getWorld(); + //load the spawn chunk so we can see the terrain + $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); }