mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 10:49:10 +00:00
Add cases for some unhandled Player Actions and add unknown field to ContainerSetSlotPacket
This commit is contained in:
parent
6ea45c5c4a
commit
146f5a567f
@ -2113,6 +2113,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
case PlayerActionPacket::ACTION_ABORT_BREAK:
|
||||
$this->lastBreak = PHP_INT_MAX;
|
||||
break;
|
||||
case PlayerActionPacket::ACTION_STOP_BREAK:
|
||||
break;
|
||||
case PlayerActionPacket::ACTION_RELEASE_ITEM:
|
||||
if($this->startAction > -1 and $this->getDataFlag(self::DATA_FLAGS, self::DATA_FLAG_ACTION)){
|
||||
if($this->inventory->getItemInHand()->getId() === Item::BOW){
|
||||
@ -2244,6 +2246,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->spawnToAll();
|
||||
$this->scheduleUpdate();
|
||||
break;
|
||||
case PlayerActionPacket::ACTION_JUMP:
|
||||
break;
|
||||
case PlayerActionPacket::ACTION_START_SPRINT:
|
||||
$ev = new PlayerToggleSprintEvent($this, true);
|
||||
$this->server->getPluginManager()->callEvent($ev);
|
||||
|
@ -33,12 +33,14 @@ class ContainerSetSlotPacket extends DataPacket{
|
||||
public $hotbarSlot;
|
||||
/** @var Item */
|
||||
public $item;
|
||||
public $unknown;
|
||||
|
||||
public function decode(){
|
||||
$this->windowid = $this->getByte();
|
||||
$this->slot = $this->getVarInt();
|
||||
$this->hotbarSlot = $this->getVarInt();
|
||||
$this->item = $this->getSlot();
|
||||
$this->unknown = $this->getByte();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -47,6 +49,7 @@ class ContainerSetSlotPacket extends DataPacket{
|
||||
$this->putVarInt($this->slot);
|
||||
$this->putVarInt($this->hotbarSlot);
|
||||
$this->putSlot($this->item);
|
||||
$this->putByte($this->unknown);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user