From 1657bd42bad0b8f4ec66468f1681d359f0ff31b6 Mon Sep 17 00:00:00 2001 From: IvanCraft623 Date: Thu, 15 Aug 2024 17:07:53 -0500 Subject: [PATCH] Re-add repetition2 field --- .../stackrequest/CraftRecipeAutoStackRequestAction.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/types/inventory/stackrequest/CraftRecipeAutoStackRequestAction.php b/src/types/inventory/stackrequest/CraftRecipeAutoStackRequestAction.php index d274f236..bc7dccc0 100644 --- a/src/types/inventory/stackrequest/CraftRecipeAutoStackRequestAction.php +++ b/src/types/inventory/stackrequest/CraftRecipeAutoStackRequestAction.php @@ -35,6 +35,7 @@ final class CraftRecipeAutoStackRequestAction extends ItemStackRequestAction{ final public function __construct( private int $recipeId, private int $repetitions, + private int $repetitions2, private array $ingredients ){} @@ -42,6 +43,8 @@ public function getRecipeId() : int{ return $this->recipeId; } public function getRepetitions() : int{ return $this->repetitions; } + public function getRepetitions2() : int{ return $this->repetitions2; } + /** * @return RecipeIngredient[] * @phpstan-return list @@ -51,18 +54,18 @@ public function getIngredients() : array{ return $this->ingredients; } public static function read(PacketSerializer $in) : self{ $recipeId = $in->readRecipeNetId(); $repetitions = $in->getByte(); - $in->getByte(); //repetitions property is sent twice, mojang... + $repetition2 = $in->getByte(); //repetitions property is sent twice, mojang... $ingredients = []; for($i = 0, $count = $in->getByte(); $i < $count; ++$i){ $ingredients[] = $in->getRecipeIngredient(); } - return new self($recipeId, $repetitions, $ingredients); + return new self($recipeId, $repetitions, $repetitions2, $ingredients); } public function write(PacketSerializer $out) : void{ $out->writeRecipeNetId($this->recipeId); $out->putByte($this->repetitions); - $out->putByte($this->repetitions); //... + $out->putByte($this->repetition2); $out->putByte(count($this->ingredients)); foreach($this->ingredients as $ingredient){ $out->putRecipeIngredient($ingredient);