mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Removed a condition that's been useless almost since the beginning of PocketMine
This condition has been useless since before NBT was introduced to PocketMine. If there was a use for it, it should have been placed BEFORE anything attempted to read from the NBT. However, Server now handles bad data automatically now, so Server->getOfflinePlayerData() will never _not_ return a CompoundTag. Hence I've added a CompoundTag type-hint.
This commit is contained in:
@ -1751,6 +1751,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
}
|
||||
|
||||
$nbt = $this->server->getOfflinePlayerData($this->username);
|
||||
|
||||
$this->playedBefore = ($nbt["lastPlayed"] - $nbt["firstPlayed"]) > 1; // microtime(true) - microtime(true) may have less than one millisecond difference
|
||||
if(!isset($nbt->NameTag)){
|
||||
$nbt->NameTag = new StringTag("NameTag", $this->username);
|
||||
@ -1775,12 +1776,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->setLevel($level);
|
||||
}
|
||||
|
||||
if(!($nbt instanceof CompoundTag)){
|
||||
$this->close($this->getLeaveMessage(), "Invalid data");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->achievements = [];
|
||||
|
||||
/** @var ByteTag $achievement */
|
||||
|
Reference in New Issue
Block a user