mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
Fixed possible Player crash on save
This commit is contained in:
parent
98e0583f34
commit
d3c308c5a8
@ -2222,6 +2222,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
parent::saveNBT();
|
parent::saveNBT();
|
||||||
|
if($this->getLevel() instanceof Level){
|
||||||
$this->namedtag["Level"] = $this->getLevel()->getName();
|
$this->namedtag["Level"] = $this->getLevel()->getName();
|
||||||
if($this->spawnPosition instanceof Position and $this->spawnPosition->getLevel() instanceof Level){
|
if($this->spawnPosition instanceof Position and $this->spawnPosition->getLevel() instanceof Level){
|
||||||
$this->namedtag["SpawnLevel"] = $this->spawnPosition->getLevel()->getName();
|
$this->namedtag["SpawnLevel"] = $this->spawnPosition->getLevel()->getName();
|
||||||
@ -2241,6 +2242,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$this->server->saveOfflinePlayerData($this->username, $this->namedtag);
|
$this->server->saveOfflinePlayerData($this->username, $this->namedtag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the username
|
* Gets the username
|
||||||
|
Loading…
x
Reference in New Issue
Block a user