From 383fcba8e10b64ec3f4dfba596c0b9295d4c09bb Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sun, 7 Jun 2015 12:17:27 +0200 Subject: [PATCH] Fixed skins issue --- src/pocketmine/Player.php | 2 +- src/pocketmine/entity/Human.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 537478b9d..67e0eb49a 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -567,7 +567,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade public function setSkin($str, $isSlim = false){ parent::setSkin($str, $isSlim); - if($this->spawned === true){ + if($this->spawned){ $this->respawnToAll(); } } diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 7170948b9..3827ed639 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -86,8 +86,14 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ } - if(isset($this->namedtag->NameTag)){ - $this->setNameTag($this->namedtag["NameTag"]); + if(!($this instanceof Player)){ + if(isset($this->namedtag->NameTag)){ + $this->setNameTag($this->namedtag["NameTag"]); + } + + if(isset($this->namedtag->Skin) and $this->namedtag->Skin instanceof Compound){ + $this->setSkin($this->namedtag->Skin["Data"], $this->namedtag->Skin["Slim"] > 0); + } } if(isset($this->namedtag->Inventory) and $this->namedtag->Inventory instanceof Enum){ @@ -102,10 +108,6 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ } } - if(isset($this->namedtag->Skin) and $this->namedtag->Skin instanceof Compound){ - $this->setSkin($this->namedtag->Skin["Data"], $this->namedtag->Skin["Slim"] > 0); - } - parent::initEntity(); }