From 05877d269c462e42fdebbdd518cf7a6f32b2d816 Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Thu, 26 Sep 2024 00:53:27 -0400 Subject: [PATCH 1/6] Collisions (#3284) --- .../CircuitGeneration/CircuitPartLoader.java | 15 +++--- .../loader/NaquadahReworkRecipeLoader.java | 8 --- .../goodgenerator/util/CrackRecipeAdder.java | 39 -------------- .../loaders/oreprocessing/ProcessingDust.java | 6 ++- .../loaders/oreprocessing/ProcessingFoil.java | 3 ++ .../oreprocessing/ProcessingIngot.java | 3 ++ .../oreprocessing/ProcessingNugget.java | 2 + .../oreprocessing/ProcessingShaping.java | 3 ++ .../oreprocessing/ProcessingStick.java | 5 +- .../postload/recipes/ChemicalRecipes.java | 5 +- .../postload/recipes/DistilleryRecipes.java | 23 ++++---- .../recipes/FluidExtractorRecipes.java | 8 --- .../recipes/FluidSolidifierRecipes.java | 52 ++++--------------- .../preload/LoaderGTOreDictionary.java | 1 - .../core/material/MaterialMisc.java | 16 ------ .../core/recipe/RecipesGeneral.java | 10 +--- .../register/WerkstoffMaterialPool.java | 14 ----- .../java/gtnhlanth/loader/RecipeLoader.java | 2 +- 18 files changed, 54 insertions(+), 161 deletions(-) diff --git a/src/main/java/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java b/src/main/java/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java index ea4d222cacd..b3c59f42883 100644 --- a/src/main/java/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java +++ b/src/main/java/bartworks/system/material/CircuitGeneration/CircuitPartLoader.java @@ -13,13 +13,10 @@ package bartworks.system.material.CircuitGeneration; -import static gregtech.api.enums.ItemList.Circuit_Board_Advanced; -import static gregtech.api.enums.ItemList.Circuit_Board_Basic; import static gregtech.api.enums.ItemList.Circuit_Board_Bio; import static gregtech.api.enums.ItemList.Circuit_Board_Bio_Ultra; import static gregtech.api.enums.ItemList.Circuit_Board_Coated; import static gregtech.api.enums.ItemList.Circuit_Board_Coated_Basic; -import static gregtech.api.enums.ItemList.Circuit_Board_Elite; import static gregtech.api.enums.ItemList.Circuit_Board_Epoxy; import static gregtech.api.enums.ItemList.Circuit_Board_Epoxy_Advanced; import static gregtech.api.enums.ItemList.Circuit_Board_Fiberglass; @@ -149,6 +146,12 @@ public static void makeCircuitParts() { } for (ItemList single : CIRCUIT_PARTS) { + // Skip placeholder values and maintain the ids + if (single == null) { + CircuitImprintLoader.reverseIDs--; + continue; + } + if (!single.hasBeenSet()) continue; ItemStack itemStack = single.get(1); if (!GTUtility.isStackValid(itemStack)) continue; @@ -194,9 +197,9 @@ public static void makeCircuitParts() { */ private static final List CIRCUIT_PARTS = Collections.unmodifiableList( Arrays.asList( - Circuit_Board_Basic, - Circuit_Board_Advanced, - Circuit_Board_Elite, + null, + null, + null, Circuit_Parts_Crystal_Chip_Elite, Circuit_Parts_Crystal_Chip_Master, Circuit_Board_Coated, diff --git a/src/main/java/goodgenerator/loader/NaquadahReworkRecipeLoader.java b/src/main/java/goodgenerator/loader/NaquadahReworkRecipeLoader.java index 855f3b9bbe9..56b21238fd0 100644 --- a/src/main/java/goodgenerator/loader/NaquadahReworkRecipeLoader.java +++ b/src/main/java/goodgenerator/loader/NaquadahReworkRecipeLoader.java @@ -178,14 +178,6 @@ public static void RecipeLoad() { .noOptimize() .addTo(neutronActivatorRecipes); - // Fix shit - GTValues.RA.stdBuilder() - .itemInputs(lowQualityNaquadriaSolution.get(OrePrefixes.cell, 1)) - .itemOutputs(Materials.Tin.getDust(2)) - .duration(16 * SECONDS + 14 * TICKS) - .eut(4) - .addTo(maceratorRecipes); - // Naquadah Rework Line GTValues.RA.stdBuilder() .itemInputs(naquadahEarth.get(OrePrefixes.dust, 2), GTUtility.getIntegratedCircuit(1)) diff --git a/src/main/java/goodgenerator/util/CrackRecipeAdder.java b/src/main/java/goodgenerator/util/CrackRecipeAdder.java index 489732e0683..14ebd378d68 100644 --- a/src/main/java/goodgenerator/util/CrackRecipeAdder.java +++ b/src/main/java/goodgenerator/util/CrackRecipeAdder.java @@ -520,12 +520,6 @@ public static void registerWire(int ID, Werkstoff material, int aAmperage, int a true, false).getStackForm(1L)); } - GTValues.RA.stdBuilder() - .itemInputs(material.get(OrePrefixes.ingot, 1), GTUtility.getIntegratedCircuit(1)) - .itemOutputs(material.get(OrePrefixes.wireGt01, 2)) - .duration(5 * SECONDS) - .eut(4) - .addTo(wiremillRecipes); GTValues.RA.stdBuilder() .itemInputs(material.get(OrePrefixes.ingot, 1), GTUtility.getIntegratedCircuit(2)) .itemOutputs(material.get(OrePrefixes.wireGt02, 1)) @@ -556,12 +550,6 @@ public static void registerWire(int ID, Werkstoff material, int aAmperage, int a .duration(17 * SECONDS + 10 * TICKS) .eut(4) .addTo(wiremillRecipes); - GTValues.RA.stdBuilder() - .itemInputs(material.get(OrePrefixes.stick, 1), GTUtility.getIntegratedCircuit(1)) - .itemOutputs(material.get(OrePrefixes.wireGt01, 1)) - .duration(2 * SECONDS + 10 * TICKS) - .eut(4) - .addTo(wiremillRecipes); GTValues.RA.stdBuilder() .itemInputs(material.get(OrePrefixes.stick, 2), GTUtility.getIntegratedCircuit(2)) .itemOutputs(material.get(OrePrefixes.wireGt02, 1)) @@ -586,38 +574,11 @@ public static void registerWire(int ID, Werkstoff material, int aAmperage, int a .duration(12 * SECONDS + 10 * TICKS) .eut(4) .addTo(wiremillRecipes); - GTValues.RA.stdBuilder() - .itemInputs(material.get(OrePrefixes.stick, 16), GTUtility.getIntegratedCircuit(16)) - .itemOutputs(material.get(OrePrefixes.wireGt16, 1)) - .duration(15 * SECONDS) - .eut(4) - .addTo(wiremillRecipes); - GTValues.RA.stdBuilder() - .itemInputs(material.get(OrePrefixes.ingot, 1), GTUtility.getIntegratedCircuit(3)) - .itemOutputs(material.get(OrePrefixes.wireFine, 8)) - .duration(5 * SECONDS) - .eut(4) - .addTo(wiremillRecipes); GTValues.RA.stdBuilder() .itemInputs(material.get(OrePrefixes.stick, 1), GTUtility.getIntegratedCircuit(3)) .itemOutputs(material.get(OrePrefixes.wireFine, 4)) .duration(2 * SECONDS + 10 * TICKS) .eut(4) .addTo(wiremillRecipes); - GTValues.RA.stdBuilder() - .itemInputs(material.get(OrePrefixes.wireGt01, 1), GTUtility.getIntegratedCircuit(1)) - .itemOutputs(material.get(OrePrefixes.wireFine, 4)) - .duration(10 * SECONDS) - .eut(8) - .addTo(wiremillRecipes); - GTValues.RA.stdBuilder() - .itemInputs(material.get(OrePrefixes.ingot, 1), ItemList.Shape_Extruder_Wire.get(0)) - .itemOutputs(material.get(OrePrefixes.wireGt01, 2)) - .duration( - material.getStats() - .getMass() * 8 - * TICKS) - .eut(TierEU.RECIPE_HV) - .addTo(extruderRecipes); } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java index 0241b1593e9..2407a48f70e 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingDust.java @@ -110,7 +110,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic } else if (!aMaterial.contains(SubTag.NO_WORKING)) { if ((!OrePrefixes.block.isIgnored(aMaterial)) && (null == GTOreDictUnificator.get(OrePrefixes.gem, aMaterial, 1L)) - && GTOreDictUnificator.get(OrePrefixes.block, aMaterial, 1L) != null) { + && GTOreDictUnificator.get(OrePrefixes.block, aMaterial, 1L) != null + && (aMaterial != Materials.Clay)) { GTValues.RA.stdBuilder() .itemInputs(GTOreDictUnificator.get(OrePrefixes.dust, aMaterial, 9)) @@ -133,7 +134,8 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic && (aMaterial != Materials.Paper) && (aMaterial != MaterialsUEVplus.TranscendentMetal) && (aMaterial != Materials.Clay) - && (aMaterial != Materials.Wood)) { + && (aMaterial != Materials.Wood) + && (aMaterial != Materials.Carbon)) { // compressor recipe { if (GTOreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L) != null) { diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java index 3839c38c660..7fc95ae1179 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java @@ -23,6 +23,9 @@ public ProcessingFoil() { @Override public void registerOre(OrePrefixes prefix, Materials material, String oreDictName, String modName, ItemStack stack) { + // Blacklist materials which are handled by Werkstoff loader + if (material == Materials.Calcium || material == Materials.Magnesia) return; + registerBenderRecipe(material); registerCover(stack, material); } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java index 7d27c2ee16f..6724a877988 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java @@ -40,6 +40,9 @@ public ProcessingIngot() { @Override public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + // Blacklist materials which are handled by Werkstoff loader + if (aMaterial == Materials.Calcium || aMaterial == Materials.Magnesia) return; + boolean aNoSmashing = aMaterial.contains(SubTag.NO_SMASHING); boolean aStretchy = aMaterial.contains(SubTag.STRETCHY); boolean aNoSmelting = aMaterial.contains(SubTag.NO_SMELTING); diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java index 624730af3e4..b4df540003e 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java @@ -29,6 +29,8 @@ public ProcessingNugget() { @Override public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + // Blacklist materials which are handled by Werkstoff loader + if (aMaterial == Materials.Calcium || aMaterial == Materials.Magnesia) return; if (aMaterial.contains(SubTag.SMELTING_TO_GEM) && GTOreDictUnificator.get(OrePrefixes.gem, aMaterial.mSmeltInto, 1L) != null) { diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java index 6c45761da0a..9f90cdbfff1 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java @@ -34,6 +34,9 @@ public ProcessingShaping() { @Override public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { + // Blacklist materials which are handled by Werkstoff loader + if (aMaterial == Materials.Calcium || aMaterial == Materials.Magnesia) return; + if (((aMaterial == Materials.Glass) || (GTOreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L) != null)) && (!aMaterial.contains(SubTag.NO_SMELTING))) { long aMaterialMass = aMaterial.getMass(); diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java index 3949b2f3afb..7698e017d75 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java @@ -30,7 +30,10 @@ public ProcessingStick() { public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { // Blacklist materials which are handled by Werkstoff loader - if (aMaterial == Materials.Salt || aMaterial == Materials.RockSalt || aMaterial == Materials.Spodumene) return; + if (aMaterial == Materials.Salt || aMaterial == Materials.RockSalt + || aMaterial == Materials.Spodumene + || aMaterial == Materials.Calcium + || aMaterial == Materials.Magnesia) return; if (aMaterial.getProcessingMaterialTierEU() < TierEU.IV) { GTModHandler.addCraftingRecipe( diff --git a/src/main/java/gregtech/loaders/postload/recipes/ChemicalRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/ChemicalRecipes.java index ab3cd43dce4..792a77d7c72 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/ChemicalRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/ChemicalRecipes.java @@ -11,7 +11,6 @@ import static gregtech.api.util.GTRecipeBuilder.SECONDS; import static gregtech.api.util.GTRecipeBuilder.TICKS; import static gregtech.api.util.GTRecipeConstants.UniversalChemical; -import static gtPlusPlus.core.material.MaterialMisc.CALCIUM_CHLORIDE; import static gtPlusPlus.core.material.MaterialMisc.SODIUM_NITRATE; import static net.minecraftforge.fluids.FluidRegistry.getFluidStack; @@ -5847,7 +5846,7 @@ public void multiblockOnly() { GTValues.RA.stdBuilder() .itemInputs( GTUtility.getIntegratedCircuit(1), - CALCIUM_CHLORIDE.getDust(1), + WerkstoffLoader.CalciumChloride.get(OrePrefixes.dust, 1), GTOreDictUnificator.get(OrePrefixes.dust, MaterialsKevlar.ParaPhenylenediamine, 9), GTOreDictUnificator.get(OrePrefixes.dust, MaterialsKevlar.TerephthaloylChloride, 9)) .fluidInputs(MaterialsKevlar.NMethylIIPyrrolidone.getFluid(1000)) @@ -5861,7 +5860,7 @@ public void multiblockOnly() { GTValues.RA.stdBuilder() .itemInputs( GTUtility.getIntegratedCircuit(9), - CALCIUM_CHLORIDE.getDust(7), + WerkstoffLoader.CalciumChloride.get(OrePrefixes.dust, 7), GTOreDictUnificator.get(OrePrefixes.dust, MaterialsKevlar.ParaPhenylenediamine, 63), GTOreDictUnificator.get(OrePrefixes.dust, MaterialsKevlar.TerephthaloylChloride, 63)) .fluidInputs(MaterialsKevlar.NMethylIIPyrrolidone.getFluid(7000)) diff --git a/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java index 5354067da3e..e22cf2ef7e0 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/DistilleryRecipes.java @@ -460,6 +460,19 @@ public void distillationTowerRecipes() { .eut(256) .addTo(distillationTowerRecipes); + GTValues.RA.stdBuilder() + .itemInputs(GTUtility.getIntegratedCircuit(3)) + .fluidInputs(Materials.WoodTar.getFluid(1000)) + .fluidOutputs( + Materials.Creosote.getFluid(250), + Materials.Phenol.getFluid(100), + Materials.Benzene.getFluid(400), + Materials.Toluene.getFluid(100), + MaterialsKevlar.IVDimethylbenzene.getFluid(150)) + .duration(2 * SECONDS) + .eut(256) + .addTo(distillationTowerRecipes); + GTValues.RA.stdBuilder() .itemInputs(GTUtility.getIntegratedCircuit(3)) .itemOutputs(Materials.Charcoal.getDustSmall(1)) @@ -607,16 +620,6 @@ public void distillationTowerRecipes() { } public void universalDistillationTowerRecipes() { - addUniversalDistillationRecipewithCircuit( - Materials.WoodTar.getFluid(1000), - new ItemStack[] { GTUtility.getIntegratedCircuit(3) }, - new FluidStack[] { Materials.Creosote.getFluid(250), Materials.Phenol.getFluid(100), - Materials.Benzene.getFluid(400), Materials.Toluene.getFluid(100), - MaterialsKevlar.IVDimethylbenzene.getFluid(150) }, - GTValues.NI, - 40, - 256); - addUniversalDistillationRecipewithCircuit( Materials.CharcoalByproducts.getGas(1000), new ItemStack[] { GTUtility.getIntegratedCircuit(1) }, diff --git a/src/main/java/gregtech/loaders/postload/recipes/FluidExtractorRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/FluidExtractorRecipes.java index cfcfec80429..753e8c5143e 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/FluidExtractorRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/FluidExtractorRecipes.java @@ -4,7 +4,6 @@ import static gregtech.api.enums.Mods.IndustrialCraft2; import static gregtech.api.enums.Mods.NewHorizonsCoreMod; import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.recipe.RecipeMaps.fluidExtractionRecipes; import static gregtech.api.util.GTModHandler.getModItem; import static gregtech.api.util.GTRecipeBuilder.SECONDS; @@ -136,13 +135,6 @@ public void run() { .eut(4) .addTo(fluidExtractionRecipes); - GTValues.RA.stdBuilder() - .itemInputs(getModItem(Thaumcraft.ID, "ItemResource", 1, 3)) - .fluidOutputs(Materials.Mercury.getFluid(1000L)) - .duration(6 * SECONDS + 8 * TICKS) - .eut(4) - .addTo(fluidExtractionRecipes); - GTValues.RA.stdBuilder() .itemInputs(GTOreDictUnificator.get(OrePrefixes.gem, Materials.Mercury, 1L)) .fluidOutputs(Materials.Mercury.getFluid(1000L)) diff --git a/src/main/java/gregtech/loaders/postload/recipes/FluidSolidifierRecipes.java b/src/main/java/gregtech/loaders/postload/recipes/FluidSolidifierRecipes.java index 69a82711e9d..b27911a4f8a 100644 --- a/src/main/java/gregtech/loaders/postload/recipes/FluidSolidifierRecipes.java +++ b/src/main/java/gregtech/loaders/postload/recipes/FluidSolidifierRecipes.java @@ -2,7 +2,6 @@ import static gregtech.api.enums.Mods.IndustrialCraft2; import static gregtech.api.enums.Mods.Railcraft; -import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.recipe.RecipeMaps.fluidSolidifierRecipes; import static gregtech.api.util.GTModHandler.getModItem; import static gregtech.api.util.GTRecipeBuilder.INGOTS; @@ -33,50 +32,17 @@ public class FluidSolidifierRecipes implements Runnable { @Override public void run() { - Materials[] materialArray = new Materials[] { Materials.Iron, Materials.WroughtIron, Materials.Gold, - Materials.Bronze, Materials.Copper, Materials.AnnealedCopper, Materials.Tin, Materials.Lead, - Materials.Steel }; - - ItemStack[] materialCasing = new ItemStack[] { ItemList.IC2_Item_Casing_Iron.get(1L), - ItemList.IC2_Item_Casing_Iron.get(1L), ItemList.IC2_Item_Casing_Gold.get(1L), - ItemList.IC2_Item_Casing_Bronze.get(1L), ItemList.IC2_Item_Casing_Copper.get(1L), - ItemList.IC2_Item_Casing_Copper.get(1L), ItemList.IC2_Item_Casing_Tin.get(1L), - ItemList.IC2_Item_Casing_Lead.get(1L), ItemList.IC2_Item_Casing_Steel.get(1L) }; - - for (int i = 0; i < materialArray.length; i++) { - if (materialArray[i].mStandardMoltenFluid == null) { - continue; - } - - GTValues.RA.stdBuilder() - .itemInputs(ItemList.Shape_Mold_Casing.get(0L)) - .itemOutputs(materialCasing[i]) - .fluidInputs(materialArray[i].getMolten(72L)) - .duration(16 * TICKS) - .eut(8) - .addTo(fluidSolidifierRecipes); - } - - { - ItemStack flask = ItemList.VOLUMETRIC_FLASK.get(1); - NBTTagCompound nbtFlask = new NBTTagCompound(); - nbtFlask.setInteger("Capacity", 1000); - flask.setTagCompound(nbtFlask); - GTValues.RA.stdBuilder() - .itemInputs(ItemList.Shape_Mold_Ball.get(0)) - .itemOutputs(flask) - .fluidInputs(new FluidStack(FluidRegistry.getFluid("molten.borosilicateglass"), 144)) - .duration(2 * SECONDS + 4 * TICKS) - .eut(TierEU.RECIPE_LV) - .addTo(fluidSolidifierRecipes); - } + ItemStack flask = ItemList.VOLUMETRIC_FLASK.get(1); + NBTTagCompound nbtFlask = new NBTTagCompound(); + nbtFlask.setInteger("Capacity", 1000); + flask.setTagCompound(nbtFlask); GTValues.RA.stdBuilder() - .itemInputs(ItemList.Shape_Mold_Ball.get(0L)) - .itemOutputs(getModItem(Thaumcraft.ID, "ItemResource", 1, 3)) - .fluidInputs(Materials.Mercury.getFluid(1000L)) - .duration(6 * SECONDS + 8 * TICKS) - .eut(4) + .itemInputs(ItemList.Shape_Mold_Ball.get(0)) + .itemOutputs(flask) + .fluidInputs(new FluidStack(FluidRegistry.getFluid("molten.borosilicateglass"), 144)) + .duration(2 * SECONDS + 4 * TICKS) + .eut(TierEU.RECIPE_LV) .addTo(fluidSolidifierRecipes); GTValues.RA.stdBuilder() diff --git a/src/main/java/gregtech/loaders/preload/LoaderGTOreDictionary.java b/src/main/java/gregtech/loaders/preload/LoaderGTOreDictionary.java index 05a3712979d..bff8151be47 100644 --- a/src/main/java/gregtech/loaders/preload/LoaderGTOreDictionary.java +++ b/src/main/java/gregtech/loaders/preload/LoaderGTOreDictionary.java @@ -99,7 +99,6 @@ public void run() { GTOreDictUnificator.set(OrePrefixes.block, Materials.Coal, new ItemStack(Blocks.coal_block, 1, 0)); GTOreDictUnificator.set(OrePrefixes.block, Materials.Redstone, new ItemStack(Blocks.redstone_block, 1, 0)); GTOreDictUnificator.set(OrePrefixes.block, Materials.NetherQuartz, new ItemStack(Blocks.quartz_block, 1, 0)); - GTOreDictUnificator.set(OrePrefixes.block, Materials.Clay, new ItemStack(Blocks.clay, 1, 0)); if (Blocks.ender_chest != null) { GTOreDictUnificator.registerOre(OreDictNames.enderChest, new ItemStack(Blocks.ender_chest, 1)); } diff --git a/src/main/java/gtPlusPlus/core/material/MaterialMisc.java b/src/main/java/gtPlusPlus/core/material/MaterialMisc.java index d00529d0442..19c9f531948 100644 --- a/src/main/java/gtPlusPlus/core/material/MaterialMisc.java +++ b/src/main/java/gtPlusPlus/core/material/MaterialMisc.java @@ -21,7 +21,6 @@ public static void run() { MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_HYDROXIDE, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(CYANOACETIC_ACID, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_CYANIDE, false); - MaterialUtils.generateSpecialDustAndAssignToAMaterial(CALCIUM_CHLORIDE, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(COPPER_SULFATE, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(COPPER_SULFATE_HYDRATED, false); WATER.registerComponentForMaterial(FluidUtils.getWater(1000)); @@ -447,21 +446,6 @@ public static void run() { new MaterialStack(MaterialsElements.getInstance().CARBON, 1), new MaterialStack(MaterialsElements.getInstance().NITROGEN, 1)); - public static final Material CALCIUM_CHLORIDE = new Material( - "Calcium Chloride", - MaterialState.SOLID, // State - new short[] { 180, 190, 255 }, // Material Colour - 563, // Melting Point in C - 1496, // Boiling Point in C - -1, // Protons - -1, - false, // Uses Blast furnace? - "CaCl2", - 0, - false, - new MaterialStack(MaterialsElements.getInstance().CALCIUM, 1), - new MaterialStack(MaterialsElements.getInstance().CHLORINE, 2)); - public static final Material CYANOACETIC_ACID = new Material( "Cyanoacetic Acid", MaterialState.SOLID, // State diff --git a/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java b/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java index 45329aac169..d1101240865 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java +++ b/src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java @@ -1,7 +1,6 @@ package gtPlusPlus.core.recipe; import static gregtech.api.enums.Mods.EnderIO; -import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.recipe.RecipeMaps.assemblerRecipes; import static gregtech.api.recipe.RecipeMaps.compressorRecipes; import static gregtech.api.util.GTRecipeBuilder.MINUTES; @@ -34,7 +33,6 @@ import gtPlusPlus.core.util.minecraft.RecipeUtils; import gtPlusPlus.xmod.bop.blocks.BOPBlockRegistrator; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials; import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper; public class RecipesGeneral { @@ -420,11 +418,6 @@ private static void migratedRecipes() { generateWireRecipes(MaterialsElements.STANDALONE.HYPOGEN); generateWireRecipes(MaterialsElements.STANDALONE.CHRONOMATIC_GLASS); - // No Material for void, natch. - if (Thaumcraft.isModLoaded()) { - generatePipeRecipes(GT_Materials.Void.mDefaultLocalName, GT_Materials.Void.getMass(), 15); - } - Material[] gtpp = new Material[] { MaterialsAlloy.STABALLOY, MaterialsAlloy.TANTALLOY_60, MaterialsAlloy.TANTALLOY_61, MaterialsAlloy.POTIN, MaterialsAlloy.MARAGING300, MaterialsAlloy.MARAGING350, MaterialsAlloy.INCONEL_690, MaterialsAlloy.INCONEL_792, MaterialsAlloy.HASTELLOY_X, @@ -435,8 +428,7 @@ private static void migratedRecipes() { generatePipeRecipes(mat.getLocalizedName(), mat.getMass(), mat.vVoltageMultiplier / 8); } - Materials[] h = new Materials[] { Materials.Europium, Materials.Tungsten, Materials.DarkSteel, Materials.Clay, - Materials.Lead, }; + Materials[] h = new Materials[] { Materials.Clay }; for (Materials e : h) { if (e == Materials.DarkSteel) { diff --git a/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java b/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java index 70bc2a1cf81..178c62d0418 100644 --- a/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java +++ b/src/main/java/gtnhlanth/common/register/WerkstoffMaterialPool.java @@ -113,19 +113,6 @@ public class WerkstoffMaterialPool implements Runnable { offsetID + 6, TextureSet.SET_DULL); - public static final Werkstoff Zirconium = new Werkstoff( - new short[] { 225, 230, 225 }, - "Zirconium", - subscriptNumbers("Zr"), - new Werkstoff.Stats().setBlastFurnace(true), - Werkstoff.Types.ELEMENT, - new Werkstoff.GenerationFeatures().disable() - .onlyDust() - .addMetalItems(), - // .enforceUnification(), - offsetID + 7, - TextureSet.SET_METALLIC); - public static final Werkstoff Zirconia = new Werkstoff( new short[] { 177, 152, 101 }, "Zirconia", @@ -824,7 +811,6 @@ public class WerkstoffMaterialPool implements Runnable { Werkstoff.Types.COMPOUND, new Werkstoff.GenerationFeatures().disable() .onlyDust() - .addMolten() .addCells(), offsetID2 + 24, TextureSet.SET_DULL, diff --git a/src/main/java/gtnhlanth/loader/RecipeLoader.java b/src/main/java/gtnhlanth/loader/RecipeLoader.java index 28e88ef8312..6eb4fc8c62d 100644 --- a/src/main/java/gtnhlanth/loader/RecipeLoader.java +++ b/src/main/java/gtnhlanth/loader/RecipeLoader.java @@ -828,7 +828,7 @@ public static void loadGeneral() { GTUtility.getIntegratedCircuit(2), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Magnesium, 2)) .itemOutputs( - WerkstoffMaterialPool.Zirconium.get(OrePrefixes.ingotHot, 1), + WerkstoffLoader.Zirconium.get(OrePrefixes.ingotHot, 1), GTOreDictUnificator.get(OrePrefixes.dust, Materials.Magnesiumchloride, 6)) .fluidInputs(WerkstoffMaterialPool.ZirconiumTetrachlorideSolution.getFluidOrGas(1000)) .duration(30 * SECONDS) From be7d53287c621b5be62b7876b69e5c19b3bb740a Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:21:58 +0100 Subject: [PATCH 2/6] Readd bronze armor recipes (#3285) --- .../postload/CraftingRecipeLoader.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java b/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java index ae41a07e975..fb7871992fd 100644 --- a/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/CraftingRecipeLoader.java @@ -338,6 +338,25 @@ public void run() { | GTModHandler.RecipeBits.DELETE_ALL_OTHER_SHAPED_RECIPES, new Object[] { "R R", "RhR", 'R', OrePrefixes.ring.get(Materials.Steel) }); + GTModHandler.addCraftingRecipe( + getModItem(IndustrialCraft2.ID, "itemArmorBronzeBoots", 1, 0), + bits, + new Object[] { "R R", "RhR", 'R', GTOreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 1L) }); + GTModHandler.addCraftingRecipe( + getModItem(IndustrialCraft2.ID, "itemArmorBronzeChestplate", 1, 0), + bits, + new Object[] { "RhR", "RRR", "RRR", 'R', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 1L) }); + GTModHandler.addCraftingRecipe( + getModItem(IndustrialCraft2.ID, "itemArmorBronzeLegs", 1, 0), + bits, + new Object[] { "RRR", "RhR", "R R", 'R', + GTOreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 1L) }); + GTModHandler.addCraftingRecipe( + getModItem(IndustrialCraft2.ID, "itemArmorBronzeHelmet", 1, 0), + bits, + new Object[] { "RRR", "RhR", 'R', GTOreDictUnificator.get(OrePrefixes.plate, Materials.Bronze, 1L) }); + GTLog.out.println("GTMod: Adding Wool and Color releated Recipes."); GTModHandler.addShapelessCraftingRecipe( new ItemStack(Blocks.wool, 1, 1), From c333c46bf33ec2953af8148384c5519d04a4561c Mon Sep 17 00:00:00 2001 From: chochem <40274384+chochem@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:50:32 +0100 Subject: [PATCH 3/6] Improve a new debug log (#3286) --- .../java/gregtech/api/enums/OrePrefixes.java | 23 +++++++++++++++---- .../gregtech/api/util/GTRecipeBuilder.java | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 27cf37a2de3..08dd2b77926 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -3,6 +3,7 @@ import static gregtech.api.enums.GTValues.B; import static gregtech.api.enums.GTValues.D2; import static gregtech.api.enums.GTValues.M; +import static gregtech.api.util.GTRecipeBuilder.DEBUG_MODE_COLLISION; import java.util.ArrayList; import java.util.Arrays; @@ -1309,20 +1310,32 @@ public void processOre(Materials aMaterial, String aOreDictName, String aModName return; } - if (aMaterial != Materials._NULL && !used.add(aMaterial)) { - GTLog.out.println("Duplicate material registry attempted by " + aModName + " for " + aOreDictName); + if (aMaterial.contains(SubTag.NO_RECIPES)) { return; } - if (aMaterial.contains(SubTag.NO_RECIPES)) { + if (aMaterial == Materials._NULL && !mIsSelfReferencing && mIsMaterialBased) { return; } - if (!((aMaterial != Materials._NULL || mIsSelfReferencing || !mIsMaterialBased) - && GTUtility.isStackValid(aStack))) { + if (!GTUtility.isStackValid(aStack)) { return; } + if (aMaterial != Materials._NULL) { + if (!used.add(aMaterial)) { + if (DEBUG_MODE_COLLISION) { + GTLog.out + .println("Attempted duplicate recipe registration by " + aModName + " for " + aOreDictName); + } + return; + } else { + if (DEBUG_MODE_COLLISION) { + GTLog.out.println("New recipe registration by " + aModName + " for " + aOreDictName); + } + } + } + for (IOreRecipeRegistrator tRegistrator : mOreProcessing) { if (D2) GTLog.ore.println( "Processing '" + aOreDictName diff --git a/src/main/java/gregtech/api/util/GTRecipeBuilder.java b/src/main/java/gregtech/api/util/GTRecipeBuilder.java index 69890e564df..f93f8b38c81 100644 --- a/src/main/java/gregtech/api/util/GTRecipeBuilder.java +++ b/src/main/java/gregtech/api/util/GTRecipeBuilder.java @@ -43,7 +43,7 @@ public class GTRecipeBuilder { private static final boolean DEBUG_MODE_FULL_ENERGY; // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.invalid=true private static final boolean PANIC_MODE_INVALID; - private static final boolean DEBUG_MODE_COLLISION; + public static final boolean DEBUG_MODE_COLLISION; // Any stable release should be tested at least once with this: -Dgt.recipebuilder.panic.collision=true private static final boolean PANIC_MODE_COLLISION; From 05f8dd49f6117444ecd09679d278c2b37d22102a Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:07:38 -0400 Subject: [PATCH 4/6] Fix earlygame wires (#3287) Co-authored-by: Martin Robertz --- .../java/gregtech/loaders/oreprocessing/ProcessingWire.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java index d3e6750f33b..274488c7863 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java @@ -312,7 +312,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 2L), - GTOreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 1L)) + GTOreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.cableGt01, aMaterial, 1L)) .duration(5 * SECONDS) .eut(8) @@ -321,7 +321,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 2L), - GTOreDictUnificator.get(OrePrefixes.cableGt02, aMaterial, 1L)) + GTOreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.cableGt02, aMaterial, 1L)) .duration(10 * SECONDS) .eut(16) @@ -330,7 +330,7 @@ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDic GTValues.RA.stdBuilder() .itemInputs( GTOreDictUnificator.get(OrePrefixes.ingot, Materials.Rubber, 4L), - GTOreDictUnificator.get(OrePrefixes.cableGt04, aMaterial, 1L)) + GTOreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L)) .itemOutputs(GTOreDictUnificator.get(OrePrefixes.cableGt04, aMaterial, 1L)) .duration(15 * SECONDS) .eut(TierEU.RECIPE_LV) From 302a698ae45397a4ccbe7e844e6f523c62b9f6c0 Mon Sep 17 00:00:00 2001 From: reobf <117543727+reobf@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:20:46 +0800 Subject: [PATCH 5/6] Fix Heat Exchanger interaction with Stocking Input Hatch(ME) (#3271) Co-authored-by: Martin Robertz --- .../tileEntity/MTEExtremeHeatExchanger.java | 44 ++++++++++++++++--- .../machines/multi/MTEHeatExchanger.java | 41 ++++++++++++++--- .../advanced/MTEAdvHeatExchanger.java | 43 +++++++++++++++--- 3 files changed, 107 insertions(+), 21 deletions(-) diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java index 582b9d04aad..45f5bafca10 100644 --- a/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java +++ b/src/main/java/goodgenerator/blocks/tileEntity/MTEExtremeHeatExchanger.java @@ -51,6 +51,8 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.IGTHatchAdder; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import gregtech.common.tileentities.machines.MTEHatchInputME; public class MTEExtremeHeatExchanger extends MTETooltipMultiBlockBaseEM implements IConstructable, ISurvivalConstructable { @@ -223,18 +225,26 @@ protected MultiblockTooltipBuilder createTooltip() { @Override public @NotNull CheckRecipeResult checkProcessing_EM() { tRunningRecipe = null; - if (mHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.SUCCESSFUL; + FluidStack hotFluid = null; + if (mHotFluidHatch instanceof MTEHatchInputME inputME) { + FluidStack[] fluids = inputME.getStoredFluids(); + if (fluids.length > 0) { + hotFluid = fluids[0]; + } + } else { + hotFluid = mHotFluidHatch.getFluid(); + } + if (hotFluid == null) return CheckRecipeResultRegistry.SUCCESSFUL; ExtremeHeatExchangerRecipe tRecipe = (ExtremeHeatExchangerRecipe) GoodGeneratorRecipeMaps.extremeHeatExchangerFuels .getBackend() - .findFuel(mHotFluidHatch.getFluid()); + .findFuel(hotFluid); if (tRecipe == null) return CheckRecipeResultRegistry.NO_RECIPE; tRunningRecipe = tRecipe; - this.hotName = mHotFluidHatch.getFluid() - .getFluid() + this.hotName = hotFluid.getFluid() .getName(); int tMaxConsume = tRecipe.getMaxHotFluidConsume(); int transformed_threshold = tRecipe.mSpecialValue; - int tRealConsume = Math.min(tMaxConsume, mHotFluidHatch.getFluid().amount); + int tRealConsume = Math.min(tMaxConsume, hotFluid.amount); double penalty = 0.0d; double efficiency = 1d; int shs_reduction_per_config = 150; @@ -255,7 +265,8 @@ protected MultiblockTooltipBuilder createTooltip() { this.mMaxProgresstime = 20; this.mEUt = (int) (tRecipe.getEUt() * efficiency * ((double) tRealConsume / (double) tMaxConsume)); - mHotFluidHatch.drain(tRealConsume, true); + // the 3-arg drain will work on both normal hatch and ME hatch + mHotFluidHatch.drain(ForgeDirection.UNKNOWN, new FluidStack(hotFluid.getFluid(), tRealConsume), true); mCooledFluidHatch.fill(new FluidStack(tRecipe.getCooledFluid(), tRealConsume), true); this.mEfficiencyIncrease = 160; @@ -269,7 +280,10 @@ public boolean onRunningTick(ItemStack aStack) { int waterAmount = (int) (this.mEUt / getUnitSteamPower(tReadySteam.getName())) / 160; if (waterAmount < 0) return false; int steamToOutput; - if (depleteInput(GTModHandler.getDistilledWater(waterAmount))) { + startRecipeProcessing(); + boolean isDepleteSuccess = depleteInput(GTModHandler.getDistilledWater(waterAmount)); + endRecipeProcessing(); + if (isDepleteSuccess) { if (tRunningRecipe.mFluidInputs[0].getUnlocalizedName() .contains("plasma")) { steamToOutput = waterAmount * 160 / 1000; @@ -421,4 +435,20 @@ public IGTHatchAdder adder() { return adder; } } + + @Override + public void startRecipeProcessing() { + super.startRecipeProcessing(); + if (mHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mHotFluidHatch.isValid()) { + aware.startRecipeProcessing(); + } + } + + @Override + public void endRecipeProcessing() { + super.endRecipeProcessing(); + if (mHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mHotFluidHatch.isValid()) { + aware.endRecipeProcessing(this); + } + } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java index fb90f1acc46..688fa3e706c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEHeatExchanger.java @@ -48,6 +48,8 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import gregtech.common.tileentities.machines.MTEHatchInputME; public class MTEHeatExchanger extends MTEEnhancedMultiBlockBase implements ISurvivalConstructable { @@ -179,9 +181,19 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @Override @Nonnull public CheckRecipeResult checkProcessing() { - if (mInputHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.NO_RECIPE; + FluidStack hotFluid = null; + if (mInputHotFluidHatch instanceof MTEHatchInputME inputME) { + FluidStack[] fluids = inputME.getStoredFluids(); + if (fluids.length > 0) { + hotFluid = fluids[0]; + } + } else { + hotFluid = mInputHotFluidHatch.getFluid(); + } + + if (hotFluid == null) return CheckRecipeResultRegistry.NO_RECIPE; - int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch + int fluidAmountToConsume = hotFluid.amount; // how much fluid is in hatch superheated_threshold = 4000; // default: must have 4000L per second to generate superheated steam float efficiency = 1f; // default: operate at 100% efficiency with no integrated circuitry @@ -202,9 +214,7 @@ public CheckRecipeResult checkProcessing() { efficiency -= penalty; - var coolant = LHECoolantRegistry.getCoolant( - mInputHotFluidHatch.getFluid() - .getFluid()); + var coolant = LHECoolantRegistry.getCoolant(hotFluid.getFluid()); if (coolant == null) { superheated_threshold = 0; @@ -220,8 +230,9 @@ public CheckRecipeResult checkProcessing() { // Don't consume too much hot fluid per second fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); - - mInputHotFluidHatch.drain(fluidAmountToConsume, true); + // the 3-arg drain will work on both normal hatch and ME hatch + mInputHotFluidHatch + .drain(ForgeDirection.UNKNOWN, new FluidStack(hotFluid.getFluid(), fluidAmountToConsume), true); mOutputColdFluidHatch.fill(coolant.getColdFluid(fluidAmountToConsume), true); this.mMaxProgresstime = 20; @@ -393,4 +404,20 @@ public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBu if (mMachine) return -1; return survivialBuildPiece(STRUCTURE_PIECE_MAIN, stackSize, 1, 3, 0, elementBudget, env, false, true); } + + @Override + public void startRecipeProcessing() { + super.startRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.startRecipeProcessing(); + } + } + + @Override + public void endRecipeProcessing() { + super.endRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.endRecipeProcessing(this); + } + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java index 0779c03183d..5ebf5d1659e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/MTEAdvHeatExchanger.java @@ -11,6 +11,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; @@ -35,6 +36,8 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; +import gregtech.common.tileentities.machines.IRecipeProcessingAwareHatch; +import gregtech.common.tileentities.machines.MTEHatchInputME; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseModular; @@ -168,9 +171,18 @@ protected IAlignmentLimits getInitialAlignmentLimits() { @Override public @NotNull CheckRecipeResult checkProcessing() { - if (mInputHotFluidHatch.getFluid() == null) return CheckRecipeResultRegistry.SUCCESSFUL; + FluidStack hotFluid = null; + if (mInputHotFluidHatch instanceof MTEHatchInputME inputME) { + FluidStack[] fluids = inputME.getStoredFluids(); + if (fluids.length > 0) { + hotFluid = fluids[0]; + } + } else { + hotFluid = mInputHotFluidHatch.getFluid(); + } + if (hotFluid == null) return CheckRecipeResultRegistry.SUCCESSFUL; - int fluidAmountToConsume = mInputHotFluidHatch.getFluidAmount(); // how much fluid is in hatch + int fluidAmountToConsume = hotFluid.amount; // how much fluid is in hatch // The XL LHE works as fast as 32 regular LHEs. These are the comments from the original LHE, // with changes where the values needed to change for the 32x speed multiplier @@ -193,9 +205,7 @@ protected IAlignmentLimits getInitialAlignmentLimits() { efficiency -= penalty; - var coolant = LHECoolantRegistry.getCoolant( - mInputHotFluidHatch.getFluid() - .getFluid()); + var coolant = LHECoolantRegistry.getCoolant(hotFluid.getFluid()); if (coolant == null) { superheated_threshold = 0; @@ -210,8 +220,9 @@ protected IAlignmentLimits getInitialAlignmentLimits() { // Don't consume too much hot fluid per second, maximum is 2x SH threshold. fluidAmountToConsume = Math.min(fluidAmountToConsume, superheated_threshold * 2); - - mInputHotFluidHatch.drain(fluidAmountToConsume, true); + // the 3-arg drain will work on both normal hatch and ME hatch + mInputHotFluidHatch + .drain(ForgeDirection.UNKNOWN, new FluidStack(hotFluid.getFluid(), fluidAmountToConsume), true); mOutputColdFluidHatch.fill(coolant.getColdFluid(fluidAmountToConsume), true); this.mMaxProgresstime = 20; @@ -242,6 +253,7 @@ public boolean onRunningTick(ItemStack aStack) { // 1:160 ratio with distilled water consumption FluidStack distilledStack = GTModHandler.getDistilledWater(distilledConsumed); + startRecipeProcessing(); if (depleteInput(distilledStack)) // Consume the distilled water { if (superheated) { @@ -255,6 +267,7 @@ public boolean onRunningTick(ItemStack aStack) { GTLog.exp.println(this.mName + " had no more Distilled water!"); explodeMultiblock(); // Generate crater } + endRecipeProcessing(); } return true; } @@ -393,4 +406,20 @@ public static Block getFrame() { } return sFrame; } + + @Override + public void startRecipeProcessing() { + super.startRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.startRecipeProcessing(); + } + } + + @Override + public void endRecipeProcessing() { + super.endRecipeProcessing(); + if (mInputHotFluidHatch instanceof IRecipeProcessingAwareHatch aware && mInputHotFluidHatch.isValid()) { + aware.endRecipeProcessing(this); + } + } } From e9fe2d86f47121b308f08eab6162c51fa3d6aa01 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Thu, 26 Sep 2024 17:28:03 +0200 Subject: [PATCH 6/6] update --- dependencies.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index ebb48582104..bc42680a6e3 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -42,7 +42,7 @@ dependencies { api("com.github.GTNewHorizons:ModularUI:1.2.8:dev") api("com.github.GTNewHorizons:ModularUI2:2.1.11-1.7.10:dev") api("com.github.GTNewHorizons:waila:1.8.1:dev") - api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-463-GTNH:dev") + api("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-464-GTNH:dev") api("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.36-gtnh:dev") api('com.github.GTNewHorizons:Yamcl:0.6.0:dev') api("com.github.GTNewHorizons:Postea:1.0.13:dev") @@ -95,7 +95,7 @@ dependencies { compileOnly rfg.deobf("curse.maven:biomes-o-plenty-220318:2499612") compileOnly('com.github.GTNewHorizons:SC2:2.2.0:dev') {transitive=false} - compileOnly('com.github.GTNewHorizons:Binnie:2.4.2:dev') {transitive = false} + compileOnly('com.github.GTNewHorizons:Binnie:2.4.3:dev') {transitive = false} compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false} compileOnly('com.github.GTNewHorizons:BlockRenderer6343:1.2.14:dev'){transitive=false} @@ -108,7 +108,7 @@ dependencies { // runtimeOnlyNonPublishable("com.github.GTNewHorizons:ForestryMC:4.9.16:dev") // runtimeOnlyNonPublishable('com.github.GTNewHorizons:neiaddons:1.16.0:dev') // runtimeOnlyNonPublishable('com.github.GTNewHorizons:MagicBees:2.8.5-GTNH:dev') - // runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.2:dev') + // runtimeOnlyNonPublishable('com.github.GTNewHorizons:Binnie:2.4.3:dev') testImplementation(platform('org.junit:junit-bom:5.9.2')) testImplementation('org.junit.jupiter:junit-jupiter')