diff --git a/src/main/groovy-tests/recipeRecyclingTests.groovy b/src/main/groovy-tests/recipeRecyclingTests.groovy index c0d8cea7..952d9fa7 100644 --- a/src/main/groovy-tests/recipeRecyclingTests.groovy +++ b/src/main/groovy-tests/recipeRecyclingTests.groovy @@ -53,5 +53,5 @@ createRecipe(metaitem('battery_buffer.uhv.8'), [ [null, metaitem('battery_buffer.uv.8'), null], [null, null, null]]) -// Add / Change recycling to a stack, including fluids, although fluids are not included in recycling calculations -changeStackRecycling(metaitem('battery_buffer.uhv.16'), [metaitem('battery_buffer.uv.16'), metaitem('charger.uv'), fluid('soldering_alloy') * 1152]) \ No newline at end of file +// Add / Change recycling to a stack +changeStackRecycling(metaitem('battery_buffer.uhv.16'), [metaitem('battery_buffer.uv.16'), metaitem('charger.uv')]) \ No newline at end of file diff --git a/src/main/java/com/nomiceu/nomilabs/groovy/ReplaceRecipe.java b/src/main/java/com/nomiceu/nomilabs/groovy/ReplaceRecipe.java index a2d5eff0..d3ee0428 100644 --- a/src/main/java/com/nomiceu/nomilabs/groovy/ReplaceRecipe.java +++ b/src/main/java/com/nomiceu/nomilabs/groovy/ReplaceRecipe.java @@ -12,7 +12,6 @@ import gregtech.api.recipes.RecyclingHandler; import gregtech.api.recipes.category.GTRecipeCategory; import gregtech.api.recipes.category.RecipeCategories; -import gregtech.api.recipes.ingredients.GTRecipeFluidInput; import gregtech.api.recipes.ingredients.GTRecipeInput; import gregtech.api.recipes.ingredients.GTRecipeItemInput; import gregtech.api.recipes.ingredients.GTRecipeOreInput; @@ -24,12 +23,12 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.crafting.IShapedRecipe; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.common.registry.ForgeRegistries; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; @@ -109,13 +108,7 @@ public static void createRecipe(ItemStack output, List> input) public static void changeStackRecycling(ItemStack output, List ingredients) { - List gtInputs = new ArrayList<>(); - for (var input : ingredients) { - var gtInput = ofGroovyIngredientIncludingFluids(input); - if (gtInput != null) - gtInputs.add(gtInput); - } - LabsVirtualizedRegistries.REPLACE_RECIPE_MANAGER.registerOre(output, RecyclingHandler.getRecyclingIngredients(gtInputs, output.getCount())); + registerRecycling(output, Collections.singletonList(ingredients)); } private static IShapedRecipe validate(ResourceLocation name, ItemStack output, boolean validateOutput) { @@ -186,17 +179,6 @@ private static GTRecipeInput ofGroovyIngredient(IIngredient ingredient) { return null; } - // TODO Remove? GTRecipeFluidInputs are not included in recycling calculations - @Nullable - private static GTRecipeInput ofGroovyIngredientIncludingFluids(IIngredient ingredient) { - var gtInput = ofGroovyIngredient(ingredient); - if (gtInput != null) return gtInput; - if ((Object) ingredient instanceof FluidStack stack) { - return new GTRecipeFluidInput(stack); - } - return null; - } - private static ResourceLocation getRecipeName(ItemStack oldOutput) { ResourceLocation name = null; for (IRecipe recipe : ForgeRegistries.RECIPES) {