mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +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->item = $item;
|
||||||
$pk->inventorySlot = $this->getHeldItemSlot();
|
$pk->inventorySlot = $this->getHeldItemSlot();
|
||||||
$pk->hotbarSlot = $this->getHeldItemIndex();
|
$pk->hotbarSlot = $this->getHeldItemIndex();
|
||||||
|
$pk->windowId = ContainerSetContentPacket::SPECIAL_INVENTORY;
|
||||||
|
|
||||||
if(!is_array($target)){
|
if(!is_array($target)){
|
||||||
$target->dataPacket($pk);
|
$target->dataPacket($pk);
|
||||||
|
@ -33,14 +33,14 @@ class MobEquipmentPacket extends DataPacket{
|
|||||||
public $item;
|
public $item;
|
||||||
public $inventorySlot;
|
public $inventorySlot;
|
||||||
public $hotbarSlot;
|
public $hotbarSlot;
|
||||||
public $unknownByte = 0;
|
public $windowId = 0;
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
||||||
$this->entityRuntimeId = $this->getEntityRuntimeId();
|
$this->entityRuntimeId = $this->getEntityRuntimeId();
|
||||||
$this->item = $this->getSlot();
|
$this->item = $this->getSlot();
|
||||||
$this->inventorySlot = $this->getByte();
|
$this->inventorySlot = $this->getByte();
|
||||||
$this->hotbarSlot = $this->getByte();
|
$this->hotbarSlot = $this->getByte();
|
||||||
$this->unknownByte = $this->getByte();
|
$this->windowId = $this->getByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
@ -49,7 +49,7 @@ class MobEquipmentPacket extends DataPacket{
|
|||||||
$this->putSlot($this->item);
|
$this->putSlot($this->item);
|
||||||
$this->putByte($this->inventorySlot);
|
$this->putByte($this->inventorySlot);
|
||||||
$this->putByte($this->hotbarSlot);
|
$this->putByte($this->hotbarSlot);
|
||||||
$this->putByte($this->unknownByte);
|
$this->putByte($this->windowId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(NetworkSession $session) : bool{
|
public function handle(NetworkSession $session) : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user