mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 09:49:50 +00:00
New field for MobEquipmentPacket
If anyone wants to play with the off-hand, the window ID is 0x77 ;)
This commit is contained in:
parent
55c4e35407
commit
1e9ff44890
@ -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);
|
||||
|
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user