mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Fix some crashy issues when incompatible players get disconnected
This commit is contained in:
parent
6efa4343b1
commit
670a9fe44f
@ -247,9 +247,9 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
protected $ip;
|
||||
protected $removeFormat = true;
|
||||
protected $port;
|
||||
protected $username;
|
||||
protected $iusername;
|
||||
protected $displayName;
|
||||
protected $username = "";
|
||||
protected $iusername = "";
|
||||
protected $displayName = "";
|
||||
protected $startAction = -1;
|
||||
/** @var Vector3|null */
|
||||
protected $sleeping = null;
|
||||
@ -3472,7 +3472,9 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
||||
$this->windows = null;
|
||||
$this->windowIndex = [];
|
||||
|
||||
parent::close();
|
||||
if($this->constructed){
|
||||
parent::close();
|
||||
}
|
||||
$this->spawned = false;
|
||||
|
||||
if($this->loggedIn){
|
||||
|
@ -359,8 +359,12 @@ abstract class Entity extends Location implements Metadatable{
|
||||
/** @var bool */
|
||||
protected $isPlayer = false;
|
||||
|
||||
/** @var bool */
|
||||
protected $constructed = false;
|
||||
|
||||
|
||||
public function __construct(Level $level, CompoundTag $nbt){
|
||||
$this->constructed = true;
|
||||
$this->timings = Timings::getEntityTimings($this);
|
||||
|
||||
$this->isPlayer = $this instanceof Player;
|
||||
|
Loading…
x
Reference in New Issue
Block a user