Skip to content

Commit

Permalink
Fix order of timesCrafted and numberOfRequestedCrafts
Browse files Browse the repository at this point in the history
  • Loading branch information
Alemiz112 committed Aug 14, 2024
1 parent 2e6dfd1 commit 15613f3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected void writeRequestActionData(ByteBuf byteBuf, ItemStackRequestAction ac
VarInts.writeInt(byteBuf, ((CraftGrindstoneAction) action).getRepairCost());
} else if (action.getType().equals(ItemStackRequestActionType.CRAFT_RECIPE_AUTO)) {
VarInts.writeUnsignedInt(byteBuf, ((AutoCraftRecipeAction) action).getRecipeNetworkId());
byteBuf.writeByte(((AutoCraftRecipeAction) action).getNumberOfRequestedCrafts());
byteBuf.writeByte(((AutoCraftRecipeAction) action).getNumberOfRequestedCrafts()); // since v712
byteBuf.writeByte(((AutoCraftRecipeAction) action).getTimesCrafted());
List<ItemDescriptorWithCount> ingredients = ((AutoCraftRecipeAction) action).getIngredients();
byteBuf.writeByte(ingredients.size());
Expand All @@ -80,8 +80,8 @@ protected ItemStackRequestAction readRequestActionData(ByteBuf byteBuf, ItemStac
return new CraftGrindstoneAction(VarInts.readUnsignedInt(byteBuf), byteBuf.readByte(), VarInts.readInt(byteBuf));
} else if (type.equals(ItemStackRequestActionType.CRAFT_RECIPE_AUTO)) {
int recipeNetworkId = VarInts.readUnsignedInt(byteBuf);
int numberOfRequestedCrafts = byteBuf.readUnsignedByte(); // since v712
int timesCrafted = byteBuf.readUnsignedByte();
int numberOfRequestedCrafts = byteBuf.readUnsignedByte();
List<ItemDescriptorWithCount> ingredients = new ObjectArrayList<>();
this.readArray(byteBuf, ingredients, ByteBuf::readUnsignedByte, this::readIngredient);
return new AutoCraftRecipeAction(recipeNetworkId, timesCrafted, ingredients, numberOfRequestedCrafts);
Expand Down

0 comments on commit 15613f3

Please sign in to comment.