Fixed skins issue

This commit is contained in:
Shoghi Cervantes 2015-06-07 12:17:27 +02:00
parent e5f28e0f7a
commit 383fcba8e1
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89
2 changed files with 9 additions and 7 deletions

View File

@ -567,7 +567,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
public function setSkin($str, $isSlim = false){ public function setSkin($str, $isSlim = false){
parent::setSkin($str, $isSlim); parent::setSkin($str, $isSlim);
if($this->spawned === true){ if($this->spawned){
$this->respawnToAll(); $this->respawnToAll();
} }
} }

View File

@ -86,10 +86,16 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
} }
if(!($this instanceof Player)){
if(isset($this->namedtag->NameTag)){ if(isset($this->namedtag->NameTag)){
$this->setNameTag($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){ if(isset($this->namedtag->Inventory) and $this->namedtag->Inventory instanceof Enum){
foreach($this->namedtag->Inventory as $item){ foreach($this->namedtag->Inventory as $item){
if($item["Slot"] >= 0 and $item["Slot"] < 9){ //Hotbar if($item["Slot"] >= 0 and $item["Slot"] < 9){ //Hotbar
@ -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(); parent::initEntity();
} }