mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 19:55:33 +00:00
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:
parent
7b806e74b8
commit
eaaed79b93
@ -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()){
|
||||
|
Loading…
x
Reference in New Issue
Block a user