From bfd4b9dbda43a1295652e30c57e7279468ddfc92 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 11 Sep 2020 00:00:16 +0200 Subject: [PATCH] Fixed processing recipe packet data --- .../processing/ProcessingRecipeSerializer.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java index 6c2644a95..031a7f973 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java @@ -120,13 +120,20 @@ public class ProcessingRecipeSerializer> extends F NonNullList results = NonNullList.create(); NonNullList fluidResults = NonNullList.create(); - for (int i = 0; i < buffer.readVarInt(); i++) + int size = buffer.readVarInt(); + for (int i = 0; i < size; i++) ingredients.add(Ingredient.read(buffer)); - for (int i = 0; i < buffer.readVarInt(); i++) + + size = buffer.readVarInt(); + for (int i = 0; i < size; i++) fluidIngredients.add(FluidIngredient.read(buffer)); - for (int i = 0; i < buffer.readVarInt(); i++) + + size = buffer.readVarInt(); + for (int i = 0; i < size; i++) results.add(ProcessingOutput.read(buffer)); - for (int i = 0; i < buffer.readVarInt(); i++) + + size = buffer.readVarInt(); + for (int i = 0; i < size; i++) fluidResults.add(FluidStack.readFromPacket(buffer)); return new ProcessingRecipeBuilder<>(factory, recipeId).withItemIngredients(ingredients)