Player: remove useless check from save()

this exception is only thrown if the player is closed, which is already unexpected in the first place and will actually crash if it's not kosher. This prevents doing stuff like saving players during onDispose(), which crashes the server if a player is disconnected due to flagForDespawn().
This commit is contained in:
Dylan K. Taylor
2021-01-07 23:32:35 +00:00
parent 7b806e74b8
commit eaaed79b93

View File

@ -2033,14 +2033,8 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
/**
* Handles player data saving
*
* @throws \InvalidStateException if the player is closed
*/
public function save() : void{
if($this->closed){
throw new \InvalidStateException("Tried to save closed player");
}
$nbt = $this->saveNBT();
if($this->location->isValid()){