Added PhpDoc for packet field types and changed float x,y,z to Vector3

This commit is contained in:
Dylan K. Taylor
2017-08-13 20:02:07 +01:00
parent 6480f7a989
commit 9be1b929a5
99 changed files with 424 additions and 207 deletions

View File

@ -32,24 +32,23 @@ use pocketmine\network\mcpe\NetworkSession;
class MobArmorEquipmentPacket extends DataPacket{
const NETWORK_ID = ProtocolInfo::MOB_ARMOR_EQUIPMENT_PACKET;
/** @var int */
public $entityRuntimeId;
/** @var Item[] */
public $slots = [];
protected function decodePayload(){
$this->entityRuntimeId = $this->getEntityRuntimeId();
$this->slots[0] = $this->getSlot();
$this->slots[1] = $this->getSlot();
$this->slots[2] = $this->getSlot();
$this->slots[3] = $this->getSlot();
for($i = 0; $i < 4; ++$i){
$this->slots[$i] = $this->getSlot();
}
}
protected function encodePayload(){
$this->putEntityRuntimeId($this->entityRuntimeId);
$this->putSlot($this->slots[0]);
$this->putSlot($this->slots[1]);
$this->putSlot($this->slots[2]);
$this->putSlot($this->slots[3]);
for($i = 0; $i < 4; ++$i){
$this->putSlot($this->slots[$i]);
}
}
public function handle(NetworkSession $session) : bool{