Player: explicitly load chunk for player to spawn, fixes #2115

this is an ugly fix, but it'll do for now...
This commit is contained in:
Dylan K. Taylor 2018-03-25 12:45:51 +01:00
parent 2b37b4a659
commit be7c27f60d

View File

@ -2072,6 +2072,10 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
protected function completeLoginSequence(){
/** @var float[] $pos */
$pos = $this->namedtag->getListTag("Pos")->getAllValues();
$this->level->registerChunkLoader($this, ((int) floor($pos[0])) >> 4, ((int) floor($pos[2])) >> 4, true);
parent::__construct($this->level, $this->namedtag);
$this->server->getPluginManager()->callEvent($ev = new PlayerLoginEvent($this, "Plugin reason"));
if($ev->isCancelled()){