From 1e9ff44890542da0db402779c714f237268380ea Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 5 Jun 2017 19:10:00 +0100 Subject: [PATCH] New field for MobEquipmentPacket If anyone wants to play with the off-hand, the window ID is 0x77 ;) --- src/pocketmine/inventory/PlayerInventory.php | 1 + src/pocketmine/network/mcpe/protocol/MobEquipmentPacket.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/inventory/PlayerInventory.php b/src/pocketmine/inventory/PlayerInventory.php index 33484815b..9ca4a766c 100644 --- a/src/pocketmine/inventory/PlayerInventory.php +++ b/src/pocketmine/inventory/PlayerInventory.php @@ -236,6 +236,7 @@ class PlayerInventory extends BaseInventory{ $pk->item = $item; $pk->inventorySlot = $this->getHeldItemSlot(); $pk->hotbarSlot = $this->getHeldItemIndex(); + $pk->windowId = ContainerSetContentPacket::SPECIAL_INVENTORY; if(!is_array($target)){ $target->dataPacket($pk); diff --git a/src/pocketmine/network/mcpe/protocol/MobEquipmentPacket.php b/src/pocketmine/network/mcpe/protocol/MobEquipmentPacket.php index d259f7499..d3e8caca5 100644 --- a/src/pocketmine/network/mcpe/protocol/MobEquipmentPacket.php +++ b/src/pocketmine/network/mcpe/protocol/MobEquipmentPacket.php @@ -33,14 +33,14 @@ class MobEquipmentPacket extends DataPacket{ public $item; public $inventorySlot; public $hotbarSlot; - public $unknownByte = 0; + public $windowId = 0; public function decode(){ $this->entityRuntimeId = $this->getEntityRuntimeId(); $this->item = $this->getSlot(); $this->inventorySlot = $this->getByte(); $this->hotbarSlot = $this->getByte(); - $this->unknownByte = $this->getByte(); + $this->windowId = $this->getByte(); } public function encode(){ @@ -49,7 +49,7 @@ class MobEquipmentPacket extends DataPacket{ $this->putSlot($this->item); $this->putByte($this->inventorySlot); $this->putByte($this->hotbarSlot); - $this->putByte($this->unknownByte); + $this->putByte($this->windowId); } public function handle(NetworkSession $session) : bool{