Player: remove useless checks from save()

this should never be called for a player with an empty username (because data isn't saved unless the player was spawned) and the instanceof is laughable.
This commit is contained in:
Dylan K. Taylor 2018-08-07 17:37:55 +01:00
parent 55ac1c80c9
commit 16b789a528

View File

@ -2945,10 +2945,8 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->namedtag->setInt("playerGameType", $this->gamemode); $this->namedtag->setInt("playerGameType", $this->gamemode);
$this->namedtag->setLong("lastPlayed", (int) floor(microtime(true) * 1000)); $this->namedtag->setLong("lastPlayed", (int) floor(microtime(true) * 1000));
if($this->username != "" and $this->namedtag instanceof CompoundTag){
$this->server->saveOfflinePlayerData($this->username, $this->namedtag, $async); $this->server->saveOfflinePlayerData($this->username, $this->namedtag, $async);
} }
}
public function kill() : void{ public function kill() : void{
if(!$this->spawned){ if(!$this->spawned){