diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 330f06ca6..f1985bc04 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -571,14 +571,14 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade public function setDisplayName($name){ $this->displayName = $name; if($this->spawned){ - $this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $this->isSkinSlim(), $this->getSkinData()); + $this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $this->getSkinName(), $this->getSkinData()); } } - public function setSkin($str, $isSlim = false){ - parent::setSkin($str, $isSlim); + public function setSkin($str, $skinName){ + parent::setSkin($str, $skinName); if($this->spawned){ - $this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $isSlim, $str); + $this->server->updatePlayerListData($this->getUniqueId(), $this->getId(), $this->getDisplayName(), $skinName, $str); } } @@ -1856,7 +1856,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade break; } - $this->setSkin($packet->skin, $packet->slim); + $this->setSkin($packet->skin, $packet->skinName); $this->server->getPluginManager()->callEvent($ev = new PlayerPreLoginEvent($this, "Plugin reason")); if($ev->isCancelled()){ diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index b284c885f..a4facf3dc 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -73,10 +73,10 @@ namespace pocketmine { use pocketmine\wizard\Installer; const VERSION = "1.6dev"; - const API_VERSION = "1.13.0"; + const API_VERSION = "1.13.1"; const CODENAME = "[REDACTED]"; - const MINECRAFT_VERSION = "v0.13.0 alpha"; - const MINECRAFT_VERSION_NETWORK = "0.13.0"; + const MINECRAFT_VERSION = "v0.13.1 alpha"; + const MINECRAFT_VERSION_NETWORK = "0.13.1"; /* * Startup code. Do not look at it, it may harm you. diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index a41e1b039..93452e7c4 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -2248,7 +2248,7 @@ class Server{ public function addOnlinePlayer(Player $player){ $this->playerList[$player->getRawUniqueId()] = $player; - $this->updatePlayerListData($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->isSkinSlim(), $player->getSkinData()); + $this->updatePlayerListData($player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkinName(), $player->getSkinData()); } public function removeOnlinePlayer(Player $player){ @@ -2262,10 +2262,10 @@ class Server{ } } - public function updatePlayerListData(UUID $uuid, $entityId, $name, $isSlim, $skinData, array $players = null){ + public function updatePlayerListData(UUID $uuid, $entityId, $name, $skinName, $skinData, array $players = null){ $pk = new PlayerListPacket(); $pk->type = PlayerListPacket::TYPE_ADD; - $pk->entries[] = [$uuid, $entityId, $name, $isSlim, $skinData]; + $pk->entries[] = [$uuid, $entityId, $name, $skinName, $skinData]; Server::broadcastPacket($players === null ? $this->playerList : $players, $pk); } @@ -2280,7 +2280,7 @@ class Server{ $pk = new PlayerListPacket(); $pk->type = PlayerListPacket::TYPE_ADD; foreach($this->playerList as $player){ - $pk->entries[] = [$player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->isSkinSlim(), $player->getSkinData()]; + $pk->entries[] = [$player->getUniqueId(), $player->getId(), $player->getDisplayName(), $player->getSkinName(), $player->getSkinData()]; } $p->dataPacket($pk); diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 34e15f785..08ccaba28 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -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(); diff --git a/src/pocketmine/network/protocol/LoginPacket.php b/src/pocketmine/network/protocol/LoginPacket.php index 921b7ef03..6b8079f19 100644 --- a/src/pocketmine/network/protocol/LoginPacket.php +++ b/src/pocketmine/network/protocol/LoginPacket.php @@ -36,7 +36,7 @@ class LoginPacket extends DataPacket{ public $serverAddress; public $clientSecret; - public $slim = false; + public $skinName; public $skin = null; public function decode(){ @@ -52,8 +52,7 @@ class LoginPacket extends DataPacket{ $this->serverAddress = $this->getString(); $this->clientSecret = $this->getString(); - $this->slim = $this->getByte() > 0; - $this->getByte(); // TODO: skin transparency, experimental or not? + $this->skinName = $this->getString(); $this->skin = $this->getString(); } diff --git a/src/pocketmine/network/protocol/PlayerListPacket.php b/src/pocketmine/network/protocol/PlayerListPacket.php index 4ec5e4476..c9f65a664 100644 --- a/src/pocketmine/network/protocol/PlayerListPacket.php +++ b/src/pocketmine/network/protocol/PlayerListPacket.php @@ -53,8 +53,7 @@ class PlayerListPacket extends DataPacket{ $this->putUUID($d[0]); $this->putLong($d[1]); $this->putString($d[2]); - $this->putByte($d[3] ? 1 : 0); - $this->putByte(0); // TODO: skin transparency, experimental or not? + $this->putString($d[3]); $this->putString($d[4]); }else{ $this->putUUID($d[0]);