24 public function __construct(
26 private string $recipeId,
31 private string $blockName,
32 private int $recipeNetId
34 parent::__construct($typeId);
37 public function getRecipeId() :
string{
return $this->recipeId; }
45 public function getOutput() :
ItemStack{
return $this->output; }
47 public function getBlockName() :
string{
return $this->blockName; }
49 public function getRecipeNetId() :
int{
return $this->recipeNetId; }
51 public static function decode(
int $typeId, ByteBufferReader $in) :
self{
52 $recipeId = CommonTypes::getString($in);
53 $template = CommonTypes::getRecipeIngredient($in);
54 $input = CommonTypes::getRecipeIngredient($in);
55 $addition = CommonTypes::getRecipeIngredient($in);
56 $output = CommonTypes::getItemStackWithoutStackId($in);
57 $blockName = CommonTypes::getString($in);
58 $recipeNetId = CommonTypes::readRecipeNetId($in);
72 public function encode(ByteBufferWriter $out) :
void{
73 CommonTypes::putString($out, $this->recipeId);
74 CommonTypes::putRecipeIngredient($out, $this->
template);
75 CommonTypes::putRecipeIngredient($out, $this->input);
76 CommonTypes::putRecipeIngredient($out, $this->addition);
77 CommonTypes::putItemStackWithoutStackId($out, $this->output);
78 CommonTypes::putString($out, $this->blockName);
79 CommonTypes::writeRecipeNetId($out, $this->recipeNetId);