28 use GetTypeIdFromConstTrait;
30 public const ID = ItemStackRequestActionType::CRAFTING_GRINDSTONE;
32 public function __construct(
33 private int $recipeId,
34 private int $repairCost,
35 private int $repetitions
38 public function getRecipeId() :
int{
return $this->recipeId; }
43 public function getRepetitions() : int{ return $this->repetitions; }
45 public static function read(ByteBufferReader $in) : self{
47 $repairCost = VarInt::readSignedInt($in);
48 $repetitions = Byte::readUnsigned($in);
50 return new self($recipeId, $repairCost, $repetitions);
53 public function write(ByteBufferWriter $out) : void{
54 CommonTypes::writeRecipeNetId($out, $this->recipeId);
55 VarInt::writeSignedInt($out, $this->repairCost);
56 Byte::writeUnsigned($out, $this->repetitions);