From dcd440705d2a9089cb4092a0ab8a3eb343012673 Mon Sep 17 00:00:00 2001 From: pupnewfster Date: Mon, 11 Mar 2019 18:57:08 -0400 Subject: [PATCH] Support for removing all built in recipes of a type via CraftTweaker --- .../handlers/ChemicalCrystallizer.java | 13 +++++-- .../handlers/ChemicalDissolution.java | 13 +++++-- .../handlers/ChemicalInfuser.java | 13 +++++-- .../handlers/ChemicalInjection.java | 13 +++++-- .../handlers/ChemicalOxidizer.java | 14 +++++--- .../crafttweaker/handlers/ChemicalWasher.java | 14 +++++--- .../crafttweaker/handlers/Combiner.java | 19 ++++++---- .../crafttweaker/handlers/Compressor.java | 15 +++++--- .../crafttweaker/handlers/Crusher.java | 12 +++++-- .../handlers/EnergizedSmelter.java | 13 +++++-- .../crafttweaker/handlers/Enrichment.java | 13 +++++-- .../crafttweaker/handlers/Infuser.java | 13 +++++-- .../crafttweaker/handlers/Purification.java | 15 +++++--- .../crafttweaker/handlers/Reaction.java | 12 +++++-- .../crafttweaker/handlers/Sawmill.java | 13 +++++-- .../crafttweaker/handlers/Separator.java | 13 +++++-- .../handlers/SolarNeutronActivator.java | 13 +++++-- .../handlers/ThermalEvaporation.java | 13 +++++-- .../util/RemoveAllMekanismRecipe.java | 35 +++++++++++++++++++ .../util/RemoveMekanismRecipe.java | 3 +- 20 files changed, 219 insertions(+), 63 deletions(-) create mode 100644 src/main/java/mekanism/common/integration/crafttweaker/util/RemoveAllMekanismRecipe.java diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalCrystallizer.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalCrystallizer.java index 38d78bbab..e9b24fce4 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalCrystallizer.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalCrystallizer.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.GasInput; import mekanism.common.recipe.machines.CrystallizerRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -31,7 +32,7 @@ public class ChemicalCrystallizer { public static void addRecipe(IGasStack gasInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, gasInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CHEMICAL_CRYSTALLIZER, + .add(new AddMekanismRecipe(NAME, Recipe.CHEMICAL_CRYSTALLIZER, new CrystallizerRecipe(GasHelper.toGas(gasInput), InputHelper.toStack(itemOutput)))); } } @@ -41,8 +42,14 @@ public class ChemicalCrystallizer { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CHEMICAL_CRYSTALLIZER, new IngredientWrapper(itemOutput), + Recipe.CHEMICAL_CRYSTALLIZER, new IngredientWrapper(itemOutput), new IngredientWrapper(gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_CRYSTALLIZER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalDissolution.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalDissolution.java index af26cc845..eb055d476 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalDissolution.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalDissolution.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.DissolutionRecipe; import mekanism.common.recipe.outputs.GasOutput; @@ -31,7 +32,7 @@ public class ChemicalDissolution { public static void addRecipe(IItemStack itemInput, IGasStack gasOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, gasOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CHEMICAL_DISSOLUTION_CHAMBER, + .add(new AddMekanismRecipe(NAME, Recipe.CHEMICAL_DISSOLUTION_CHAMBER, new DissolutionRecipe(InputHelper.toStack(itemInput), GasHelper.toGas(gasOutput)))); } } @@ -41,8 +42,14 @@ public class ChemicalDissolution { if (IngredientHelper.checkNotNull(NAME, gasOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CHEMICAL_DISSOLUTION_CHAMBER, new IngredientWrapper(gasOutput), + Recipe.CHEMICAL_DISSOLUTION_CHAMBER, new IngredientWrapper(gasOutput), new IngredientWrapper(itemInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_DISSOLUTION_CHAMBER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInfuser.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInfuser.java index 544cf9493..a004d990b 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInfuser.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInfuser.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ChemicalPairInput; import mekanism.common.recipe.machines.ChemicalInfuserRecipe; import mekanism.common.recipe.outputs.GasOutput; @@ -29,7 +30,7 @@ public class ChemicalInfuser { public static void addRecipe(IGasStack leftGasInput, IGasStack rightGasInput, IGasStack gasOutput) { if (IngredientHelper.checkNotNull(NAME, leftGasInput, rightGasInput, gasOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CHEMICAL_INFUSER, + .add(new AddMekanismRecipe(NAME, Recipe.CHEMICAL_INFUSER, new ChemicalInfuserRecipe(GasHelper.toGas(leftGasInput), GasHelper.toGas(rightGasInput), GasHelper.toGas(gasOutput)))); } @@ -41,8 +42,14 @@ public class ChemicalInfuser { if (IngredientHelper.checkNotNull(NAME, gasOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CHEMICAL_INFUSER, new IngredientWrapper(gasOutput), + Recipe.CHEMICAL_INFUSER, new IngredientWrapper(gasOutput), new IngredientWrapper(leftGasInput, rightGasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_INFUSER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInjection.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInjection.java index 8cd104bdb..92668856b 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInjection.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalInjection.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.AdvancedMachineInput; import mekanism.common.recipe.machines.InjectionRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -31,7 +32,7 @@ public class ChemicalInjection { public static void addRecipe(IItemStack itemInput, IGasStack gasInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, gasInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CHEMICAL_INJECTION_CHAMBER, + .add(new AddMekanismRecipe(NAME, Recipe.CHEMICAL_INJECTION_CHAMBER, new InjectionRecipe(new AdvancedMachineInput(InputHelper.toStack(itemInput), GasHelper.toGas(gasInput).getGas()), new ItemStackOutput(InputHelper.toStack(itemOutput))))); @@ -44,8 +45,14 @@ public class ChemicalInjection { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CHEMICAL_INJECTION_CHAMBER, new IngredientWrapper(itemOutput), + Recipe.CHEMICAL_INJECTION_CHAMBER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput, gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_INJECTION_CHAMBER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalOxidizer.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalOxidizer.java index b09dea98a..9b802b7cc 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalOxidizer.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalOxidizer.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.OxidationRecipe; import mekanism.common.recipe.outputs.GasOutput; @@ -31,7 +32,7 @@ public class ChemicalOxidizer { public static void addRecipe(IItemStack itemInput, IGasStack gasOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, gasOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CHEMICAL_OXIDIZER, + .add(new AddMekanismRecipe(NAME, Recipe.CHEMICAL_OXIDIZER, new OxidationRecipe(InputHelper.toStack(itemInput), GasHelper.toGas(gasOutput)))); } } @@ -41,8 +42,13 @@ public class ChemicalOxidizer { if (IngredientHelper.checkNotNull(NAME, gasOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CHEMICAL_OXIDIZER, new IngredientWrapper(gasOutput), - new IngredientWrapper(itemInput))); + Recipe.CHEMICAL_OXIDIZER, new IngredientWrapper(gasOutput), new IngredientWrapper(itemInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_OXIDIZER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalWasher.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalWasher.java index 94a01c441..625a78a13 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalWasher.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ChemicalWasher.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.GasInput; import mekanism.common.recipe.machines.WasherRecipe; import mekanism.common.recipe.outputs.GasOutput; @@ -28,7 +29,7 @@ public class ChemicalWasher { @ZenMethod public static void addRecipe(IGasStack gasInput, IGasStack gasOutput) { if (IngredientHelper.checkNotNull(NAME, gasInput, gasOutput)) { - CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CHEMICAL_WASHER, + CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, Recipe.CHEMICAL_WASHER, new WasherRecipe(GasHelper.toGas(gasInput), GasHelper.toGas(gasOutput)))); } } @@ -37,8 +38,13 @@ public class ChemicalWasher { public static void removeRecipe(IIngredient gasOutput, @Optional IIngredient gasInput) { if (IngredientHelper.checkNotNull(NAME, gasOutput)) { CrafttweakerIntegration.LATE_REMOVALS.add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CHEMICAL_WASHER, new IngredientWrapper(gasOutput), - new IngredientWrapper(gasInput))); + Recipe.CHEMICAL_WASHER, new IngredientWrapper(gasOutput), new IngredientWrapper(gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_WASHER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Combiner.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Combiner.java index 36ed516b4..33f32866b 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Combiner.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Combiner.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.DoubleMachineInput; import mekanism.common.recipe.machines.CombinerRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -28,10 +29,9 @@ public class Combiner { @ZenMethod public static void addRecipe(IItemStack itemInput, IItemStack extraInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, extraInput, itemOutput)) { - CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.COMBINER, - new CombinerRecipe( - new DoubleMachineInput(InputHelper.toStack(itemInput), InputHelper.toStack(extraInput)), - new ItemStackOutput(InputHelper.toStack(itemOutput))))); + CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, Recipe.COMBINER, new CombinerRecipe( + new DoubleMachineInput(InputHelper.toStack(itemInput), InputHelper.toStack(extraInput)), + new ItemStackOutput(InputHelper.toStack(itemOutput))))); } } @@ -43,7 +43,7 @@ public class Combiner { @Deprecated public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { - CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.COMBINER, + CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, Recipe.COMBINER, new CombinerRecipe(InputHelper.toStack(itemInput), InputHelper.toStack(itemOutput)))); } } @@ -54,8 +54,13 @@ public class Combiner { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.COMBINER, new IngredientWrapper(itemOutput), + Recipe.COMBINER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput, gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS.add(new RemoveAllMekanismRecipe(NAME, Recipe.COMBINER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Compressor.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Compressor.java index 76c2ba89b..5aee72597 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Compressor.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Compressor.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.AdvancedMachineInput; import mekanism.common.recipe.machines.OsmiumCompressorRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -31,7 +32,7 @@ public class Compressor { public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.OSMIUM_COMPRESSOR, + .add(new AddMekanismRecipe(NAME, Recipe.OSMIUM_COMPRESSOR, new OsmiumCompressorRecipe(InputHelper.toStack(itemInput), InputHelper.toStack(itemOutput)))); } } @@ -40,7 +41,7 @@ public class Compressor { public static void addRecipe(IItemStack itemInput, IGasStack gasInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, gasInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.OSMIUM_COMPRESSOR, + .add(new AddMekanismRecipe(NAME, Recipe.OSMIUM_COMPRESSOR, new OsmiumCompressorRecipe(new AdvancedMachineInput(InputHelper.toStack(itemInput), GasHelper.toGas(gasInput).getGas()), new ItemStackOutput(InputHelper.toStack(itemOutput))))); @@ -53,8 +54,14 @@ public class Compressor { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.OSMIUM_COMPRESSOR, new IngredientWrapper(itemOutput), + Recipe.OSMIUM_COMPRESSOR, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput, gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.OSMIUM_COMPRESSOR)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Crusher.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Crusher.java index 3a1ad2d24..fb121816d 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Crusher.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Crusher.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.CrusherRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -28,7 +29,7 @@ public class Crusher { @ZenMethod public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { - CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.CRUSHER, + CrafttweakerIntegration.LATE_ADDITIONS.add(new AddMekanismRecipe(NAME, Recipe.CRUSHER, new CrusherRecipe(InputHelper.toStack(itemInput), InputHelper.toStack(itemOutput)))); } } @@ -38,8 +39,13 @@ public class Crusher { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.CRUSHER, new IngredientWrapper(itemOutput), + Recipe.CRUSHER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS.add(new RemoveAllMekanismRecipe(NAME, Recipe.CRUSHER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/EnergizedSmelter.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/EnergizedSmelter.java index a9fbede71..548329ab8 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/EnergizedSmelter.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/EnergizedSmelter.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.SmeltingRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -39,7 +40,7 @@ public class EnergizedSmelter { public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.ENERGIZED_SMELTER, + .add(new AddMekanismRecipe(NAME, Recipe.ENERGIZED_SMELTER, new SmeltingRecipe(InputHelper.toStack(itemInput), InputHelper.toStack(itemOutput)))); addedRecipe = true; } @@ -50,9 +51,15 @@ public class EnergizedSmelter { if (IngredientHelper.checkNotNull(NAME, itemInput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.ENERGIZED_SMELTER, new IngredientWrapper(itemOutput), + Recipe.ENERGIZED_SMELTER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput))); removedRecipe = true; } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.ENERGIZED_SMELTER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Enrichment.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Enrichment.java index d18bc3c2a..ba650508c 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Enrichment.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Enrichment.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.EnrichmentRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -29,7 +30,7 @@ public class Enrichment { public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.ENRICHMENT_CHAMBER, + .add(new AddMekanismRecipe(NAME, Recipe.ENRICHMENT_CHAMBER, new EnrichmentRecipe(InputHelper.toStack(itemInput), InputHelper.toStack(itemOutput)))); } } @@ -39,8 +40,14 @@ public class Enrichment { if (IngredientHelper.checkNotNull(NAME, itemInput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.ENRICHMENT_CHAMBER, new IngredientWrapper(itemOutput), + Recipe.ENRICHMENT_CHAMBER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.ENRICHMENT_CHAMBER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Infuser.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Infuser.java index 25d1e4092..e027039a2 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Infuser.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Infuser.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.InfusionInput; import mekanism.common.recipe.machines.MetallurgicInfuserRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -35,7 +36,7 @@ public class Infuser { } if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.METALLURGIC_INFUSER, + .add(new AddMekanismRecipe(NAME, Recipe.METALLURGIC_INFUSER, new MetallurgicInfuserRecipe(new InfusionInput(InfuseRegistry.get(infuseType), infuseAmount, InputHelper.toStack(itemInput)), new ItemStackOutput(InputHelper.toStack(itemOutput))))); @@ -48,8 +49,14 @@ public class Infuser { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.METALLURGIC_INFUSER, new IngredientWrapper(itemOutput), + Recipe.METALLURGIC_INFUSER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput, infuseType))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.CHEMICAL_CRYSTALLIZER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Purification.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Purification.java index ae019ddf8..300cdbc1d 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Purification.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Purification.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.AdvancedMachineInput; import mekanism.common.recipe.machines.PurificationRecipe; import mekanism.common.recipe.outputs.ItemStackOutput; @@ -31,7 +32,7 @@ public class Purification { public static void addRecipe(IItemStack itemInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.PURIFICATION_CHAMBER, + .add(new AddMekanismRecipe(NAME, Recipe.PURIFICATION_CHAMBER, new PurificationRecipe(InputHelper.toStack(itemInput), InputHelper.toStack(itemOutput)))); } } @@ -40,7 +41,7 @@ public class Purification { public static void addRecipe(IItemStack itemInput, IGasStack gasInput, IItemStack itemOutput) { if (IngredientHelper.checkNotNull(NAME, itemInput, gasInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.PURIFICATION_CHAMBER, + .add(new AddMekanismRecipe(NAME, Recipe.PURIFICATION_CHAMBER, new PurificationRecipe(new AdvancedMachineInput(InputHelper.toStack(itemInput), GasHelper.toGas(gasInput).getGas()), new ItemStackOutput(InputHelper.toStack(itemOutput))))); @@ -53,8 +54,14 @@ public class Purification { if (IngredientHelper.checkNotNull(NAME, itemOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.PURIFICATION_CHAMBER, new IngredientWrapper(itemOutput), + Recipe.PURIFICATION_CHAMBER, new IngredientWrapper(itemOutput), new IngredientWrapper(itemInput, gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.PURIFICATION_CHAMBER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Reaction.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Reaction.java index 33f9428d9..bd372078e 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Reaction.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Reaction.java @@ -12,8 +12,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.PressurizedInput; import mekanism.common.recipe.machines.PressurizedRecipe; import mekanism.common.recipe.outputs.PressurizedOutput; @@ -33,7 +34,7 @@ public class Reaction { IItemStack itemOutput, IGasStack gasOutput, double energy, int duration) { if (IngredientHelper.checkNotNull(NAME, itemInput, liquidInput, gasInput, itemOutput, gasOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.PRESSURIZED_REACTION_CHAMBER, + .add(new AddMekanismRecipe(NAME, Recipe.PRESSURIZED_REACTION_CHAMBER, new PressurizedRecipe( new PressurizedInput(InputHelper.toStack(itemInput), InputHelper.toFluid(liquidInput), GasHelper.toGas(gasInput)), @@ -48,9 +49,14 @@ public class Reaction { if (IngredientHelper.checkNotNull(NAME, itemOutput, gasOutput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.PRESSURIZED_REACTION_CHAMBER, new IngredientWrapper(itemOutput, gasOutput), + Recipe.PRESSURIZED_REACTION_CHAMBER, new IngredientWrapper(itemOutput, gasOutput), new IngredientWrapper(itemInput, liquidInput, gasInput))); } } + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.PRESSURIZED_REACTION_CHAMBER)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Sawmill.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Sawmill.java index 8243f3ef3..7659acf7c 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Sawmill.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Sawmill.java @@ -10,8 +10,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.ItemStackInput; import mekanism.common.recipe.machines.SawmillRecipe; import mekanism.common.recipe.outputs.ChanceOutput; @@ -31,7 +32,7 @@ public class Sawmill { @Optional double optionalChance) { if (IngredientHelper.checkNotNull(NAME, itemInput, itemOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.PRECISION_SAWMILL, + .add(new AddMekanismRecipe(NAME, Recipe.PRECISION_SAWMILL, new SawmillRecipe(new ItemStackInput(toStack(itemInput)), optionalItemOutput == null ? new ChanceOutput(toStack(itemOutput)) : new ChanceOutput(toStack(itemOutput), toStack(optionalItemOutput), @@ -45,8 +46,14 @@ public class Sawmill { if (IngredientHelper.checkNotNull(NAME, itemInput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.PRECISION_SAWMILL, new IngredientWrapper(itemInput), + Recipe.PRECISION_SAWMILL, new IngredientWrapper(itemInput), new IngredientWrapper(itemOutput, optionalItemOutput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.PRECISION_SAWMILL)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Separator.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Separator.java index 1d3d09fb1..80538cf89 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/Separator.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/Separator.java @@ -11,8 +11,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.FluidInput; import mekanism.common.recipe.machines.SeparatorRecipe; import mekanism.common.recipe.outputs.ChemicalPairOutput; @@ -32,7 +33,7 @@ public class Separator { IGasStack rightGasOutput) { if (IngredientHelper.checkNotNull(NAME, liquidInput, leftGasOutput, rightGasOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.ELECTROLYTIC_SEPARATOR, + .add(new AddMekanismRecipe(NAME, Recipe.ELECTROLYTIC_SEPARATOR, new SeparatorRecipe(InputHelper.toFluid(liquidInput), energy, GasHelper.toGas(leftGasOutput), GasHelper.toGas(rightGasOutput)))); } @@ -44,8 +45,14 @@ public class Separator { if (IngredientHelper.checkNotNull(NAME, liquidInput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.ELECTROLYTIC_SEPARATOR, new IngredientWrapper(liquidInput), + Recipe.ELECTROLYTIC_SEPARATOR, new IngredientWrapper(liquidInput), new IngredientWrapper(leftGasOutput, rightGasOutput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.ELECTROLYTIC_SEPARATOR)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/SolarNeutronActivator.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/SolarNeutronActivator.java index 13324a2b8..a0f3e146b 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/SolarNeutronActivator.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/SolarNeutronActivator.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.helpers.GasHelper; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.GasInput; import mekanism.common.recipe.machines.SolarNeutronRecipe; import mekanism.common.recipe.outputs.GasOutput; @@ -29,7 +30,7 @@ public class SolarNeutronActivator { public static void addRecipe(IGasStack gasInput, IGasStack gasOutput) { if (IngredientHelper.checkNotNull(NAME, gasInput, gasOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.SOLAR_NEUTRON_ACTIVATOR, + .add(new AddMekanismRecipe(NAME, Recipe.SOLAR_NEUTRON_ACTIVATOR, new SolarNeutronRecipe(GasHelper.toGas(gasInput), GasHelper.toGas(gasOutput)))); } } @@ -39,8 +40,14 @@ public class SolarNeutronActivator { if (IngredientHelper.checkNotNull(NAME, gasInput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.SOLAR_NEUTRON_ACTIVATOR, new IngredientWrapper(gasOutput), + Recipe.SOLAR_NEUTRON_ACTIVATOR, new IngredientWrapper(gasOutput), new IngredientWrapper(gasInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.SOLAR_NEUTRON_ACTIVATOR)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ThermalEvaporation.java b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ThermalEvaporation.java index 66ed9a00d..c17f42db8 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/handlers/ThermalEvaporation.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/handlers/ThermalEvaporation.java @@ -9,8 +9,9 @@ import mekanism.common.integration.crafttweaker.CrafttweakerIntegration; import mekanism.common.integration.crafttweaker.helpers.IngredientHelper; import mekanism.common.integration.crafttweaker.util.AddMekanismRecipe; import mekanism.common.integration.crafttweaker.util.IngredientWrapper; +import mekanism.common.integration.crafttweaker.util.RemoveAllMekanismRecipe; import mekanism.common.integration.crafttweaker.util.RemoveMekanismRecipe; -import mekanism.common.recipe.RecipeHandler; +import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.inputs.FluidInput; import mekanism.common.recipe.machines.ThermalEvaporationRecipe; import mekanism.common.recipe.outputs.FluidOutput; @@ -29,7 +30,7 @@ public class ThermalEvaporation { public static void addRecipe(ILiquidStack liquidInput, ILiquidStack liquidOutput) { if (IngredientHelper.checkNotNull(NAME, liquidInput, liquidOutput)) { CrafttweakerIntegration.LATE_ADDITIONS - .add(new AddMekanismRecipe(NAME, RecipeHandler.Recipe.THERMAL_EVAPORATION_PLANT, + .add(new AddMekanismRecipe(NAME, Recipe.THERMAL_EVAPORATION_PLANT, new ThermalEvaporationRecipe(InputHelper.toFluid(liquidInput), InputHelper.toFluid(liquidOutput)))); } @@ -40,8 +41,14 @@ public class ThermalEvaporation { if (IngredientHelper.checkNotNull(NAME, liquidInput)) { CrafttweakerIntegration.LATE_REMOVALS .add(new RemoveMekanismRecipe(NAME, - RecipeHandler.Recipe.THERMAL_EVAPORATION_PLANT, new IngredientWrapper(liquidOutput), + Recipe.THERMAL_EVAPORATION_PLANT, new IngredientWrapper(liquidOutput), new IngredientWrapper(liquidInput))); } } + + @ZenMethod + public static void removeAllRecipes() { + CrafttweakerIntegration.LATE_REMOVALS + .add(new RemoveAllMekanismRecipe(NAME, Recipe.THERMAL_EVAPORATION_PLANT)); + } } \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveAllMekanismRecipe.java b/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveAllMekanismRecipe.java new file mode 100644 index 000000000..1f62967ba --- /dev/null +++ b/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveAllMekanismRecipe.java @@ -0,0 +1,35 @@ +package mekanism.common.integration.crafttweaker.util; + +import com.blamejared.mtlib.helpers.LogHelper; +import com.blamejared.mtlib.utils.BaseMapRemoval; +import java.util.Map.Entry; +import mekanism.common.integration.crafttweaker.helpers.RecipeInfoHelper; +import mekanism.common.recipe.RecipeHandler.Recipe; +import mekanism.common.recipe.inputs.MachineInput; +import mekanism.common.recipe.machines.MachineRecipe; + +public class RemoveAllMekanismRecipe extends BaseMapRemoval { + + public RemoveAllMekanismRecipe(String name, Recipe recipeType) { + super(name, recipeType.get()); + } + + @Override + public void apply() { + //Don't move this into the constructor so that if an addon registers recipes late, we can still remove them + recipes.putAll(map); + super.apply(); + LogHelper.logInfo("Removed all recipes for " + name); + } + + @Override + public String describe() { + //Don't describe anything. It is too early for us to have a full description + return null; + } + + @Override + protected String getRecipeInfo(Entry recipe) { + return RecipeInfoHelper.getRecipeInfo(recipe); + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveMekanismRecipe.java b/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveMekanismRecipe.java index 505a7ff69..b77959dd4 100644 --- a/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveMekanismRecipe.java +++ b/src/main/java/mekanism/common/integration/crafttweaker/util/RemoveMekanismRecipe.java @@ -24,6 +24,7 @@ public class RemoveMekanismRecipe, OUTPUT exte @Override public void apply() { + //Don't move this into the constructor so that if an addon registers recipes late, we can still remove them map.forEach((key, value) -> { if (IngredientHelper.matches(key, input) && IngredientHelper.matches(value.getOutput(), output)) { recipes.put(key, value); @@ -59,6 +60,6 @@ public class RemoveMekanismRecipe, OUTPUT exte @Override public String describe() { //Don't describe anything. It is too early for us to have a full description - return ""; + return null; } }