From 44171aeb7fb45560721e205594ed88824aee4ec7 Mon Sep 17 00:00:00 2001 From: boubou19 Date: Wed, 24 Jul 2024 00:24:46 +0200 Subject: [PATCH] fix wrong array list --- .../mods/gregtech/machines/BlastFurnace.java | 13 +++++++------ .../gttweaker/mods/gregtech/machines/Canner.java | 3 ++- .../mods/gregtech/machines/Centrifuge.java | 10 +++++----- .../mods/gregtech/machines/ChemicalBath.java | 3 ++- .../mods/gregtech/machines/Electrolyzer.java | 9 +++++---- .../mods/gregtech/machines/ImplosionCompressor.java | 3 ++- .../gttweaker/mods/gregtech/machines/Lathe.java | 3 ++- .../gttweaker/mods/gregtech/machines/Mixer.java | 5 +++-- .../gttweaker/mods/gregtech/machines/Separator.java | 3 ++- 9 files changed, 30 insertions(+), 22 deletions(-) diff --git a/src/main/java/gttweaker/mods/gregtech/machines/BlastFurnace.java b/src/main/java/gttweaker/mods/gregtech/machines/BlastFurnace.java index d170f88..8663315 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/BlastFurnace.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/BlastFurnace.java @@ -5,6 +5,7 @@ import static gregtech.api.util.GT_RecipeConstants.COIL_HEAT; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -63,14 +64,14 @@ public static void addRecipe(IItemStack[] output, ILiquidStack fluidOutput, IIng protected void applySingleRecipe(ArgIterator i) { ItemStack input1 = i.nextItem(); ItemStack input2 = i.nextItem(); - List inputs = Arrays.asList(input1, input2); + List inputs =new ArrayList<>(Arrays.asList(input1, input2)); inputs.removeIf(Objects::isNull); FluidStack fluidInput = i.nextFluid(); FluidStack fluidOutput = i.nextFluid(); ItemStack output1 = i.nextItem(); ItemStack output2 = i.nextItem(); - List outputs = Arrays.asList(output1, output2); + List outputs = new ArrayList<>(Arrays.asList(output1, output2)); outputs.removeIf(Objects::isNull); int duration = i.nextInt(); int eut = i.nextInt(); @@ -108,13 +109,13 @@ public static void addRecipe(IItemStack[] output, ILiquidStack fluidInput, IIngr protected void applySingleRecipe(ArgIterator i) { ItemStack input1 = i.nextItem(); ItemStack input2 = i.nextItem(); - List inputs = Arrays.asList(input1, input2); + List inputs = new ArrayList<>(Arrays.asList(input1, input2)); inputs.removeIf(Objects::isNull); FluidStack fluidInput = i.nextFluid(); ItemStack output1 = i.nextItem(); ItemStack output2 = i.nextItem(); - List outputs = Arrays.asList(output1, output2); + List outputs =new ArrayList<>(Arrays.asList(output1, output2)); outputs.removeIf(Objects::isNull); int duration = i.nextInt(); int eut = i.nextInt(); @@ -148,12 +149,12 @@ public static void addRecipe(IItemStack[] output, IIngredient[] input, int durat protected void applySingleRecipe(ArgIterator i) { ItemStack input1 = i.nextItem(); ItemStack input2 = i.nextItem(); - List inputs = Arrays.asList(input1, input2); + List inputs = new ArrayList<>(Arrays.asList(input1, input2)); inputs.removeIf(Objects::isNull); ItemStack output1 = i.nextItem(); ItemStack output2 = i.nextItem(); - List outputs = Arrays.asList(output1, output2); + List outputs = new ArrayList<>(Arrays.asList(output1, output2)); outputs.removeIf(Objects::isNull); int duration = i.nextInt(); int eut = i.nextInt(); diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Canner.java b/src/main/java/gttweaker/mods/gregtech/machines/Canner.java index 3215bca..d224c21 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/Canner.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/Canner.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.cannerRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -73,7 +74,7 @@ protected void applySingleRecipe(ArgIterator i) { ItemStack input2 = i.nextItem(); ItemStack output1 = i.nextItem(); ItemStack output2 = i.nextItem(); - List outputs = Arrays.asList(output1, output2); + List outputs =new ArrayList<>(Arrays.asList(output1, output2)); outputs.removeIf(Objects::isNull); int duration = i.nextInt(); diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java b/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java index e66a269..db68f93 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -73,8 +74,7 @@ protected void applySingleRecipe(ArgIterator i) { ItemStack input2 = i.nextItem(); FluidStack fluidInput = i.nextFluid(); FluidStack fluidOutput = i.nextFluid(); - List outputs = Arrays - .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem()); + List outputs = new ArrayList<>(Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); int[] chances = i.nextIntArr(); @@ -122,13 +122,13 @@ protected void applySingleRecipe(ArgIterator i) { ItemStack input1 = i.nextItem(); int cellNumber = i.nextInt(); ItemStack input2 = cellNumber > 0 ? ItemList.Cell_Empty.get(cellNumber) : null; - List inputs = Arrays.asList(input1, input2); + List inputs =new ArrayList<>(Arrays.asList(input1, input2)); inputs.removeIf(Objects::isNull); FluidStack fluidInput = i.nextFluid(); FluidStack fluidOutput = i.nextFluid(); - List outputs = Arrays - .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem()); + List outputs =new ArrayList<>(Arrays + .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); int[] chances = i.nextIntArr(); diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java b/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java index 7b96cac..bd4b147 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.chemicalBathRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -61,7 +62,7 @@ public static void addRecipe(IItemStack[] output, IIngredient input, ILiquidStac protected void applySingleRecipe(ArgIterator i) { ItemStack input = i.nextItem(); FluidStack fluidInput = i.nextFluid(); - List outputs = Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem()); + List outputs =new ArrayList<>(Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); int[] chances = i.nextIntArr(); int duration = i.nextInt(); diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java b/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java index 537b8ae..d23ccd7 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.electrolyzerRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -71,8 +72,8 @@ protected void applySingleRecipe(ArgIterator i) { ItemStack[] inputs = new ItemStack[] { i.nextItem(), i.nextItem() }; FluidStack fluidInput = i.nextFluid(); FluidStack fluidOutput = i.nextFluid(); - List outputs = Arrays - .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem()); + List outputs =new ArrayList<>(Arrays + .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); RA.stdBuilder() @@ -113,8 +114,8 @@ protected void applySingleRecipe(ArgIterator i) { ItemStack[] inputs = new ItemStack[] { i.nextItem(), i.nextItem() }; FluidStack fluidInput = i.nextFluid(); FluidStack fluidOutput = i.nextFluid(); - List outputs = Arrays - .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem()); + List outputs =new ArrayList<>(Arrays + .asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); RA.stdBuilder() diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java b/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java index 5ccff54..923fd1e 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java @@ -6,6 +6,7 @@ import static gregtech.api.util.GT_RecipeConstants.ADDITIVE_AMOUNT; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -68,7 +69,7 @@ protected void applySingleRecipe(ArgIterator i) { int additiveAmount = i.nextInt(); ItemStack output1 = i.nextItem(); ItemStack output2 = i.nextItem(); - List outputs = Arrays.asList(output1, output2); + List outputs =new ArrayList<>(Arrays.asList(output1, output2)); outputs.removeIf(Objects::isNull); RA.stdBuilder() .itemInputs(input) diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java b/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java index 15120ef..86dfe66 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.latheRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -65,7 +66,7 @@ public static void addRecipe(IItemStack[] outputs, IIngredient input, int durati @Override protected void applySingleRecipe(ArgIterator i) { ItemStack input = i.nextItem(); - List outputs = Arrays.asList(i.nextItem(), i.nextItem()); + List outputs =new ArrayList<>(Arrays.asList(i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); RA.stdBuilder() diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java b/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java index d518041..2e13641 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.mixerRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -59,7 +60,7 @@ public static void addRecipe(IItemStack output, ILiquidStack fluidOutput, IIngre @Override protected void applySingleRecipe(ArgIterator i) { - List inputs = Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem()); + List inputs =new ArrayList<>(Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem())); inputs.removeIf(Objects::isNull); RA.stdBuilder() @@ -93,7 +94,7 @@ public static void addRecipe(IItemStack output, IIngredient[] input, int duratio @Override protected void applySingleRecipe(ArgIterator i) { - List inputs = Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem()); + List inputs =new ArrayList<>(Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem())); inputs.removeIf(Objects::isNull); RA.stdBuilder() diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Separator.java b/src/main/java/gttweaker/mods/gregtech/machines/Separator.java index 6fa7401..f403214 100644 --- a/src/main/java/gttweaker/mods/gregtech/machines/Separator.java +++ b/src/main/java/gttweaker/mods/gregtech/machines/Separator.java @@ -4,6 +4,7 @@ import static gregtech.api.recipe.RecipeMaps.electroMagneticSeparatorRecipes; import static gttweaker.util.ArrayHelper.itemOrNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -58,7 +59,7 @@ public static void addRecipe(IItemStack[] output, IIngredient input, int[] outCh @Override protected void applySingleRecipe(ArgIterator i) { ItemStack input = i.nextItem(); - List outputs = Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem()); + List outputs =new ArrayList<>(Arrays.asList(i.nextItem(), i.nextItem(), i.nextItem())); outputs.removeIf(Objects::isNull); RA.stdBuilder()