From 8c24d65cc4e92f8768640895718ff5eee3775529 Mon Sep 17 00:00:00 2001 From: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Date: Wed, 26 Jul 2023 16:53:13 +0300 Subject: [PATCH 1/2] fix steam macerator generating byproducts --- ...GregtechMetaTileEntity_SteamMacerator.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index 0efa2d1220..f4b3e885a5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -7,6 +7,10 @@ import static gregtech.api.GregTech_API.sBlockCasings1; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; +import java.util.ArrayList; + +import javax.annotation.Nonnull; + import net.minecraft.item.ItemStack; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; @@ -18,8 +22,10 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_SteamMultiBase; @@ -123,4 +129,23 @@ public GT_Recipe.GT_Recipe_Map getRecipeMap() { return GT_Recipe.GT_Recipe_Map.sMaceratorRecipes; } + @Override + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic() { + + @Override @Nonnull + public GT_ParallelHelper createParallelHelper(@Nonnull GT_Recipe recipe) { + return super.createParallelHelper(recipe).setCustomItemOutputCalculation(parallel -> { + ArrayList items = new ArrayList<>(); + ItemStack output = recipe.getOutput(0); + if (output != null) { + output = output.copy(); + output.stackSize *= parallel; + items.add(output); + } + return items.toArray(new ItemStack[0]); + }); + } + }; + } } From 157d69fc8e9d14a3cd37583463092c1357e12c77 Mon Sep 17 00:00:00 2001 From: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com> Date: Wed, 26 Jul 2023 16:55:40 +0300 Subject: [PATCH 2/2] spotless --- .../steam/GregtechMetaTileEntity_SteamMacerator.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java index f4b3e885a5..eccdc64f70 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamMacerator.java @@ -132,8 +132,9 @@ public GT_Recipe.GT_Recipe_Map getRecipeMap() { @Override protected ProcessingLogic createProcessingLogic() { return new ProcessingLogic() { - - @Override @Nonnull + + @Override + @Nonnull public GT_ParallelHelper createParallelHelper(@Nonnull GT_Recipe recipe) { return super.createParallelHelper(recipe).setCustomItemOutputCalculation(parallel -> { ArrayList items = new ArrayList<>();