From eaaed79b9398668e748fc30e02fdbb4fa0eff709 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 7 Jan 2021 23:32:35 +0000 Subject: [PATCH] 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(). --- src/player/Player.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/player/Player.php b/src/player/Player.php index 0d3746e4c..57c5c4e6a 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -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()){