mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Merge branch 'master' into api3/network
This commit is contained in:
@ -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{
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user