13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol\types\inventory\stackrequest;
18use pocketmine\network\mcpe\protocol\types\GetTypeIdFromConstTrait;
24 use GetTypeIdFromConstTrait;
26 public const ID = ItemStackRequestActionType::CREATIVE_CREATE;
28 public function __construct(
29 private int $creativeItemId,
30 private int $repetitions
33 public function getCreativeItemId() :
int{
return $this->creativeItemId; }
35 public function getRepetitions() :
int{
return $this->repetitions; }
38 $creativeItemId = $in->readCreativeItemNetId();
40 return new self($creativeItemId, $repetitions);
44 $out->writeCreativeItemNetId($this->creativeItemId);
45 $out->putByte($this->repetitions);