mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Throw exception when saving an already-closed player, closes #1981
This commit is contained in:
parent
bf5630dc0d
commit
e0fc3784ad
@ -2163,6 +2163,10 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
* Handles player data saving
|
||||
*/
|
||||
public function save(){
|
||||
if($this->closed){
|
||||
throw new \Exception("Tried to save closed player");
|
||||
}
|
||||
|
||||
parent::saveNBT();
|
||||
$this->namedtag["Level"] = $this->getLevel()->getName();
|
||||
if($this->spawnPosition instanceof Position and $this->spawnPosition->getLevel() instanceof Level){
|
||||
|
Loading…
x
Reference in New Issue
Block a user