13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
21 public const NETWORK_ID = ProtocolInfo::BLOCK_PICK_REQUEST_PACKET;
24 public bool $addUserData =
false;
25 public int $hotbarSlot;
30 public static function create(
BlockPosition $blockPosition,
bool $addUserData,
int $hotbarSlot) : self{
32 $result->blockPosition = $blockPosition;
33 $result->addUserData = $addUserData;
34 $result->hotbarSlot = $hotbarSlot;
39 $this->blockPosition = $in->getSignedBlockPosition();
40 $this->addUserData = $in->
getBool();
41 $this->hotbarSlot = $in->
getByte();
45 $out->putSignedBlockPosition($this->blockPosition);
46 $out->putBool($this->addUserData);
47 $out->putByte($this->hotbarSlot);
51 return $handler->handleBlockPickRequest($this);
encodePayload(PacketSerializer $out)
handle(PacketHandlerInterface $handler)
static create(BlockPosition $blockPosition, bool $addUserData, int $hotbarSlot)
decodePayload(PacketSerializer $in)