mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
Player: fetch world via location
this code caters for the possibility of the world being null.
This commit is contained in:
parent
04a3e71047
commit
ec9ece56f5
@ -709,7 +709,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function switchWorld(World $targetWorld) : bool{
|
protected function switchWorld(World $targetWorld) : bool{
|
||||||
$oldWorld = $this->getWorld();
|
$oldWorld = $this->location->getWorld();
|
||||||
if(parent::switchWorld($targetWorld)){
|
if(parent::switchWorld($targetWorld)){
|
||||||
if($oldWorld !== null){
|
if($oldWorld !== null){
|
||||||
foreach($this->usedChunks as $index => $d){
|
foreach($this->usedChunks as $index => $d){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user