27 use GetTypeIdFromConstTrait;
29 public const ID = ItemStackRequestActionType::CRAFTING_RECIPE_AUTO;
36 private int $recipeId,
37 private int $repetitions,
38 private int $repetitions2,
39 private array $ingredients
42 public function getRecipeId() : int{ return $this->recipeId; }
44 public function getRepetitions() : int{ return $this->repetitions; }
46 public function getRepetitions2() : int{ return $this->repetitions2; }
55 $recipeId = $in->readRecipeNetId();
59 for($i = 0, $count = $in->
getByte(); $i < $count; ++$i){
60 $ingredients[] = $in->getRecipeIngredient();
62 return new self($recipeId, $repetitions, $repetitions2, $ingredients);
66 $out->writeRecipeNetId($this->recipeId);
67 $out->putByte($this->repetitions);
68 $out->putByte($this->repetitions2);
69 $out->putByte(count($this->ingredients));
70 foreach($this->ingredients as $ingredient){
71 $out->putRecipeIngredient($ingredient);