diff --git a/src/main/java/techreborn/compat/crafttweaker/CTAlloySmelter.java b/src/main/java/techreborn/compat/crafttweaker/CTAlloySmelter.java index d6c9bf42b..459a89a59 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTAlloySmelter.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTAlloySmelter.java @@ -34,19 +34,21 @@ import techreborn.api.recipe.machines.AlloySmelterRecipe; /** * mods.techreborn.alloySmelter.addRecipe(, , , 20, 100); + * mods.techreborn.alloySmelter.addRecipe(, , , 20, 100).setUseOreDict(false); */ @ZenClass("mods.techreborn.alloySmelter") public class CTAlloySmelter extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); AlloySmelterRecipe r = new AlloySmelterRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTAssemblingMachine.java b/src/main/java/techreborn/compat/crafttweaker/CTAssemblingMachine.java index ba058a2e9..c4e2da069 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTAssemblingMachine.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTAssemblingMachine.java @@ -36,13 +36,14 @@ import techreborn.api.recipe.machines.AssemblingMachineRecipe; public class CTAssemblingMachine extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); AssemblingMachineRecipe r = new AssemblingMachineRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTBlastFurnace.java b/src/main/java/techreborn/compat/crafttweaker/CTBlastFurnace.java index 48065cdba..858b71e02 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTBlastFurnace.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTBlastFurnace.java @@ -36,13 +36,14 @@ import techreborn.api.recipe.machines.BlastFurnaceRecipe; public class CTBlastFurnace extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); BlastFurnaceRecipe r = new BlastFurnaceRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick, neededHeat); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTCentrifuge.java b/src/main/java/techreborn/compat/crafttweaker/CTCentrifuge.java index 2a8e8659a..c6fa4e80a 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTCentrifuge.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTCentrifuge.java @@ -36,13 +36,14 @@ import techreborn.api.recipe.machines.CentrifugeRecipe; public class CTCentrifuge extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); CentrifugeRecipe r = new CentrifugeRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTChemicalReactor.java b/src/main/java/techreborn/compat/crafttweaker/CTChemicalReactor.java index 8709be1c6..7bbb194fc 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTChemicalReactor.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTChemicalReactor.java @@ -36,13 +36,14 @@ import techreborn.api.recipe.machines.ChemicalReactorRecipe; public class CTChemicalReactor extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTCompressor.java b/src/main/java/techreborn/compat/crafttweaker/CTCompressor.java index daed5820d..1a71b4616 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTCompressor.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTCompressor.java @@ -40,10 +40,11 @@ import techreborn.api.recipe.machines.CompressorRecipe; public class CTCompressor extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTDistillationTower.java b/src/main/java/techreborn/compat/crafttweaker/CTDistillationTower.java index e3ba0ae64..f58ae3303 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTDistillationTower.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTDistillationTower.java @@ -40,13 +40,14 @@ import techreborn.api.recipe.machines.DistillationTowerRecipe; public class CTDistillationTower extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); DistillationTowerRecipe r = new DistillationTowerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTExtractor.java b/src/main/java/techreborn/compat/crafttweaker/CTExtractor.java index 7ad914ed4..bf510e190 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTExtractor.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTExtractor.java @@ -38,12 +38,13 @@ import techreborn.api.recipe.machines.ExtractorRecipe; @ZenClass("mods.techreborn.extractor") public class CTExtractor extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); ExtractorRecipe r = new ExtractorRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTImplosionCompressor.java b/src/main/java/techreborn/compat/crafttweaker/CTImplosionCompressor.java index e9c0bddd0..23a82e15d 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTImplosionCompressor.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTImplosionCompressor.java @@ -36,13 +36,14 @@ import techreborn.api.recipe.machines.ImplosionCompressorRecipe; public class CTImplosionCompressor extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); Object oInput2 = CraftTweakerCompat.toObject(input2); ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTIndustrialElectrolyzer.java b/src/main/java/techreborn/compat/crafttweaker/CTIndustrialElectrolyzer.java index de48f79f4..6aba5a820 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTIndustrialElectrolyzer.java @@ -36,13 +36,14 @@ import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe; public class CTIndustrialElectrolyzer extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(cells); Object oInput2 = CraftTweakerCompat.toObject(input2); IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTIndustrialGrinder.java b/src/main/java/techreborn/compat/crafttweaker/CTIndustrialGrinder.java index 7fade3795..3082001cd 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTIndustrialGrinder.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTIndustrialGrinder.java @@ -52,8 +52,8 @@ public class CTIndustrialGrinder extends CTGeneric { * @param euTick Amount of EU per tick consumed during crafting */ @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) { - addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick); + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) { + return addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick); } /** @@ -69,7 +69,7 @@ public class CTIndustrialGrinder extends CTGeneric { * @param euTick Amount of EU per tick consumed during crafting */ @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input1); // There is only one input slot in Industrial Grinder @@ -82,6 +82,7 @@ public class CTIndustrialGrinder extends CTGeneric { IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } /** diff --git a/src/main/java/techreborn/compat/crafttweaker/CTIndustrialSawmill.java b/src/main/java/techreborn/compat/crafttweaker/CTIndustrialSawmill.java index 3767b8c56..582b54922 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTIndustrialSawmill.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTIndustrialSawmill.java @@ -38,22 +38,22 @@ import techreborn.api.recipe.machines.IndustrialSawmillRecipe; public class CTIndustrialSawmill extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick) { - addRecipe(output1, output2, output3, input1, fluid, ticktime, euTick, true); + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick) { + return addRecipe(output1, output2, output3, input1, fluid, ticktime, euTick, true); } @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick) { - addRecipe(output1, output2, output3, input1, null, ticktime, euTick, true); + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick) { + return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, true); } @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic) { - addRecipe(output1, output2, output3, input1, null, ticktime, euTick, useOreDic); + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic) { + return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, useOreDic); } @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) { + public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) { Object oInput1 = CraftTweakerCompat.toObject(input1); FluidStack fluidStack = null; @@ -64,6 +64,7 @@ public class CTIndustrialSawmill extends CTGeneric { IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), ticktime, euTick, useOreDic); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/CTVacuumFreezer.java b/src/main/java/techreborn/compat/crafttweaker/CTVacuumFreezer.java index bc78df186..1dc748136 100644 --- a/src/main/java/techreborn/compat/crafttweaker/CTVacuumFreezer.java +++ b/src/main/java/techreborn/compat/crafttweaker/CTVacuumFreezer.java @@ -36,11 +36,12 @@ import techreborn.api.recipe.machines.VacuumFreezerRecipe; public class CTVacuumFreezer extends CTGeneric { @ZenMethod - public static void addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) { + public static RecipeSettings addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) { Object oInput1 = CraftTweakerCompat.toObject(input); VacuumFreezerRecipe r = new VacuumFreezerRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick); addRecipe(r); + return new RecipeSettings(r); } @ZenMethod diff --git a/src/main/java/techreborn/compat/crafttweaker/RecipeSettings.java b/src/main/java/techreborn/compat/crafttweaker/RecipeSettings.java new file mode 100644 index 000000000..b4ba07aec --- /dev/null +++ b/src/main/java/techreborn/compat/crafttweaker/RecipeSettings.java @@ -0,0 +1,20 @@ +package techreborn.compat.crafttweaker; + +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; +import techreborn.api.recipe.BaseRecipe; + +@ZenClass("mods.techreborn.RecipeSettings") +public class RecipeSettings { + + private BaseRecipe baseRecipe; + + public RecipeSettings(BaseRecipe baseRecipe) { + this.baseRecipe = baseRecipe; + } + + @ZenMethod + public void setUseOreDict(boolean useOreDict){ + baseRecipe.setOreDict(useOreDict); + } +}