Merge branch 'api3/network' into api3/network_mcpe-1.0.5

This commit is contained in:
Dylan K. Taylor
2017-03-12 12:30:56 +00:00
10 changed files with 187 additions and 120 deletions

View File

@ -34,14 +34,14 @@ class ContainerSetSlotPacket extends DataPacket{
public $hotbarSlot;
/** @var Item */
public $item;
public $unknown;
public $selectSlot;
public function decode(){
$this->windowid = $this->getByte();
$this->slot = $this->getVarInt();
$this->hotbarSlot = $this->getVarInt();
$this->item = $this->getSlot();
$this->unknown = $this->getByte();
$this->selectSlot = $this->getByte();
}
public function encode(){
@ -50,7 +50,7 @@ class ContainerSetSlotPacket extends DataPacket{
$this->putVarInt($this->slot);
$this->putVarInt($this->hotbarSlot);
$this->putSlot($this->item);
$this->putByte($this->unknown);
$this->putByte($this->selectSlot);
}
public function handle(NetworkSession $session) : bool{

View File

@ -31,15 +31,15 @@ class MobEquipmentPacket extends DataPacket{
public $eid;
public $item;
public $slot;
public $selectedSlot;
public $inventorySlot;
public $hotbarSlot;
public $unknownByte;
public function decode(){
$this->eid = $this->getEntityRuntimeId();
$this->item = $this->getSlot();
$this->slot = $this->getByte();
$this->selectedSlot = $this->getByte();
$this->inventorySlot = $this->getByte();
$this->hotbarSlot = $this->getByte();
$this->unknownByte = $this->getByte();
}
@ -47,8 +47,8 @@ class MobEquipmentPacket extends DataPacket{
$this->reset();
$this->putEntityRuntimeId($this->eid);
$this->putSlot($this->item);
$this->putByte($this->slot);
$this->putByte($this->selectedSlot);
$this->putByte($this->inventorySlot);
$this->putByte($this->hotbarSlot);
$this->putByte($this->unknownByte);
}