13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
17use pmmp\encoding\ByteBufferReader;
18use pmmp\encoding\ByteBufferWriter;
19use pmmp\encoding\VarInt;
23 public const NETWORK_ID = ProtocolInfo::PLAYER_START_ITEM_COOLDOWN_PACKET;
25 private string $itemCategory;
26 private int $cooldownTicks;
31 public static function create(
string $itemCategory,
int $cooldownTicks) : self{
33 $result->itemCategory = $itemCategory;
34 $result->cooldownTicks = $cooldownTicks;
38 public function getItemCategory() : string{ return $this->itemCategory; }
40 public function getCooldownTicks() : int{ return $this->cooldownTicks; }
44 $this->cooldownTicks = VarInt::readSignedInt($in);
49 VarInt::writeSignedInt($out, $this->cooldownTicks);
53 return $handler->handlePlayerStartItemCooldown($this);
static create(string $itemCategory, int $cooldownTicks)
encodePayload(ByteBufferWriter $out)
decodePayload(ByteBufferReader $in)
handle(PacketHandlerInterface $handler)