Throw exception when saving an already-closed player, closes #1981

This commit is contained in:
Shoghi Cervantes 2014-08-26 22:02:43 +02:00
parent bf5630dc0d
commit e0fc3784ad

View File

@ -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){