New field for MobEquipmentPacket

If anyone wants to play with the off-hand, the window ID is 0x77 ;)
This commit is contained in:
Dylan K. Taylor 2017-06-05 19:10:00 +01:00
parent 55c4e35407
commit 1e9ff44890
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -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{