mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Updated for .13.1. skinName replaces isSlim, API bump
This commit is contained in:
@ -57,15 +57,15 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
public $height = 1.8;
|
||||
public $eyeHeight = 1.62;
|
||||
|
||||
protected $skinName;
|
||||
protected $skin;
|
||||
protected $isSlim = false;
|
||||
|
||||
public function getSkinData(){
|
||||
return $this->skin;
|
||||
}
|
||||
|
||||
public function isSkinSlim(){
|
||||
return $this->isSlim;
|
||||
public function getSkinName(){
|
||||
return $this->skinName;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -84,11 +84,11 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
|
||||
/**
|
||||
* @param string $str
|
||||
* @param bool $isSlim
|
||||
* @param string $skinName
|
||||
*/
|
||||
public function setSkin($str, $isSlim = false){
|
||||
public function setSkin($str, $skinName){
|
||||
$this->skin = $str;
|
||||
$this->isSlim = (bool) $isSlim;
|
||||
$this->skinName = $skinName;
|
||||
}
|
||||
|
||||
public function getInventory(){
|
||||
@ -112,7 +112,7 @@ 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);
|
||||
$this->setSkin($this->namedtag->Skin["Data"], $this->namedtag->Skin["Name"]);
|
||||
}
|
||||
|
||||
$this->uuid = UUID::fromData($this->getId(), $this->getSkinData(), $this->getNameTag());
|
||||
@ -195,7 +195,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
if(strlen($this->getSkinData()) > 0){
|
||||
$this->namedtag->Skin = new Compound("Skin", [
|
||||
"Data" => new String("Data", $this->getSkinData()),
|
||||
"Slim" => new Byte("Slim", $this->isSkinSlim() ? 1 : 0)
|
||||
"Name" => new String("Name", $this->getSkinName())
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -210,7 +210,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
|
||||
|
||||
if(!($this instanceof Player)){
|
||||
$this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getName(), $this->isSlim, $this->skin, [$player]);
|
||||
$this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getName(), $this->skinName, $this->skin, [$player]);
|
||||
}
|
||||
|
||||
$pk = new AddPlayerPacket();
|
||||
|
Reference in New Issue
Block a user