From ec9ece56f5046424ac0f886359cd7dc3ffe9e35e Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 7 Feb 2020 22:11:14 +0000 Subject: [PATCH] Player: fetch world via location this code caters for the possibility of the world being null. --- src/player/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player/Player.php b/src/player/Player.php index 90708a8f6..84cea684b 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -709,7 +709,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, } protected function switchWorld(World $targetWorld) : bool{ - $oldWorld = $this->getWorld(); + $oldWorld = $this->location->getWorld(); if(parent::switchWorld($targetWorld)){ if($oldWorld !== null){ foreach($this->usedChunks as $index => $d){