diff --git a/.gitignore b/.gitignore index c6ec652..5e727cd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ eclipse/ out/ *.txt .gradle/ +.idea/ GTTweaker.iml GTTweaker.ipr GTTweaker.iws diff --git a/src/main/java/gttweaker/GTTweaker.java b/src/main/java/gttweaker/GTTweaker.java index bb877fd..18a5a77 100644 --- a/src/main/java/gttweaker/GTTweaker.java +++ b/src/main/java/gttweaker/GTTweaker.java @@ -3,7 +3,8 @@ import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.*; -import gttweaker.mods.gregtech.*; +import gttweaker.mods.gregtech.Fuels; +import gttweaker.mods.gregtech.machines.*; import minetweaker.MineTweakerAPI; import gregtech.api.*; diff --git a/src/main/java/gttweaker/mods/gregtech/AddMultipleRecipeAction.java b/src/main/java/gttweaker/mods/gregtech/AddMultipleRecipeAction.java new file mode 100644 index 0000000..582403c --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/AddMultipleRecipeAction.java @@ -0,0 +1,170 @@ +package gttweaker.mods.gregtech; + +import gttweaker.util.exception.AnyIngredientException; +import gttweaker.util.exception.EmptyIngredientException; +import gttweaker.util.exception.OutOfStackSizeException; +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import minetweaker.api.minecraft.MineTweakerMC; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.*; + +/** + * Created by Techlone + */ +public abstract class AddMultipleRecipeAction extends OneWayAction { + private static void extendBySingle(Object singleArg, List> recipesData) { + for (List recipeData : recipesData) { + recipeData.add(singleArg); + } + } + + private static void extendByMultiple(List args, List> recipesData) { + List> originData = fullCopy(recipesData); + recipesData.clear(); + for (Object singleArg : args) { + List> tmp = fullCopy(originData); + extendBySingle(singleArg, tmp); + recipesData.addAll(tmp); + } + } + + private static List> fullCopy(List> recipesData) { + List> result = new ArrayList>(recipesData.size()); + for (List recipeData : recipesData) { + result.add(new ArrayList(recipeData)); + } + return result; + } + + private String description; + private List> recipesData; + private int aid; // argument index, equate to zero before applySingleRecipe call + + private void addArgument(Object recipeArg) { + if (recipeArg instanceof ILiquidStack) { + extendBySingle(MineTweakerMC.getLiquidStack((ILiquidStack) recipeArg), recipesData); + } else if (recipeArg instanceof ILiquidStack[]) { + extendBySingle(MineTweakerMC.getLiquidStacks((ILiquidStack[]) recipeArg), recipesData); + } else if (recipeArg instanceof IItemStack) { + extendBySingle(MineTweakerMC.getItemStack((IItemStack) recipeArg), recipesData); + } else if (recipeArg instanceof IItemStack[]) { + extendBySingle(MineTweakerMC.getItemStacks((IItemStack[]) recipeArg), recipesData); + } else if (recipeArg instanceof IIngredient) { + extendByMultiple(getItemStacks((IIngredient) recipeArg), recipesData); + } else { + extendBySingle(recipeArg, recipesData); + } + } + + private List getItemStacks(IIngredient ingredientArg) { + List items = ingredientArg.getItems(); + if (items == null) { + throw new AnyIngredientException(); + } + if (items.size() == 0) { + throw new EmptyIngredientException(ingredientArg); + } + List itemStackList = Arrays.asList(MineTweakerMC.getItemStacks(items)); + int amount = ingredientArg.getAmount(); + if (amount < 0) { + throw new RuntimeException("Negative amount for ingredient " + ingredientArg); + } + for (ItemStack stack : itemStackList) { + if (amount > stack.getMaxStackSize()) { + throw new OutOfStackSizeException(ingredientArg, amount); + } + stack.stackSize = amount; + } + return itemStackList; + } + + protected AddMultipleRecipeAction(String description, Object... recipeArgs) { + this.description = description; + + recipesData = new ArrayList>(recipeArgs.length); + recipesData.add(new ArrayList()); + + try { + for (Object recipeArg : recipeArgs) { + addArgument(recipeArg); + } + } catch (Exception e) { + MineTweakerAPI.logError(e.toString()); + } + } + + protected abstract void applySingleRecipe(ArgIterator i); + + protected static class ArgIterator { + private Iterator iterator; + + public ArgIterator(List args) { + this.iterator = args.iterator(); + } + + public ItemStack nextItem() { + return (ItemStack) iterator.next(); + } + + public ItemStack[] nextItemArr() { + return (ItemStack[]) iterator.next(); + } + + public FluidStack nextFluid() { + return (FluidStack) iterator.next(); + } + + public FluidStack[] nextFluidArr() { + return (FluidStack[]) iterator.next(); + } + + public int nextInt() { + return (Integer) iterator.next(); + } + + public int[] nextIntArr() { + return (int[]) iterator.next(); + } + + public boolean nextBool() { + return (Boolean) iterator.next(); + } + } + + @Override + public void apply() { + for (List recipeData : recipesData) { + applySingleRecipe(new ArgIterator(recipeData)); + } + } + + @Override + public String describe() { + return this.description; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AddMultipleRecipeAction that = (AddMultipleRecipeAction) o; + return recipesData != null ? recipesData.equals(that.recipesData) : that.recipesData == null; + } + + @Override + public int hashCode() { + return recipesData != null ? recipesData.hashCode() : 0; + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/AlloySmelter.java b/src/main/java/gttweaker/mods/gregtech/AlloySmelter.java deleted file mode 100644 index cd0b71a..0000000 --- a/src/main/java/gttweaker/mods/gregtech/AlloySmelter.java +++ /dev/null @@ -1,114 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provider access to the Alloy Smelter recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.AlloySmelter") -@ModOnly(MOD_ID) -public class AlloySmelter { - /** - * Adds an alloy smelter recipe. - * - * @param output alloy smelter output - * @param input1 primary input - * @param input2 secondary input - * @param durationTicks smelting time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, int duration, int euPerTick) { - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addAlloySmelterRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding alloy smelter recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 53 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 53 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 53 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 53 * hash + this.duration; - hash = 53 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Amplifabricator.java b/src/main/java/gttweaker/mods/gregtech/Amplifabricator.java deleted file mode 100644 index 2d7445b..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Amplifabricator.java +++ /dev/null @@ -1,101 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Amplifabricator recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Amplifabricator") -@ModOnly(MOD_ID) -public class Amplifabricator { - /** - * Adds a Amplifabricator recipe. - * - * @param input primary Input - * @param duration reaction time, in ticks - * @param amount amount in mb of Liquid UU Output - * - */ - @ZenMethod - public static void addRecipe(IIngredient input, int duration, int amount) { - MineTweakerAPI.apply(new AddRecipeAction(input, duration, amount)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IIngredient input; - private final int duration; - private final int amount; - - public AddRecipeAction(IIngredient input, int duration, int amount) { - - this.input = input; - this.duration = duration; - this.amount = amount; - } - - @Override - public void apply() { - RA.addAmplifier( - MineTweakerMC.getItemStack(input), - duration, - amount); - } - - @Override - public String describe() { - return "Adding Amplifabricator recipe for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 1; - hash = 12 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 12 * hash + this.duration; - hash = 12 * hash + this.amount; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.amount != other.amount) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/ArcFurnace.java b/src/main/java/gttweaker/mods/gregtech/ArcFurnace.java deleted file mode 100644 index 1b71ec2..0000000 --- a/src/main/java/gttweaker/mods/gregtech/ArcFurnace.java +++ /dev/null @@ -1,129 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Arc Furnace recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.ArcFurnace") -@ModOnly(MOD_ID) -public class ArcFurnace { - /** - * Adds an Arc Furnace recipe. - * - * @param outputs 1-4 recipe output - * @param input primary input - * @param fluidInput primary fluidInput - * @param outChances chances of 1-4 output - * @param durationTicks assembling duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[]outputs, IItemStack input, ILiquidStack fluidInput, int[] outChances, int durationTicks, int euPerTick) { - if (outputs.length < 1) { - MineTweakerAPI.logError("Arc Furnace must have at least 1 output"); - } else if(outputs.length!=outChances.length){ - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - }else { - MineTweakerAPI.apply(new AddRecipeAction(outputs, input, fluidInput, outChances, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final IItemStack input; - private final ILiquidStack fluidInput; - private final int[] chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, IItemStack input, ILiquidStack fluidInput, int[] outChances, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.fluidInput = fluidInput; - this.chances = outChances; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addSimpleArcFurnaceRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getItemStacks(output), - chances, - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Arc Furnace recipe for " + input; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 6; - hash = 11 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 11 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 11 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 11 * hash + this.duration; - hash = 11 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.chances != other.chances){ - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/Assembler.java b/src/main/java/gttweaker/mods/gregtech/Assembler.java deleted file mode 100644 index e0ca9b8..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Assembler.java +++ /dev/null @@ -1,168 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the assembler recipes. - * - * @author Blood Asp - * @author DreamMasterXXL - * @author bculkin2442 - */ -@ZenClass("mods.gregtech.Assembler") -@ModOnly(MOD_ID) -public class Assembler { - /** - * Adds an assemble recipe. - * - * @param output recipe output - * @param input1 primary input - * @param input2 secondary input (optional, can be null) - * @param fluidInput1 primary fluidInput - * @param durationTicks assembling duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, ILiquidStack fluidInput1, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddFluidRecipeAction(output, input1, input2, fluidInput1, durationTicks, euPerTick)); - } - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, int duration, int euPerTick) { - - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addAssemblerRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding assembler recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - } - - private static class AddFluidRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final ILiquidStack fluidInput1; - private final int duration; - private final int euPerTick; - - public AddFluidRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, ILiquidStack fluidInput1, int duration, int euPerTick) { - - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.fluidInput1 = fluidInput1; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addAssemblerRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getLiquidStack(fluidInput1), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding assembler recipe with fluid Support for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 77 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 77 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 77 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 77 * hash + (this.fluidInput1 != null ? this.fluidInput1.hashCode() : 0); - hash = 77 * hash + this.duration; - hash = 77 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddFluidRecipeAction other = (AddFluidRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.fluidInput1 != other.fluidInput1 && (this.fluidInput1 == null || !this.fluidInput1.equals(other.fluidInput1))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/Autoclave.java b/src/main/java/gttweaker/mods/gregtech/Autoclave.java deleted file mode 100644 index b3c1c0c..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Autoclave.java +++ /dev/null @@ -1,116 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; -/** - * Provides access to the Autoclave recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Autoclave") -@ModOnly(MOD_ID) -public class Autoclave { - /** - * Adds an Autoclave recipe. - * - * @param output primary output - * @param input primary input - * @param fluidInput primary fluidInput - * @param chances chances - * @param durationTicks assembling duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, ILiquidStack fluidInput, int chances, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, fluidInput, chances, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input; - private final ILiquidStack fluidInput; - private final int chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, ILiquidStack fluidInput, int chances, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.fluidInput = fluidInput; - this.chances = chances; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addAutoclaveRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getItemStack(output), - chances, - duration, - euPerTick); - } - @Override - public String describe() { - return "Adding Autoclave recipe for " + output; - } - @Override - public Object getOverrideKey() { - return null; - } - @Override - public int hashCode() { - int hash = 7; - hash = 22 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 22 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 22 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 22 * hash + this.duration; - hash = 22 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Blastfurnace.java b/src/main/java/gttweaker/mods/gregtech/Blastfurnace.java deleted file mode 100644 index b1c1708..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Blastfurnace.java +++ /dev/null @@ -1,185 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Blast Furnace recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.BlastFurnace") -@ModOnly(MOD_ID) -public class Blastfurnace { - /** - * Adds a Blast Furnace recipe. - * - * @param output recipe output 1+2 - * @param fluidInput primary fluidInput - * @param input recipes input 1+2 - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * @param heat heat in Kelvin - * - */ - - @ZenMethod - public static void addRecipe(IItemStack[]output, ILiquidStack fluidInput, IItemStack[] input, int durationTicks, int euPerTick, int heat) { - if (output.length == 0) { - MineTweakerAPI.logError("Blast furnace recipe requires at least 1 input"); - } else { - MineTweakerAPI.apply(new AddFluidRecipeAction(output, fluidInput, input, durationTicks, euPerTick, heat)); - } - } - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack[] input, int durationTicks, int euPerTick, int heat) { - if (output.length == 0) { - MineTweakerAPI.logError("Blast furnace recipe requires at least 1 input"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output, input, durationTicks, euPerTick, heat)); - } - - } - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final IItemStack[] input; - private final int duration; - private final int euPerTick; - private final int heat; - - public AddRecipeAction(IItemStack[] output, IItemStack[] input, int duration, int euPerTick, int heat) { - - this.output = output; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - this.heat = heat; - } - - @Override - public void apply() { - RA.addBlastRecipe( - MineTweakerMC.getItemStack(input[0]), - input.length > 1 ? MineTweakerMC.getItemStack(input[1]) : null, - MineTweakerMC.getLiquidStack(null), - MineTweakerMC.getLiquidStack(null), - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - duration, - euPerTick, - heat); - } - - @Override - public String describe() { - return "Adding Blast furnace recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - } - - private static class AddFluidRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final ILiquidStack fluidInput; - private final IItemStack[] input; - private final int duration; - private final int euPerTick; - private final int heat; - - public AddFluidRecipeAction(IItemStack[] output, ILiquidStack fluidInput, IItemStack[] input, int duration, int euPerTick, int heat) { - - this.output = output; - this.fluidInput = fluidInput; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - this.heat = heat; - } - - @Override - public void apply() { - RA.addBlastRecipe( - MineTweakerMC.getItemStack(input[0]), - input.length > 1 ? MineTweakerMC.getItemStack(input[1]) : null, - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(null), - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - duration, - euPerTick, - heat); - } - - @Override - public String describe() { - return "Adding Blast furnace recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 4; - hash = 67 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 67 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 67 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 67 * hash + this.duration; - hash = 67 * hash + this.euPerTick; - hash = 67 * hash + this.heat; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddFluidRecipeAction other = (AddFluidRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - if (this.heat != other.heat) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/Brewery.java b/src/main/java/gttweaker/mods/gregtech/Brewery.java deleted file mode 100644 index d61d414..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Brewery.java +++ /dev/null @@ -1,111 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Brewing Machine recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Brewery") -@ModOnly(MOD_ID) -public class Brewery { - /** - * Adds a Brewing Machine recipe. - * - * @param fluidOutput primary fluid output - * @param Ingredient primary input - * @param fluidInput primary fluid input - * @param Hidden hidden true or false - * - */ - @ZenMethod - public static void addRecipe(ILiquidStack fluidOutput, IItemStack Ingredient, ILiquidStack fluidInput, boolean Hidden) { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, Ingredient, fluidInput, Hidden)); - } - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack Ingredient; - private final ILiquidStack fluidOutput; - private final ILiquidStack fluidInput; - private final boolean Hidden; - - public AddRecipeAction(ILiquidStack fluidOutput, IItemStack Ingredient, ILiquidStack fluidInput, boolean Hidden) { - - this.Ingredient = Ingredient; - this.fluidOutput = fluidOutput; - this.fluidInput = fluidInput; - this.Hidden = Hidden; - } - - @Override - public void apply() { - RA.addBrewingRecipe( - MineTweakerMC.getItemStack(Ingredient), - MineTweakerMC.getLiquidStack(fluidOutput).getFluid(), - MineTweakerMC.getLiquidStack(fluidInput).getFluid(), - Hidden); - - } - - @Override - public String describe() { - return "Adding Brewery recipe for " + fluidOutput ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 9; - hash = 8 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 8 * hash + (this.Ingredient != null ? this.Ingredient.hashCode() : 0); - hash = 8 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.Ingredient != other.Ingredient && (this.Ingredient == null || !this.Ingredient.equals(other.Ingredient))) { - - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.Hidden != other.Hidden) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Canner.java b/src/main/java/gttweaker/mods/gregtech/Canner.java deleted file mode 100644 index f0bc669..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Canner.java +++ /dev/null @@ -1,140 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provider access to the Canner recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.Canner") -@ModOnly(MOD_ID) -public class Canner { - /** - * Adds a canner recipe with a single output. - * - * @param output crafting output - * @param input1 primary input - * @param input2 secondary input (optional - * @param durationTicks crafting duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, null, input1, input2, durationTicks, euPerTick)); - } - - /** - * Adds a canner recipe with multiple outputs. - * - * @param output array with 1 or 2 outputs - * @param input1 primary inputs - * @param input2 secondary inputs - * @param durationTicks crafting duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - if (output.length == 0) { - MineTweakerAPI.logError("canner requires at least 1 output"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output[0], output.length > 1 ? output[1] : null, input1, input2, durationTicks, euPerTick)); - } - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output1; - private final IItemStack output2; - private final IItemStack input1; - private final IItemStack input2; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output1, IItemStack output2, IItemStack input1, IItemStack input2, int duration, int euPerTick) { - - this.output1 = output1; - this.output2 = output2; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addCannerRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output1), - MineTweakerMC.getItemStack(output2), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding canner recipe for " + output1; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 79 * hash + (this.output1 != null ? this.output1.hashCode() : 0); - hash = 79 * hash + (this.output2 != null ? this.output2.hashCode() : 0); - hash = 79 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 79 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 79 * hash + this.duration; - hash = 79 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output1 != other.output1 && (this.output1 == null || !this.output1.equals(other.output1))) { - return false; - } - if (this.output2 != other.output2 && (this.output2 == null || !this.output2.equals(other.output2))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Centrifuge.java b/src/main/java/gttweaker/mods/gregtech/Centrifuge.java deleted file mode 100644 index a9e76db..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Centrifuge.java +++ /dev/null @@ -1,248 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Centrifuge recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Centrifuge") -@ModOnly(MOD_ID) -public class Centrifuge { - /** - * Adds a Centrifuge recipe. - * - * @param outputs array with 1-6 outputs - * @param fluidOutput primary fluid output - * @param input primary input - * @param cells Cell input - * @param fluidInput primary fluid input - * @param chances chance 1-6 - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * - */ - @ZenMethod - public static void addRecipe(IItemStack[] outputs, ILiquidStack fluidOutput, IItemStack input, IItemStack cells, ILiquidStack fluidInput, int[] chances, int durationTicks, int euPerTick) { - if (outputs.length < 1) { - MineTweakerAPI.logError("Centrifuge must have at least 1 output"); - } else if(outputs.length!=chances.length){ - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - }else { - MineTweakerAPI.apply(new AddFluidRecipeAction(outputs, fluidOutput, input, cells, fluidInput, chances, durationTicks, euPerTick)); - } - } - - @ZenMethod - public static void addRecipeFuelCan(IItemStack[] outputs, IItemStack input, int numCans, int duration) { - if (outputs.length < 1) { - MineTweakerAPI.logError("centrifuge must have at least 1 output"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(outputs, input, -numCans, duration)); - } - } - - @ZenMethod - public static void addRecipe(IItemStack[] outputs, IItemStack input, int cells, int durationTicks) { - if (outputs.length < 1) { - MineTweakerAPI.logError("centrifuge must have at least 1 output"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(outputs, input, cells, durationTicks)); - } - } - - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack[] output; - private final IItemStack input; - private final int cells; - private final int duration; - - public AddRecipeAction(IItemStack[] output, IItemStack input, int cells, int duration) { - - this.output = output; - this.input = input; - this.cells = cells; - this.duration = duration; - } - - @Override - public void apply() { - RA.addCentrifugeRecipe( - MineTweakerMC.getItemStack(input), - cells, - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - output.length > 2 ? MineTweakerMC.getItemStack(output[2]) : null, - output.length > 3 ? MineTweakerMC.getItemStack(output[3]) : null, - output.length > 4 ? MineTweakerMC.getItemStack(output[4]) : null, - output.length > 5 ? MineTweakerMC.getItemStack(output[5]) : null, - duration); - } - - @Override - public String describe() { - return "Adding centrifuge recipe with input " + input; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 59 * hash + Arrays.deepHashCode(this.output); - hash = 59 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 59 * hash + this.cells; - hash = 59 * hash + this.duration; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (!Arrays.deepEquals(this.output, other.output)) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.cells != other.cells) { - return false; - } - if (this.duration != other.duration) { - return false; - } - return true; - } - } - - private static class AddFluidRecipeAction extends OneWayAction { - - private final IItemStack[] outputs; - private final ILiquidStack fluidOutput; - private final IItemStack input; - private final IItemStack cells; - private final ILiquidStack fluidInput; - private final int [] chances; - private final int duration; - private final int euPerTick; - - public AddFluidRecipeAction(IItemStack[] outputs, ILiquidStack fluidOutput, IItemStack input, IItemStack cells, ILiquidStack fluidInput, int[] chances, int duration, int euPerTick) { - - this.outputs = outputs; - this.fluidOutput = fluidOutput; - this.input = input; - this.cells = cells; - this.fluidInput = fluidInput; - this.chances = chances; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addCentrifugeRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(cells), - MineTweakerMC.getLiquidStack(fluidOutput), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getItemStack(outputs[0]), - outputs.length > 1 ? MineTweakerMC.getItemStack(outputs[1]) : null, - outputs.length > 2 ? MineTweakerMC.getItemStack(outputs[2]) : null, - outputs.length > 3 ? MineTweakerMC.getItemStack(outputs[3]) : null, - outputs.length > 4 ? MineTweakerMC.getItemStack(outputs[4]) : null, - outputs.length > 5 ? MineTweakerMC.getItemStack(outputs[5]) : null, - chances, - duration, - euPerTick); - - } - - @Override - public String describe() { - return "Adding Centrifuge recipe with Fluids for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 6; - hash = 55 * hash + (this.outputs != null ? this.outputs.hashCode() : 0); - hash = 55 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 55 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 55 * hash + (this.cells != null ? this.cells.hashCode() : 0); - hash = 55 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 55 * hash + this.duration; - hash = 55 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddFluidRecipeAction other = (AddFluidRecipeAction) obj; - if (this.outputs != other.outputs && (this.outputs == null || !this.outputs.equals(other.outputs))) { - return false; - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.cells != other.cells && (this.cells == null || !this.cells.equals(other.cells))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/ChemicalBath.java b/src/main/java/gttweaker/mods/gregtech/ChemicalBath.java deleted file mode 100644 index 41ae4c3..0000000 --- a/src/main/java/gttweaker/mods/gregtech/ChemicalBath.java +++ /dev/null @@ -1,131 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Chemical Bath recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.ChemicalBath") -@ModOnly(MOD_ID) -public class ChemicalBath { - /** - * Adds a Chemical Bath recipe. - * - * @param output outputs 1-3 - * @param input primary input - * @param fluidInput primary fluidInput - * @param chances chance of 3 outputs - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack input, ILiquidStack fluidInput, int[] chances, int durationTicks, int euPerTick) { - if (output.length == 0) { - MineTweakerAPI.logError("chemical bath requires at least 1 output"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output, input, fluidInput, chances, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final IItemStack input; - private final ILiquidStack fluidInput; - private final int[] chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, IItemStack input, ILiquidStack fluidInput, int[] chances, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.fluidInput = fluidInput; - this.chances = chances; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addChemicalBathRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - output.length > 2 ? MineTweakerMC.getItemStack(output[2]) : null, - chances, - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Chemical Bath recipe for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 9; - hash = 8 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 8 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 8 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 8 * hash + this.duration; - hash = 8 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/ChemicalReactor.java b/src/main/java/gttweaker/mods/gregtech/ChemicalReactor.java deleted file mode 100644 index 371dd08..0000000 --- a/src/main/java/gttweaker/mods/gregtech/ChemicalReactor.java +++ /dev/null @@ -1,199 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Chemical Reactor recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.ChemicalReactor") -@ModOnly(MOD_ID) -public class ChemicalReactor { - /** - * Adds a Chemical Reactor recipe. - * - * @param output recipe output - * @param fluidOutput1 primary fluidInput - * @param input1 primary input - * @param input2 secondary input - * @param fluidInput1 primary fluidInput - * @param durationTicks reaction time, in ticks - */ - @ZenMethod - public static void addRecipe(IItemStack output, ILiquidStack fluidOutput1, IItemStack input1, IItemStack input2, ILiquidStack fluidInput1, int durationTicks) { - MineTweakerAPI.apply(new AddFluidRecipeAction(output, fluidOutput1, input1, input2, fluidInput1, durationTicks)); - } - - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks)); - } - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final int duration; - - public AddRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, int duration) { - - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - } - - @Override - public void apply() { - RA.addChemicalRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - duration); - } - - @Override - public String describe() { - return "Adding Chemical Reactor recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 11 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 11 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 11 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 11 * hash + this.duration; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - return true; - } - } - - private static class AddFluidRecipeAction extends OneWayAction { - - private final IItemStack output; - private final ILiquidStack fluidOutput1; - private final IItemStack input1; - private final IItemStack input2; - private final ILiquidStack fluidInput1; - private final int duration; - - public AddFluidRecipeAction(IItemStack output, ILiquidStack fluidOutput1, IItemStack input1, IItemStack input2, ILiquidStack fluidInput1, int duration) { - - this.output = output; - this.fluidOutput1 = fluidOutput1; - this.input1 = input1; - this.input2 = input2; - this.fluidInput1 = fluidInput1; - this.duration = duration; - } - - @Override - public void apply() { - RA.addChemicalRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getLiquidStack(fluidInput1), - MineTweakerMC.getLiquidStack(fluidOutput1), - MineTweakerMC.getItemStack(output), - duration); - } - - @Override - public String describe() { - return "Adding Chemical Reactor recipe with Liquid support for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 12 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 12 * hash + (this.fluidOutput1 != null ? this.fluidOutput1.hashCode() : 0); - hash = 12 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 12 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 12 * hash + (this.fluidInput1 != null ? this.fluidInput1.hashCode() : 0); - hash = 12 * hash + this.duration; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddFluidRecipeAction other = (AddFluidRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.fluidOutput1 != other.fluidOutput1 && (this.fluidOutput1 == null || !this.fluidOutput1.equals(other.fluidOutput1))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.fluidInput1 != other.fluidInput1 && (this.fluidInput1 == null || !this.fluidInput1.equals(other.fluidInput1))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/CuttingSaw.java b/src/main/java/gttweaker/mods/gregtech/CuttingSaw.java deleted file mode 100644 index bbdd2fc..0000000 --- a/src/main/java/gttweaker/mods/gregtech/CuttingSaw.java +++ /dev/null @@ -1,140 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Saw recipes. - * - * @author DreamMasterXXL - * @author bculkin2442 - */ -@ZenClass("mods.gregtech.CuttingSaw") -@ModOnly(MOD_ID) -public class CuttingSaw { - /** - * Adds a Cutting Saw recipe. - * - * @param output1 recipe output1 - * @param output2 recipe output2 - * @param input primary input - * @param lubricant primary fluidInput - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack input, ILiquidStack lubricant, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output1, output2, input, lubricant, durationTicks, euPerTick)); - } - - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack input, ILiquidStack lubricant, int durationTicks, int euPerTick) { - if (output.length == 0) { - MineTweakerAPI.logError("canner requires at least 1 output"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output[0], output.length > 1 ? output[1] : null, input, lubricant, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output1; - private final IItemStack output2; - private final IItemStack input; - private final ILiquidStack lubricant; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output1, IItemStack output2, IItemStack input, ILiquidStack lubricant, int duration, int euPerTick1) { - - this.output1 = output1; - this.output2 = output2; - this.input = input; - this.lubricant = lubricant; - this.duration = duration; - this.euPerTick = euPerTick1; - } - - @Override - public void apply() { - if (lubricant == null) { - RA.addCutterRecipe(MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output1), - MineTweakerMC.getItemStack(output2), - duration, - euPerTick); - - } else { - RA.addCutterRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(lubricant), - MineTweakerMC.getItemStack(output1), - MineTweakerMC.getItemStack(output2), - duration, - euPerTick); - } - } - - @Override - public String describe() { - return "Adding Cutting Saw recipe for " + input; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 99 * hash + (this.output1 != null ? this.output1.hashCode() : 0); - hash = 99 * hash + (this.output2 != null ? this.output2.hashCode() : 0); - hash = 99 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 99 * hash + (this.lubricant != null ? this.lubricant.hashCode() : 0); - hash = 99 * hash + this.duration; - hash = 99 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output1 != other.output1 && (this.output1 == null || !this.output1.equals(other.output1))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.lubricant != other.lubricant && (this.lubricant == null || !this.lubricant.equals(other.lubricant))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/DistillationTower.java b/src/main/java/gttweaker/mods/gregtech/DistillationTower.java deleted file mode 100644 index 7209f85..0000000 --- a/src/main/java/gttweaker/mods/gregtech/DistillationTower.java +++ /dev/null @@ -1,130 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import net.minecraftforge.fluids.FluidStack; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Distillation Tower recipes. - * - * @author DreamMasterXXL - * @author Blood Asp - */ -@ZenClass("mods.gregtech.DistillationTower") -@ModOnly(MOD_ID) -public class DistillationTower { - /** - * Adds an Distillation Tower recipe. - * - * @param fluidInput Fluid Input - * @param fluidOutput Up to 6 Fluid Outputs - * @param itemOutput Item output Slot - * @param durationTicks duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(ILiquidStack[] fluidOutput, IItemStack itemOutput, ILiquidStack fluidInput, int durationTicks, int euPerTick) { - if (fluidOutput.length < 1) { - MineTweakerAPI.logError("Distillation Twower must have at least 1 Fluid output"); - }else { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, itemOutput, fluidInput, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final FluidStack[] fluidOutput; - private final IItemStack itemOutput; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(ILiquidStack[] fluidOutput, IItemStack itemOutput, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.fluidOutput = new FluidStack[fluidOutput.length]; - this.itemOutput = itemOutput; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - - for(int i =0;i< fluidOutput.length;i++){ - this.fluidOutput[i]=MineTweakerMC.getLiquidStack(fluidOutput[i]); - } - - } - - - @Override - public void apply() { - RA.addDistillationTowerRecipe( - MineTweakerMC.getLiquidStack(fluidInput), - this.fluidOutput, - MineTweakerMC.getItemStack(itemOutput), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Distillation Tower recipe for " + fluidInput.getDisplayName(); - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 1; - hash = 9 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 9 * hash + Arrays.deepHashCode(this.fluidOutput); - hash = 9 * hash + (this.itemOutput != null ? this.itemOutput.hashCode() : 0); - hash = 9 * hash + this.duration; - hash = 9 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (!Arrays.deepEquals(this.fluidOutput, other.fluidOutput)) { - return false; - } - if (this.itemOutput != other.itemOutput && (this.itemOutput == null || !this.itemOutput.equals(other.itemOutput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/Distillery.java b/src/main/java/gttweaker/mods/gregtech/Distillery.java deleted file mode 100644 index f974316..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Distillery.java +++ /dev/null @@ -1,126 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Distillery recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Distillery") -@ModOnly(MOD_ID) -public class Distillery { - /** - * Adds a Distillery recipe. - * - * @param fluidOutput Fluid output - * @param Circuit Circuit - * @param fluidInput fluidInput - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * @param Hidden hidden - * - */ - @ZenMethod - public static void addRecipe(ILiquidStack fluidOutput, IItemStack Circuit, ILiquidStack fluidInput, int durationTicks, int euPerTick, boolean Hidden) { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, Circuit, fluidInput, durationTicks, euPerTick, Hidden)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final ILiquidStack fluidOutput; - private final IItemStack Circuit; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - private final boolean Hidden; - - public AddRecipeAction(ILiquidStack fluidOutput, IItemStack Circuit, ILiquidStack fluidInput, int duration, int euPerTick, boolean Hidden) { - - this.fluidOutput = fluidOutput; - this.Circuit = Circuit; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - this.Hidden = Hidden; - } - - @Override - public void apply() { - RA.addDistilleryRecipe( - MineTweakerMC.getItemStack(Circuit), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - euPerTick, - Hidden); - } - - @Override - public String describe() { - return "Adding Distillery recipe for " + fluidOutput ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 9; - hash = 8 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 8 * hash + (this.Circuit != null ? this.Circuit.hashCode() : 0); - hash = 8 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 8 * hash + this.duration; - hash = 8 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.Circuit != other.Circuit && (this.Circuit == null || !this.Circuit.equals(other.Circuit))) { - - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - if (this.Hidden != other.Hidden) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/Electrolyzer.java b/src/main/java/gttweaker/mods/gregtech/Electrolyzer.java deleted file mode 100644 index ea3fd71..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Electrolyzer.java +++ /dev/null @@ -1,246 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Electrolyzer recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Electrolyzer") -@ModOnly(MOD_ID) -public class Electrolyzer { - /** - * Adds a Electrolyzer recipe. - * - * @param output output 1-6 - * @param fluidOutput primary fluid output - * @param input primary input - * @param cells Cell input - * @param fluidInput primary fluid input - * @param chances chance 1-6 - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * - */ - @ZenMethod - public static void addRecipe(IItemStack[] output, ILiquidStack fluidOutput, IItemStack input, IItemStack cells, ILiquidStack fluidInput, int[] chances, int durationTicks, int euPerTick) { - if (output.length < 1) { - MineTweakerAPI.logError("Electrolyzer must have at least 1 output"); - } else if(output.length!=chances.length){ - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - }else { - MineTweakerAPI.apply(new AddFluidRecipeAction(output, fluidOutput, input, cells, fluidInput, chances, durationTicks, euPerTick)); - } - } - - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack input, int cells, int durationTicks, int euPerTick) { - if (output.length == 0) { - MineTweakerAPI.logError("Electrolyzer recipe requires at least 1 input"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output, input, cells, durationTicks, euPerTick)); - } - - } - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack[] output; - private final IItemStack input; - private final int cells; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, IItemStack input, int cells, int duration, int euPerTick) { - this.output = output; - this.input = input; - this.cells = cells; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addElectrolyzerRecipe( - MineTweakerMC.getItemStack(input), - cells, - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - output.length > 2 ? MineTweakerMC.getItemStack(output[2]) : null, - output.length > 3 ? MineTweakerMC.getItemStack(output[3]) : null, - output.length > 4 ? MineTweakerMC.getItemStack(output[4]) : null, - output.length > 5 ? MineTweakerMC.getItemStack(output[5]) : null, - duration, - cells); - } - - @Override - public String describe() { - return "Adding electrolyzer recipe with input " + input; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 97 * hash + Arrays.deepHashCode(this.output); - hash = 97 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 97 * hash + this.cells; - hash = 97 * hash + this.duration; - hash = 97 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (!Arrays.deepEquals(this.output, other.output)) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.cells != other.cells) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } - - private static class AddFluidRecipeAction extends OneWayAction { - - private final IItemStack [] output; - private final ILiquidStack fluidOutput; - private final IItemStack input; - private final IItemStack cells; - private final ILiquidStack fluidInput; - private final int [] chances; - private final int duration; - private final int euPerTick; - - public AddFluidRecipeAction(IItemStack [] output, ILiquidStack fluidOutput, IItemStack input, IItemStack cells, ILiquidStack fluidInput, int [] chances, int duration, int euPerTick) { - - this.output = output; - this.fluidOutput = fluidOutput; - this.input = input; - this.cells = cells; - this.fluidInput = fluidInput; - this.chances = chances; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addElectrolyzerRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(cells), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - output.length > 2 ? MineTweakerMC.getItemStack(output[2]) : null, - output.length > 3 ? MineTweakerMC.getItemStack(output[3]) : null, - output.length > 4 ? MineTweakerMC.getItemStack(output[4]) : null, - output.length > 5 ? MineTweakerMC.getItemStack(output[5]) : null, - chances, - duration, - euPerTick); - - } - - @Override - public String describe() { - return "Adding Electrolyzer recipe with Liquid support for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 8; - hash = 44 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 44 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 44 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 44 * hash + (this.cells != null ? this.cells.hashCode() : 0); - hash = 44 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 44 * hash + (this.chances != null ? this.chances.hashCode() : 0); - hash = 44 * hash + this.duration; - hash = 44 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddFluidRecipeAction other = (AddFluidRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - - } - if (this.cells != other.cells && (this.cells == null || !this.cells.equals(other.cells))) { - - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Extruder.java b/src/main/java/gttweaker/mods/gregtech/Extruder.java deleted file mode 100644 index d1f1535..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Extruder.java +++ /dev/null @@ -1,115 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the extruder recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.Extruder") -@ModOnly(MOD_ID) -public class Extruder { - /** - * Adds an extruder recipe. - * - * @param output recipe output - * @param input recipe input - * @param shape shape (set stack size to 0 to prevent the shape from being consumed) - * @param durationTicks extruding time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, IItemStack shape, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, shape, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input; - private final IItemStack shape; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, IItemStack shape, int duration, int euPerTick) { - this.output = output; - this.input = input; - this.shape = shape; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addExtruderRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(shape), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding extruder recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 67 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 67 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 67 * hash + (this.shape != null ? this.shape.hashCode() : 0); - hash = 67 * hash + this.duration; - hash = 67 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.shape != other.shape && (this.shape == null || !this.shape.equals(other.shape))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Fermenter.java b/src/main/java/gttweaker/mods/gregtech/Fermenter.java deleted file mode 100644 index 7bc8839..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Fermenter.java +++ /dev/null @@ -1,108 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Fermenter recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Fermenter") -@ModOnly(MOD_ID) -public class Fermenter { - /** - * Adds a Fermenter recipe. - * - * @param fluidOutput primary fluidOutput - * @param fluidInput primary fluidInput - * @param duration reaction time, in ticks - * @param Hidden hidden - * - */ - @ZenMethod - public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput, int duration, boolean Hidden) { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, fluidInput, duration, Hidden)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final ILiquidStack fluidOutput; - private final ILiquidStack fluidInput; - private final int duration; - private final boolean Hidden; - - public AddRecipeAction(ILiquidStack fluidOutput, ILiquidStack fluidInput, int duration, boolean Hidden) { - - this.fluidOutput = fluidOutput; - this.fluidInput = fluidInput; - this.duration = duration; - this.Hidden = Hidden; - } - - @Override - public void apply() { - RA.addFermentingRecipe( - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - Hidden); - - } - - @Override - public String describe() { - return "Adding Fermenter recipe for " + fluidOutput ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 2; - hash = 12 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 12 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 12 * hash + this.duration; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.Hidden != other.Hidden) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/FluidCanner.java b/src/main/java/gttweaker/mods/gregtech/FluidCanner.java deleted file mode 100644 index 2eca73e..0000000 --- a/src/main/java/gttweaker/mods/gregtech/FluidCanner.java +++ /dev/null @@ -1,115 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Fluid Canner recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.FluidCanner") -@ModOnly(MOD_ID) -public class FluidCanner { - /** - * Adds a Fluid Canner recipe. - * - * @param output output Slot - * @param input input Slot - * @param fluidOutput fluid Output Slot - * @param fluidInput fluid Input Slot - * - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, ILiquidStack fluidOutput, ILiquidStack fluidInput) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, fluidOutput, fluidInput)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input; - private final ILiquidStack fluidOutput; - private final ILiquidStack fluidInput; - - - public AddRecipeAction(IItemStack output, IItemStack input, ILiquidStack fluidOutput, ILiquidStack fluidInput) { - - this.output = output; - this.input = input; - this.fluidOutput = fluidOutput; - this.fluidInput = fluidInput; - - } - - @Override - public void apply() { - RA.addFluidCannerRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput)); - - } - - @Override - public String describe() { - return "Adding Fluid Canner recipe for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 91 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 91 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 91 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 91 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/FluidExtractor.java b/src/main/java/gttweaker/mods/gregtech/FluidExtractor.java deleted file mode 100644 index 5ba6799..0000000 --- a/src/main/java/gttweaker/mods/gregtech/FluidExtractor.java +++ /dev/null @@ -1,128 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Fluid Extractor recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.FluidExtractor") -@ModOnly(MOD_ID) -public class FluidExtractor { - /** - * Adds a Fluid Extractor recipe. - * - * @param output output Slot - * @param input input Slot - * @param fluidOutput fluidOutput Slot - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * @param chance chance output slot - * - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, ILiquidStack fluidOutput, int durationTicks, int euPerTick, int chance) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, fluidOutput, durationTicks, euPerTick, chance)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input; - private final ILiquidStack fluidOutput; - private final int duration; - private final int euPerTick; - private final int chance; - - public AddRecipeAction(IItemStack output, IItemStack input, ILiquidStack fluidOutput, int duration, int euPerTick, int chance) { - - this.output = output; - this.input = input; - this.fluidOutput = fluidOutput; - this.duration = duration; - this.euPerTick = euPerTick; - this.chance = chance; - } - - @Override - public void apply() { - RA.addFluidExtractionRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - euPerTick, - chance); - - } - - @Override - public String describe() { - return "Adding Fluid Extractor recipe for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 94 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 94 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 94 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 94 * hash + this.duration; - hash = 94 * hash + this.euPerTick; - hash = 94 * hash + this.chance; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - if (this.chance != other.chance) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/FluidHeater.java b/src/main/java/gttweaker/mods/gregtech/FluidHeater.java deleted file mode 100644 index 616b9e0..0000000 --- a/src/main/java/gttweaker/mods/gregtech/FluidHeater.java +++ /dev/null @@ -1,119 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Fluid Heater recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.FluidHeater") -@ModOnly(MOD_ID) -public class FluidHeater { - /** - * Adds a Fluid Heater recipe. - * - * @param fluidOutput Fluid output - * @param Circuit Circuit - * @param fluidInput fluid input - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * - */ - @ZenMethod - public static void addRecipe(ILiquidStack fluidOutput, IItemStack Circuit, ILiquidStack fluidInput, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, Circuit, fluidInput, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final ILiquidStack fluidOutput; - private final IItemStack Circuit; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(ILiquidStack fluidOutput, IItemStack Circuit, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.fluidOutput = fluidOutput; - this.Circuit = Circuit; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addFluidHeaterRecipe( - MineTweakerMC.getItemStack(Circuit), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Fluid Heater recipe for " + fluidOutput ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 44 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 44 * hash + (this.Circuit != null ? this.Circuit.hashCode() : 0); - hash = 44 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 44 * hash + this.duration; - hash = 44 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.Circuit != other.Circuit && (this.Circuit == null || !this.Circuit.equals(other.Circuit))) { - - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/FluidSolidifier.java b/src/main/java/gttweaker/mods/gregtech/FluidSolidifier.java deleted file mode 100644 index 70e999d..0000000 --- a/src/main/java/gttweaker/mods/gregtech/FluidSolidifier.java +++ /dev/null @@ -1,121 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Fluid Solidifier recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.FluidSolidifier") -@ModOnly(MOD_ID) -public class FluidSolidifier { - /** - * Adds a Fluid Solidifier recipe. - * - * @param output output Slot - * @param Mold mold Slot - * @param fluidInput fluidInput - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack Mold, ILiquidStack fluidInput, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, Mold, fluidInput, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack Mold; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack Mold, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.output = output; - this.Mold = Mold; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addFluidSolidifierRecipe( - MineTweakerMC.getItemStack(Mold), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - - } - - @Override - public String describe() { - return "Adding Fluid Solidifier recipe for " + output ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 94 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 94 * hash + (this.Mold != null ? this.Mold.hashCode() : 0); - hash = 94 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 94 * hash + this.duration; - hash = 94 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.Mold != other.Mold && (this.Mold == null || !this.Mold.equals(other.Mold))) { - - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/ForgeHammer.java b/src/main/java/gttweaker/mods/gregtech/ForgeHammer.java deleted file mode 100644 index 8875ce5..0000000 --- a/src/main/java/gttweaker/mods/gregtech/ForgeHammer.java +++ /dev/null @@ -1,107 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Forge Hammer recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.ForgeHammer") -@ModOnly(MOD_ID) -public class ForgeHammer { - /** - * Add a Forge Hammer recipe. - * - * @param output recipe output - * @param input recipe input - * @param durationTicks forging duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, int duration, int euPerTick) { - this.output = output; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addForgeHammerRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding forge hammer recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 97 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 97 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 97 * hash + this.duration; - hash = 97 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/FormingPress.java b/src/main/java/gttweaker/mods/gregtech/FormingPress.java deleted file mode 100644 index c02e7ea..0000000 --- a/src/main/java/gttweaker/mods/gregtech/FormingPress.java +++ /dev/null @@ -1,107 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Forming Press recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.FormingPress") -@ModOnly(MOD_ID) -public class FormingPress{ - /** - * Adds a Forming Press recipe. - * - * @param output recipe output - * @param input1 Item input - * @param input2 Press Form input - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, int duration, int euPerTick) { - - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addFormingPressRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - @Override - public String describe() {return "Adding Forming Press recipe for " + output;} - - @Override - public Object getOverrideKey() {return null;} - - @Override - public int hashCode() { - int hash = 3; - hash = 39 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 39 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 39 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 39 * hash + this.duration; - hash = 39 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Fuels.java b/src/main/java/gttweaker/mods/gregtech/Fuels.java index 48e88e3..6b3de15 100644 --- a/src/main/java/gttweaker/mods/gregtech/Fuels.java +++ b/src/main/java/gttweaker/mods/gregtech/Fuels.java @@ -1,11 +1,9 @@ package gttweaker.mods.gregtech; import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; import minetweaker.api.item.IIngredient; import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; @@ -24,12 +22,12 @@ public class Fuels { * Adds a Diesel Engine fuel. If the given item does not contain any liquid, * it will generate the equivalent of 1000 millibuckets. * - * @param output output item (optional, can be null) - * @param input input item + * @param output output item (optional, can be null) + * @param input input item * @param euPerMillibucket eu production per millibucket */ @ZenMethod - public static void addDieselFuel(IItemStack output, IItemStack input, int euPerMillibucket) { + public static void addDieselFuel(IItemStack output, IIngredient input, int euPerMillibucket) { MineTweakerAPI.apply(new AddRecipeAction(output, input, euPerMillibucket, 0)); } @@ -37,12 +35,12 @@ public static void addDieselFuel(IItemStack output, IItemStack input, int euPerM * Adds a Gas Turbine fuel. If the given item does not contain any liquid, * it will generate the equivalent of 1000 millibuckets. * - * @param output output item (optional, can be null) - * @param input input item + * @param output output item (optional, can be null) + * @param input input item * @param euPerMillibucket eu production per millibucket */ @ZenMethod - public static void addGasTurbineFuel(IItemStack output, IItemStack input, int euPerMillibucket) { + public static void addGasTurbineFuel(IItemStack output, IIngredient input, int euPerMillibucket) { MineTweakerAPI.apply(new AddRecipeAction(output, input, euPerMillibucket, 1)); } @@ -50,12 +48,12 @@ public static void addGasTurbineFuel(IItemStack output, IItemStack input, int eu * Adds a Thermal Generator fuel. If the given item does not contain any * liquid, it will generate the equivalent of 1000 millibuckets. * - * @param output output item (optional, can be null) - * @param input input item + * @param output output item (optional, can be null) + * @param input input item * @param euPerMillibucket eu production per millibucket */ @ZenMethod - public static void addThermalGeneratorFuel(IItemStack output, IItemStack input, int euPerMillibucket) { + public static void addThermalGeneratorFuel(IItemStack output, IIngredient input, int euPerMillibucket) { MineTweakerAPI.apply(new AddRecipeAction(output, input, euPerMillibucket, 2)); } @@ -63,12 +61,12 @@ public static void addThermalGeneratorFuel(IItemStack output, IItemStack input, * Adds a Dense Fluid Generator fuel. If the given item does not contain any * liquid, it will generate the equivalent of 1000 millibuckets. * - * @param output output item (optional, can be null) - * @param input input item + * @param output output item (optional, can be null) + * @param input input item * @param euPerMillibucket eu production per millibucket */ @ZenMethod - public static void addDenseFluidFuel(IItemStack output, IItemStack input, int euPerMillibucket) { + public static void addDenseFluidFuel(IItemStack output, IIngredient input, int euPerMillibucket) { MineTweakerAPI.apply(new AddRecipeAction(output, input, euPerMillibucket, 3)); } @@ -76,12 +74,12 @@ public static void addDenseFluidFuel(IItemStack output, IItemStack input, int eu * Adds a Plasma Generator fuel. If the given item does not contain any * liquid, it will generate the equivalent of 1000 millibuckets. * - * @param output output item (optional, can be null) - * @param input input item + * @param output output item (optional, can be null) + * @param input input item * @param euPerMillibucket eu production per millibucket */ @ZenMethod - public static void addPlasmaGeneratorFuel(IItemStack output, IItemStack input, int euPerMillibucket) { + public static void addPlasmaGeneratorFuel(IItemStack output, IIngredient input, int euPerMillibucket) { MineTweakerAPI.apply(new AddRecipeAction(output, input, euPerMillibucket, 4)); } @@ -89,12 +87,12 @@ public static void addPlasmaGeneratorFuel(IItemStack output, IItemStack input, i * Adds a Magic Generator fuel. If the given item does not contain any liquid, * it will generate the equivalent of 1000 millibuckets. * - * @param output output item (optional, can be null) - * @param input input item + * @param output output item (optional, can be null) + * @param input input item * @param euPerMillibucket eu production per millibucket */ @ZenMethod - public static void addMagicGeneratorFuel(IItemStack output, IItemStack input, int euPerMillibucket) { + public static void addMagicGeneratorFuel(IItemStack output, IIngredient input, int euPerMillibucket) { MineTweakerAPI.apply(new AddRecipeAction(output, input, euPerMillibucket, 5)); } @@ -102,79 +100,16 @@ public static void addMagicGeneratorFuel(IItemStack output, IItemStack input, in // ### Action classes ### // ###################### - private static class AddRecipeAction extends OneWayAction { - private static final String[] GENERATORS = { - "diesel", - "gas turbine", - "thermal", - "dense fluid", - "plasma", - "magic" - }; + private static class AddRecipeAction extends AddMultipleRecipeAction { + private static final String[] GENERATORS = {"diesel", "gas turbine", "thermal", "dense fluid", "plasma", "magic"}; - private final IItemStack output; - private final IItemStack input; - private final int euPerMillibucket; - private final int type; - - public AddRecipeAction(IItemStack output, IItemStack input, int euPerMillibucket, int type) { - this.output = output; - this.input = input; - this.euPerMillibucket = euPerMillibucket; - this.type = type; - } - - @Override - public void apply() { - RA.addFuel( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - euPerMillibucket, - type); - } - - @Override - public String describe() { - return "Adding " + GENERATORS[type] + " fuel " + input; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 59 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 59 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 59 * hash + this.euPerMillibucket; - hash = 59 * hash + this.type; - return hash; + public AddRecipeAction(IItemStack output, IIngredient input, int euPerMillibucket, int type) { + super("Adding " + GENERATORS[type] + " fuel " + input, input, output, euPerMillibucket, type); } @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.euPerMillibucket != other.euPerMillibucket) { - return false; - } - if (this.type != other.type) { - return false; - } - return true; + protected void applySingleRecipe(ArgIterator i) { + RA.addFuel(i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); } } } diff --git a/src/main/java/gttweaker/mods/gregtech/FusionReactor.java b/src/main/java/gttweaker/mods/gregtech/FusionReactor.java deleted file mode 100644 index 5421f8d..0000000 --- a/src/main/java/gttweaker/mods/gregtech/FusionReactor.java +++ /dev/null @@ -1,122 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Fusion Reactor recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.FusionReactor") -@ModOnly(MOD_ID) -public class FusionReactor { - /** - * Adds a Mixer recipe. - * - * @param fluidOutput primary fluid Output - * @param fluidInput1 primary fluid Input - * @param fluidInput2 secondary fluid Input - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * @param startEU Starting at ... EU - */ - @ZenMethod - public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput1, ILiquidStack fluidInput2, int durationTicks, int euPerTick, int startEU) { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, fluidInput1, fluidInput2, durationTicks, euPerTick, startEU)); - } - - // ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final ILiquidStack fluidOutput; - private final ILiquidStack fluidInput1; - private final ILiquidStack fluidInput2; - private final int duration; - private final int euPerTick; - private final int startEU; - - public AddRecipeAction(ILiquidStack fluidOutput, ILiquidStack fluidInput1, ILiquidStack fluidInput2, int duration, int euPerTick, int StartEU) { - - this.fluidOutput = fluidOutput; - this.fluidInput1 = fluidInput1; - this.fluidInput2 = fluidInput2; - this.duration = duration; - this.euPerTick = euPerTick; - this.startEU = StartEU; - } - - @Override - public void apply() { - RA.addFusionReactorRecipe( - MineTweakerMC.getLiquidStack(fluidInput2), - MineTweakerMC.getLiquidStack(fluidInput1), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - euPerTick, - startEU); - } - - @Override - public String describe() { - return "Adding Fusion Reactor recipe for " + fluidOutput; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 1; - hash = 99 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 99 * hash + (this.fluidInput1 != null ? this.fluidInput1.hashCode() : 0); - hash = 99 * hash + (this.fluidInput2 != null ? this.fluidInput2.hashCode() : 0); - hash = 99 * hash + this.duration; - hash = 99 * hash + this.euPerTick; - hash = 99 * hash + this.startEU; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.fluidInput1 != other.fluidInput1 && (this.fluidInput1 == null || !this.fluidInput1.equals(other.fluidInput1))) { - return false; - } - if (this.fluidInput2 != other.fluidInput2 && (this.fluidInput2 == null || !this.fluidInput2.equals(other.fluidInput2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - if (this.startEU != other.startEU) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/ImplosionCompressor.java b/src/main/java/gttweaker/mods/gregtech/ImplosionCompressor.java deleted file mode 100644 index bb6dac6..0000000 --- a/src/main/java/gttweaker/mods/gregtech/ImplosionCompressor.java +++ /dev/null @@ -1,122 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Implosion Compressor recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.ImplosionCompressor") -@ModOnly(MOD_ID) -public class ImplosionCompressor { - /** - * Adds an implosion compressor recipe with a single output. - * - * @param output recipe output - * @param input primary input - * @param tnt amount of TNT needed - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int tnt) { - MineTweakerAPI.apply(new AddRecipeAction(output, null, input, tnt)); - } - - /** - * Adds an implosion compressor recipe with one or two outputs. - * - * @param output array with 1-2 outputs - * @param input primary input - * @param tnt amount of TNT needed - */ - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack input, int tnt) { - if (output.length == 0) { - MineTweakerAPI.logError("Implosion compressor recipe requires at least 1 output"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output[0], output.length > 1 ? output[1] : null, input, tnt)); - } - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output1; - private final IItemStack output2; - private final IItemStack input1; - private final int tnt; - - public AddRecipeAction(IItemStack output1, IItemStack output2, IItemStack input1, int tnt) { - this.output1 = output1; - this.output2 = output2; - this.input1 = input1; - this.tnt = tnt; - } - - @Override - public void apply() { - RA.addImplosionRecipe( - MineTweakerMC.getItemStack(input1), - tnt, - MineTweakerMC.getItemStack(output1), - MineTweakerMC.getItemStack(output2)); - } - - @Override - public String describe() { - return "Adding Implosion compressor recipe for " + output1; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 97 * hash + (this.output1 != null ? this.output1.hashCode() : 0); - hash = 97 * hash + (this.output2 != null ? this.output2.hashCode() : 0); - hash = 97 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 97 * hash + this.tnt; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output1 != other.output1 && (this.output1 == null || !this.output1.equals(other.output1))) { - return false; - } - if (this.output2 != other.output2 && (this.output2 == null || !this.output2.equals(other.output2))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.tnt != other.tnt) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Lathe.java b/src/main/java/gttweaker/mods/gregtech/Lathe.java deleted file mode 100644 index c1b972b..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Lathe.java +++ /dev/null @@ -1,131 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Access point for Lathe recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.Lathe") -@ModOnly(MOD_ID) -public class Lathe { - /** - * Adds a lathe recipe with a single output. - * - * @param output recipe output - * @param input recipe input - * @param durationTicks crafting duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, null, input, durationTicks, euPerTick)); - } - - /** - * Adds a lathe recipe with 1 or 2 outputs. - * - * @param outputs array with 1-2 outputs - * @param input recipe input - * @param durationTicks crafting duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[] outputs, IItemStack input, int durationTicks, int euPerTick) { - if (outputs.length == 0) { - MineTweakerAPI.logError("Lathe recipe requires at least 1 input"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(outputs[0], outputs.length > 1 ? outputs[1] : null, input, durationTicks, euPerTick)); - } - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output1; - private final IItemStack output2; - private final IItemStack input; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output1, IItemStack output2, IItemStack input, int duration, int euPerTick) { - this.output1 = output1; - this.output2 = output2; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addLatheRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output1), - MineTweakerMC.getItemStack(output2), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding lathe recipe for " + output1; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 53 * hash + (this.output1 != null ? this.output1.hashCode() : 0); - hash = 53 * hash + (this.output2 != null ? this.output2.hashCode() : 0); - hash = 53 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 53 * hash + this.duration; - hash = 53 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output1 != other.output1 && (this.output1 == null || !this.output1.equals(other.output1))) { - return false; - } - if (this.output2 != other.output2 && (this.output2 == null || !this.output2.equals(other.output2))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Mixer.java b/src/main/java/gttweaker/mods/gregtech/Mixer.java deleted file mode 100644 index 3553234..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Mixer.java +++ /dev/null @@ -1,225 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** -* Provides access to the Mixer recipes. -* -* @author DreamMasterXXL -*/ -@ZenClass("mods.gregtech.Mixer") -@ModOnly(MOD_ID) -public class Mixer { - /** - * Adds a Mixer recipe. - * - * @param output recipe output - * @param fluidOutput primary fluidInput - * @param input input 1-4 - * @param fluidInput primary fluidInput - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, ILiquidStack fluidOutput, IItemStack[] input, ILiquidStack fluidInput, int durationTicks, int euPerTick) { - if (input.length == 0) { - MineTweakerAPI.logError("Lathe recipe requires at least 1 input"); - } else { - MineTweakerAPI.apply(new AddFluidRecipeAction(output, fluidOutput, input, fluidInput, durationTicks, euPerTick)); - } - } - - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack[] input, int durationTicks, int euPerTick) { - if (input.length == 0) { - MineTweakerAPI.logError("Lathe recipe requires at least 1 input"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(output, null, input, null, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddFluidRecipeAction extends OneWayAction { - - private final IItemStack output; - private final ILiquidStack fluidOutput; - private final IItemStack[] input; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddFluidRecipeAction(IItemStack output, ILiquidStack fluidOutput, IItemStack[] input, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.output = output; - this.fluidOutput = fluidOutput; - this.input = input; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addMixerRecipe( - MineTweakerMC.getItemStack(input[0]), - input.length > 1 ? MineTweakerMC.getItemStack(input[1]) : null, - input.length > 2 ? MineTweakerMC.getItemStack(input[2]) : null, - input.length > 3 ? MineTweakerMC.getItemStack(input[3]) : null, - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Mixer recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 6; - hash = 67 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 67 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 67 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 67 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 67 * hash + this.duration; - hash = 67 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddFluidRecipeAction other = (AddFluidRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final ILiquidStack fluidOutput; - private final IItemStack[] input; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, ILiquidStack fluidOutput, IItemStack[] input, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.output = output; - this.fluidOutput = fluidOutput; - this.input = input; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addMixerRecipe( - MineTweakerMC.getItemStack(input[0]), - input.length > 1 ? MineTweakerMC.getItemStack(input[1]) : null, - input.length > 2 ? MineTweakerMC.getItemStack(input[2]) : null, - input.length > 3 ? MineTweakerMC.getItemStack(input[3]) : null, - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Mixer recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 1; - hash = 17 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 17 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 17 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 17 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 17 * hash + this.duration; - hash = 17 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/OilCracker.java b/src/main/java/gttweaker/mods/gregtech/OilCracker.java deleted file mode 100644 index 8064dc2..0000000 --- a/src/main/java/gttweaker/mods/gregtech/OilCracker.java +++ /dev/null @@ -1,108 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the OilCracker recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.OilCracker") -@ModOnly(MOD_ID) -public class OilCracker { - /** - * Adds a Pyrolyse Oven recipe. - * - * @param fluidOutput recipe Fluid output - * @param fluidInput recipe Fluid input - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(fluidOutput, fluidInput, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - private static class AddRecipeAction extends OneWayAction { - - private final ILiquidStack fluidOutput; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(ILiquidStack fluidOutput, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.fluidOutput = fluidOutput; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addCrackingRecipe( - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding OilCracker recipe for " + fluidOutput; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 4; - hash = 43 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 43 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 43 * hash + this.duration; - hash = 43 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} - diff --git a/src/main/java/gttweaker/mods/gregtech/Packer.java b/src/main/java/gttweaker/mods/gregtech/Packer.java deleted file mode 100644 index 2c161fa..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Packer.java +++ /dev/null @@ -1,107 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Packer recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Packer") -@ModOnly(MOD_ID) -public class Packer{ - /** - * Adds a Packer recipe. - * - * @param output recipe output - * @param input1 Item input Slot 1 - * @param input2 Item input Slot 2 - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, int duration, int euPerTick) { - - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addBoxingRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - @Override - public String describe() {return "Adding Packer recipe for " + output;} - - @Override - public Object getOverrideKey() {return null;} - - @Override - public int hashCode() { - int hash = 1; - hash = 39 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 39 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 39 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 39 * hash + this.duration; - hash = 39 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/PlasmaArcFurnace.java b/src/main/java/gttweaker/mods/gregtech/PlasmaArcFurnace.java deleted file mode 100644 index e2b8b05..0000000 --- a/src/main/java/gttweaker/mods/gregtech/PlasmaArcFurnace.java +++ /dev/null @@ -1,137 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Plasma Arc Furnace recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.PlasmaArcFurnace") -@ModOnly(MOD_ID) -public class PlasmaArcFurnace { - /** - * Adds an Arc Furnace recipe. - * - * @param outputs 1-4 recipe output - * @param fluidOutput primary fluidOutput - * @param input primary input - * @param fluidInput primary fluidInput - * @param outChances chances of 1-4 output - * @param durationTicks assembling duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[] outputs, ILiquidStack fluidOutput, IItemStack input, ILiquidStack fluidInput, int[] outChances, int durationTicks, int euPerTick) { - if (outputs.length < 1) { - MineTweakerAPI.logError("Plasma Arc Furnace must have at least 1 output"); - } else if(outputs.length!=outChances.length){ - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - }else { - MineTweakerAPI.apply(new AddRecipeAction(outputs, fluidOutput, input, fluidInput, outChances, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final ILiquidStack fluidOutput; - private final IItemStack input; - private final ILiquidStack fluidInput; - private final int[] chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, ILiquidStack fluidOutput, IItemStack input, ILiquidStack fluidInput, int[] outChances, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.fluidInput = fluidInput; - this.fluidOutput = fluidOutput; - this.chances = outChances; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addPlasmaArcFurnaceRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(fluidInput), - MineTweakerMC.getItemStacks(output), - MineTweakerMC.getLiquidStack(fluidOutput), - chances, - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Plasma Arc Furnace recipe for " + input; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 9 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 9 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 9 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 9 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 9 * hash + this.duration; - hash = 9 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.chances != other.chances){ - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/PlateBender.java b/src/main/java/gttweaker/mods/gregtech/PlateBender.java deleted file mode 100644 index 73469a1..0000000 --- a/src/main/java/gttweaker/mods/gregtech/PlateBender.java +++ /dev/null @@ -1,107 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Access point to Plate Bender recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.PlateBender") -@ModOnly(MOD_ID) -public class PlateBender { - /** - * Adds a plate bender recipe. - * - * @param output recipe output - * @param input recipe input - * @param durationTicks bending time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, int duration, int euPerTick) { - this.output = output; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addBenderRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding plate bender recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 79 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 79 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 79 * hash + this.duration; - hash = 79 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Polarizer.java b/src/main/java/gttweaker/mods/gregtech/Polarizer.java deleted file mode 100644 index e68e3fa..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Polarizer.java +++ /dev/null @@ -1,99 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Polarizer recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Polarizer") -@ModOnly(MOD_ID) -public class Polarizer{ - /** - * Adds a Polarizer recipe. - * - * @param output recipe output - * @param input Item input Slot 1 - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addPolarizerRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - @Override - public String describe() {return "Adding Polarizer recipe for " + output;} - - @Override - public Object getOverrideKey() {return null;} - - @Override - public int hashCode() { - int hash = 8; - hash = 39 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 39 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 39 * hash + this.duration; - hash = 39 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/PrecisionLaser.java b/src/main/java/gttweaker/mods/gregtech/PrecisionLaser.java deleted file mode 100644 index a99b770..0000000 --- a/src/main/java/gttweaker/mods/gregtech/PrecisionLaser.java +++ /dev/null @@ -1,105 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Precision Laser recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.PrecisionLaser") -@ModOnly(MOD_ID) -public class PrecisionLaser{ - /** - * Adds a Laser Engraver recipe. - * - * @param output recipe output - * @param input1 Item input - * @param input2 Lens input - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IIngredient input1; - private final IIngredient input2; - private final int duration; - private final int euPerTick; - public AddRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, int duration, int euPerTick) { - - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addLaserEngraverRecipe( - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - @Override - public String describe() {return "Adding Precision Laser recipe for " + output;} - @Override - public Object getOverrideKey() {return null;} - @Override - public int hashCode() { - int hash = 4; - hash = 45 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 45 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 45 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 45 * hash + this.duration; - hash = 45 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input1 != other.input1 && (this.input1 == null || !this.input1.equals(other.input1))) { - return false; - } - if (this.input2 != other.input2 && (this.input2 == null || !this.input2.equals(other.input2))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Printer.java b/src/main/java/gttweaker/mods/gregtech/Printer.java deleted file mode 100644 index 3b570c4..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Printer.java +++ /dev/null @@ -1,124 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Printer recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Printer") -@ModOnly(MOD_ID) -public class Printer { - /** - * Adds a Printer recipe. - * - * @param output recipe output - * @param input primary input - * @param DataStick Data Stick - * @param ink ink fluidInput - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, IItemStack DataStick, ILiquidStack ink, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, DataStick, ink, durationTicks, euPerTick)); - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final IItemStack input; - private final IItemStack DataStick; - private final ILiquidStack ink; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, IItemStack DataStick, ILiquidStack ink, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.DataStick = DataStick; - this.ink = ink; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addPrinterRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(ink), - MineTweakerMC.getItemStack(DataStick), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Printer recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 66 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 66 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 66 * hash + (this.DataStick != null ? this.DataStick.hashCode() : 0); - hash = 66 * hash + (this.ink != null ? this.ink.hashCode() : 0); - hash = 66 * hash + this.duration; - hash = 66 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.DataStick != other.DataStick && (this.DataStick == null || !this.DataStick.equals(other.DataStick))) { - return false; - } - if (this.ink != other.ink && (this.ink == null || !this.ink.equals(other.ink))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Pulverizer.java b/src/main/java/gttweaker/mods/gregtech/Pulverizer.java deleted file mode 100644 index 5d5ebd7..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Pulverizer.java +++ /dev/null @@ -1,122 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Pulverizer recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Pulverizer") -@ModOnly(MOD_ID) -public class Pulverizer { - /** - * Adds a Pulverizer recipe. - * - * @param outputs recipe outputs - * @param input primary input - * @param outChances Chances for Outputs - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[] outputs, IItemStack input, int[] outChances, int durationTicks, int euPerTick) { - if (outputs.length < 1) { - MineTweakerAPI.logError("Pulverizer must have at least 1 output"); - } else if (outputs.length != outChances.length) { - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - } else { - MineTweakerAPI.apply(new AddRecipeAction(outputs, input, outChances, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final IItemStack input; - private final int[] chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, IItemStack input, int[] outChances, int duration, int euPerTick1) { - - this.output = output; - this.input = input; - this.chances = outChances; - this.duration = duration; - this.euPerTick = euPerTick1; - } - - @Override - public void apply() { - RA.addPulveriserRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStacks(output), - chances, - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Pulverizer recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 8; - hash = 71 * hash + Arrays.deepHashCode(this.output); - hash = 71 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 71 * hash + this.duration; - hash = 71 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (!Arrays.deepEquals(this.output, other.output)) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/PyrolyseOven.java b/src/main/java/gttweaker/mods/gregtech/PyrolyseOven.java deleted file mode 100644 index fa011ef..0000000 --- a/src/main/java/gttweaker/mods/gregtech/PyrolyseOven.java +++ /dev/null @@ -1,133 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.liquid.ILiquidStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the PyrolyseOven recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.PyrolyseOven") -@ModOnly(MOD_ID) -public class PyrolyseOven { - /** - * Adds a Pyrolyse Oven recipe. - * - * @param output recipe output - * @param fluidOutput recipe Fluid output - * @param circuit circuit preset nr. - * @param input recipe input - * @param fluidInput recipe Fluid input - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, ILiquidStack fluidOutput, int circuit, IItemStack input, ILiquidStack fluidInput, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, fluidOutput, circuit, input, fluidInput, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output; - private final ILiquidStack fluidOutput; - private final int circuit; - private final IItemStack input; - private final ILiquidStack fluidInput; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, ILiquidStack fluidOutput, int circuit, IItemStack input, ILiquidStack fluidInput, int duration, int euPerTick) { - - this.output = output; - this.fluidOutput = fluidOutput; - this.circuit = circuit; - this.input = input; - this.fluidInput = fluidInput; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addPyrolyseRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getLiquidStack(fluidInput), - circuit, - MineTweakerMC.getItemStack(output), - MineTweakerMC.getLiquidStack(fluidOutput), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Pyrolyse Oven recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 98 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 98 * hash + (this.fluidOutput != null ? this.fluidOutput.hashCode() : 0); - hash = 98 * hash + this.circuit; - hash = 98 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 98 * hash + (this.fluidInput != null ? this.fluidInput.hashCode() : 0); - hash = 98 * hash + this.duration; - hash = 98 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.fluidOutput != other.fluidOutput && (this.fluidOutput == null || !this.fluidOutput.equals(other.fluidOutput))) { - return false; - } - if (this.circuit != other.circuit) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.fluidInput != other.fluidInput && (this.fluidInput == null || !this.fluidInput.equals(other.fluidInput))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} - diff --git a/src/main/java/gttweaker/mods/gregtech/Separator.java b/src/main/java/gttweaker/mods/gregtech/Separator.java deleted file mode 100644 index 40fe641..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Separator.java +++ /dev/null @@ -1,114 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Separator recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Separator") -@ModOnly(MOD_ID) -public class Separator{ - /** - * Adds a Separator recipe. - * - * @param input recipe input - * @param output Item output Slot 1-3 - * @param outChances Item output chances - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack[] output, IItemStack input, int[] outChances, int durationTicks, int euPerTick) { - if (output.length < 1) { - MineTweakerAPI.logError("Seperator must have at least 1 output"); - } else if(output.length!=outChances.length){ - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - }else { - MineTweakerAPI.apply(new AddRecipeAction(output, input, outChances, durationTicks, euPerTick)); - } - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final IItemStack input; - private final int[] chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, IItemStack input, int[] outChances, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.chances = outChances; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addElectromagneticSeparatorRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output[0]), - output.length > 1 ? MineTweakerMC.getItemStack(output[1]) : null, - output.length > 2 ? MineTweakerMC.getItemStack(output[2]) : null, - chances, - duration, - euPerTick); - } - @Override - public String describe() {return "Adding Separator recipe for " + input;} - - @Override - public Object getOverrideKey() {return null;} - - @Override - public int hashCode() { - int hash = 3; - hash = 39 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 39 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 39 * hash + this.duration; - hash = 39 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Sifter.java b/src/main/java/gttweaker/mods/gregtech/Sifter.java deleted file mode 100644 index 64cec32..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Sifter.java +++ /dev/null @@ -1,127 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import java.util.Arrays; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Sifter recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Sifter") -@ModOnly(MOD_ID) -public class Sifter { - /** - * Adds a Sifter recipe. - * - * @param outputs 1-9 outputs - * @param input primary input - * @param outChances chances of 1-9 output - * @param durationTicks reaction time, in ticks - * @param euPerTick eu consumption per tick - * - */ - @ZenMethod - public static void addRecipe(IItemStack[] outputs, IItemStack input, int[] outChances, int durationTicks, int euPerTick) { - if (outputs.length < 1) { - MineTweakerAPI.logError("Sifter must have at least 1 output"); - } else if(outputs.length!=outChances.length){ - MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); - }else { - MineTweakerAPI.apply(new AddRecipeAction(outputs, input, outChances, durationTicks, euPerTick)); - } - } - -// ###################### -// ### Action classes ### -// ###################### - - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack[] output; - private final IItemStack input; - private final int[] chances; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack[] output, IItemStack input, int[] outChances, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.chances = outChances; - this.duration = duration; - this.euPerTick = euPerTick; - - - } - - @Override - public void apply() { - RA.addSifterRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStacks(output), - chances, - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding Sifter recipe for " + input ; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 1; - hash = 76 * hash + Arrays.deepHashCode(this.output); - hash = 76 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 76 * hash + this.duration; - hash = 76 * hash + this.euPerTick; - - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (!Arrays.deepEquals(this.output, other.output)) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.chances != other.chances) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/Slicer.java b/src/main/java/gttweaker/mods/gregtech/Slicer.java deleted file mode 100644 index abac058..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Slicer.java +++ /dev/null @@ -1,106 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; -/** - * Provides access to the Slicer recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Slicer") -@ModOnly(MOD_ID) -public class Slicer { - /** - * Adds an Slicer recipe. - * - * @param output primary output - * @param input primary input - * @param blade blade Slot - * @param durationTicks assembling duration, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, IItemStack blade, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, blade, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input; - private final IItemStack blade; - private final int duration; - private final int euPerTick; - public AddRecipeAction(IItemStack output, IItemStack input, IItemStack blade, int duration, int euPerTick) { - - this.output = output; - this.input = input; - this.blade = blade; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addSlicerRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(blade), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - @Override - public String describe() { - return "Adding Slicer recipe for " + output; - } - @Override - public Object getOverrideKey() { - return null; - } - @Override - public int hashCode() { - int hash = 7; - hash = 37 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 37 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 37 * hash + (this.blade != null ? this.blade.hashCode() : 0); - hash = 37 * hash + this.duration; - hash = 37 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.blade != other.blade && (this.blade == null || !this.blade.equals(other.blade))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Unpacker.java b/src/main/java/gttweaker/mods/gregtech/Unpacker.java deleted file mode 100644 index 9e03d6e..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Unpacker.java +++ /dev/null @@ -1,107 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Unpacker recipes. - * - * @author DreamMasterXXL - */ -@ZenClass("mods.gregtech.Unpacker") -@ModOnly(MOD_ID) -public class Unpacker{ - /** - * Adds a Unpacker recipe. - * - * @param output1 recipe output Slot 1 - * @param output2 recipe output Slot 2 - * @param input recipe Input Slot - * @param durationTicks duration time, in ticks - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack input, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output1, output2, input, durationTicks, euPerTick)); - } -// ###################### -// ### Action classes ### -// ###################### - private static class AddRecipeAction extends OneWayAction { - - private final IItemStack output1; - private final IItemStack output2; - private final IItemStack input; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output1, IItemStack output2, IItemStack input, int duration, int euPerTick) { - - this.output1 = output1; - this.output2 = output2; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - } - @Override - public void apply() { - RA.addUnboxingRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output1), - MineTweakerMC.getItemStack(output2), - duration, - euPerTick); - } - @Override - public String describe() {return "Adding Unpacker recipe for " + input;} - - @Override - public Object getOverrideKey() {return null;} - - @Override - public int hashCode() { - int hash = 9; - hash = 39 * hash + (this.output1 != null ? this.output1.hashCode() : 0); - hash = 39 * hash + (this.output2 != null ? this.output2.hashCode() : 0); - hash = 39 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 39 * hash + this.duration; - hash = 39 * hash + this.euPerTick; - return hash; - } - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output1 != other.output1 && (this.output1 == null || !this.output1.equals(other.output1))) { - return false; - } - if (this.output2 != other.output2 && (this.output2 == null || !this.output2.equals(other.output2))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/VacuumFreezer.java b/src/main/java/gttweaker/mods/gregtech/VacuumFreezer.java deleted file mode 100644 index 940526a..0000000 --- a/src/main/java/gttweaker/mods/gregtech/VacuumFreezer.java +++ /dev/null @@ -1,98 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Vacuum Freezer recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.VacuumFreezer") -@ModOnly(MOD_ID) -public class VacuumFreezer { - /** - * Adds a vacuum freezer recipe. - * - * @param output recipe output - * @param input recipe input - * @param durationTicks freezing duration, in ticks - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int durationTicks) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, durationTicks)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input; - private final int duration; - - public AddRecipeAction(IItemStack output, IItemStack input, int duration) { - this.output = output; - this.input = input; - this.duration = duration; - } - - @Override - public void apply() { - RA.addVacuumFreezerRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - duration); - } - - @Override - public String describe() { - return "Adding vacuum freezer recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 5; - hash = 67 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 67 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 67 * hash + this.duration; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/Wiremill.java b/src/main/java/gttweaker/mods/gregtech/Wiremill.java deleted file mode 100644 index a2d09f5..0000000 --- a/src/main/java/gttweaker/mods/gregtech/Wiremill.java +++ /dev/null @@ -1,106 +0,0 @@ -package gttweaker.mods.gregtech; - -import minetweaker.MineTweakerAPI; -import minetweaker.OneWayAction; -import minetweaker.annotations.ModOnly; -import minetweaker.api.item.IIngredient; -import minetweaker.api.item.IItemStack; -import minetweaker.api.minecraft.MineTweakerMC; -import stanhebben.zenscript.annotations.ZenClass; -import stanhebben.zenscript.annotations.ZenMethod; - -import static gregtech.api.enums.GT_Values.MOD_ID; -import static gregtech.api.enums.GT_Values.RA; - -/** - * Provides access to the Wiremill recipes. - * - * @author Stan Hebben - */ -@ZenClass("mods.gregtech.Wiremill") -@ModOnly(MOD_ID) -public class Wiremill { - /** - * Adds a Wiremill recipe. - * - * @param output recipe output - * @param input recipe input - * @param durationTicks processing time - * @param euPerTick eu consumption per tick - */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input, int durationTicks, int euPerTick) { - MineTweakerAPI.apply(new AddRecipeAction(output, input, durationTicks, euPerTick)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input; - private final int duration; - private final int euPerTick; - - public AddRecipeAction(IItemStack output, IItemStack input, int duration, int euPerTick) { - this.output = output; - this.input = input; - this.duration = duration; - this.euPerTick = euPerTick; - } - - @Override - public void apply() { - RA.addWiremillRecipe( - MineTweakerMC.getItemStack(input), - MineTweakerMC.getItemStack(output), - duration, - euPerTick); - } - - @Override - public String describe() { - return "Adding wiremill recipe for " + output; - } - - @Override - public Object getOverrideKey() { - return null; - } - - @Override - public int hashCode() { - int hash = 7; - hash = 37 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 37 * hash + (this.input != null ? this.input.hashCode() : 0); - hash = 37 * hash + this.duration; - hash = 37 * hash + this.euPerTick; - return hash; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final AddRecipeAction other = (AddRecipeAction) obj; - if (this.output != other.output && (this.output == null || !this.output.equals(other.output))) { - return false; - } - if (this.input != other.input && (this.input == null || !this.input.equals(other.input))) { - return false; - } - if (this.duration != other.duration) { - return false; - } - if (this.euPerTick != other.euPerTick) { - return false; - } - return true; - } - } -} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/AlloySmelter.java b/src/main/java/gttweaker/mods/gregtech/machines/AlloySmelter.java new file mode 100644 index 0000000..5a70ae7 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/AlloySmelter.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provider access to the Alloy Smelter recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.AlloySmelter") +@ModOnly(MOD_ID) +public class AlloySmelter { + /** + * Adds an alloy smelter recipe. + * + * @param output alloy smelter output + * @param input1 primary input + * @param input2 secondary input + * @param durationTicks smelting time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding alloy smelter recipe for " + output, input1, input2, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addAlloySmelterRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Amplifabricator.java b/src/main/java/gttweaker/mods/gregtech/machines/Amplifabricator.java new file mode 100644 index 0000000..b02b241 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Amplifabricator.java @@ -0,0 +1,36 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Amplifabricator recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Amplifabricator") +@ModOnly(MOD_ID) +public class Amplifabricator { + /** + * Adds a Amplifabricator recipe. + * + * @param input primary Input + * @param duration reaction time, in ticks + */ + @ZenMethod + public static void addRecipe(IIngredient input, int duration, int amount) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Amplifabricator recipe for " + input, input, duration, amount) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addAmplifier(i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ArcFurnace.java b/src/main/java/gttweaker/mods/gregtech/machines/ArcFurnace.java new file mode 100644 index 0000000..ddd7fe1 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/ArcFurnace.java @@ -0,0 +1,48 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Arc Furnace recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.ArcFurnace") +@ModOnly(MOD_ID) +public class ArcFurnace { + /** + * Adds an Arc Furnace recipe. + * + * @param outputs 1-4 recipe output + * @param input primary input + * @param fluidInput primary fluidInput + * @param outChances chances of 1-4 output + * @param durationTicks assembling duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IIngredient input, ILiquidStack fluidInput, int[] outChances, int durationTicks, int euPerTick) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Arc Furnace must have at least 1 output"); + } else if (outputs.length != outChances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Arc Furnace recipe for " + input, input, fluidInput, outputs, outChances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addSimpleArcFurnaceRecipe(i.nextItem(), i.nextFluid(), i.nextItemArr(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Assembler.java b/src/main/java/gttweaker/mods/gregtech/machines/Assembler.java new file mode 100644 index 0000000..9901411 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Assembler.java @@ -0,0 +1,54 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the assembler recipes. + * + * @author Blood Asp + * @author DreamMasterXXL + * @author bculkin2442 + */ +@ZenClass("mods.gregtech.Assembler") +@ModOnly(MOD_ID) +public class Assembler { + /** + * Adds an assemble recipe. + * + * @param output recipe output + * @param input1 primary input + * @param input2 secondary input (optional, can be null) + * @param fluidInput primary fluidInput + * @param durationTicks assembling duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding assembler recipe with fluid Support for " + output, input1, input2, fluidInput, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addAssemblerRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } + + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding assembler recipe for " + output, input1, input2, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addAssemblerRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Autoclave.java b/src/main/java/gttweaker/mods/gregtech/machines/Autoclave.java new file mode 100644 index 0000000..68a17f7 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Autoclave.java @@ -0,0 +1,42 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Autoclave recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Autoclave") +@ModOnly(MOD_ID) +public class Autoclave { + /** + * Adds an Autoclave recipe. + * + * @param output primary output + * @param input primary input + * @param fluidInput primary fluidInput + * @param chances chances + * @param durationTicks assembling duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, ILiquidStack fluidInput, int chances, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Autoclave recipe for " + output, input, fluidInput, output, chances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addAutoclaveRecipe(i.nextItem(), i.nextFluid(), i.nextItem(), i.nextInt(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Blastfurnace.java b/src/main/java/gttweaker/mods/gregtech/machines/Blastfurnace.java new file mode 100644 index 0000000..0c150ca --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Blastfurnace.java @@ -0,0 +1,52 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Blast Furnace recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.BlastFurnace") +@ModOnly(MOD_ID) +public class Blastfurnace { + /** + * Adds a Blast Furnace recipe. + * + * @param output recipe output 1+2 + * @param fluidInput primary fluidInput + * @param input recipes input 1+2 + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + * @param heat heat in Kelvin + */ + @ZenMethod + public static void addRecipe(IItemStack[] output, ILiquidStack fluidInput, IIngredient[] input, int durationTicks, int euPerTick, int heat) { + if (output.length == 0) { + MineTweakerAPI.logError("Blast furnace recipe requires at least 1 input"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Blast furnace recipe for " + output, input[0], itemOrNull(input, 1), fluidInput, output[0], itemOrNull(output, 1), durationTicks, euPerTick, heat) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addBlastRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), null, i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt(), i.nextInt()); + } + }); + } + } + + @ZenMethod + public static void addRecipe(IItemStack[] output, IIngredient[] input, int durationTicks, int euPerTick, int heat) { + addRecipe(output, null, input, durationTicks, euPerTick, heat); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Brewery.java b/src/main/java/gttweaker/mods/gregtech/machines/Brewery.java new file mode 100644 index 0000000..7523ecb --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Brewery.java @@ -0,0 +1,39 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Brewing Machine recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Brewery") +@ModOnly(MOD_ID) +public class Brewery { + /** + * Adds a Brewing Machine recipe. + * + * @param output primary fluid output + * @param ingredient primary ingredient + * @param input primary fluid ingredient + * @param hidden hidden true or false + */ + @ZenMethod + public static void addRecipe(ILiquidStack output, IIngredient ingredient, ILiquidStack input, boolean hidden) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Brewery recipe for " + output, ingredient, input, output, hidden) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addBrewingRecipe(i.nextItem(), i.nextFluid().getFluid(), i.nextFluid().getFluid(), i.nextBool()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Canner.java b/src/main/java/gttweaker/mods/gregtech/machines/Canner.java new file mode 100644 index 0000000..f688067 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Canner.java @@ -0,0 +1,59 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provider access to the Canner recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.Canner") +@ModOnly(MOD_ID) +public class Canner { + /** + * Adds a canner recipe with a single output. + * + * @param output crafting output + * @param input1 primary input + * @param input2 secondary input (optional + * @param durationTicks crafting duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + addRecipe(new IItemStack[]{output}, input1, input2, durationTicks, euPerTick); + } + + /** + * Adds a canner recipe with multiple outputs. + * + * @param output array with 1 or 2 outputs + * @param input1 primary inputs + * @param input2 secondary inputs + * @param durationTicks crafting duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + if (output.length == 0) { + MineTweakerAPI.logError("canner requires at least 1 output"); + } else { + IItemStack output1 = output.length > 1 ? output[1] : null; + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding canner recipe for " + output1, output[0], output1, input1, input2, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addCannerRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java b/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java new file mode 100644 index 0000000..0ab94b9 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Centrifuge.java @@ -0,0 +1,74 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Centrifuge recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Centrifuge") +@ModOnly(MOD_ID) +public class Centrifuge { + /** + * Adds a Centrifuge recipe. + * + * @param outputs array with 1-6 outputs + * @param fluidOutput primary fluid output + * @param input1 primary input + * @param input2 Cell input + * @param fluidInput primary fluid input + * @param chances chance 1-6 + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, ILiquidStack fluidOutput, IIngredient input1, IIngredient input2, ILiquidStack fluidInput, int[] chances, int durationTicks, int euPerTick) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Centrifuge must have at least 1 output"); + } else if (outputs.length != chances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Centrifuge recipe with Fluids for " + input1, input1, input2, fluidOutput, fluidInput, outputs[0], + itemOrNull(outputs, 1), itemOrNull(outputs, 2), itemOrNull(outputs, 3), itemOrNull(outputs, 4), itemOrNull(outputs, 5), chances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addCentrifugeRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), i.nextFluid(), i.nextItem(), i.nextItem(), + i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } + + @ZenMethod + public static void addRecipeFuelCan(IItemStack[] outputs, IIngredient input, int numCans, int duration) { + addRecipe(outputs, input, -numCans, duration); + } + + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IIngredient input, int cells, int durationTicks) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Centrifuge must have at least 1 output"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding centrifuge recipe with input " + input, input, cells, outputs[0], + itemOrNull(outputs, 1), itemOrNull(outputs, 2), itemOrNull(outputs, 3), itemOrNull(outputs, 4), itemOrNull(outputs, 5), durationTicks) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addCentrifugeRecipe(i.nextItem(), i.nextInt(), i.nextItem(), i.nextItem(), + i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt()); + } + }); + } + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java b/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java new file mode 100644 index 0000000..6820c3c --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/ChemicalBath.java @@ -0,0 +1,48 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Chemical Bath recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.ChemicalBath") +@ModOnly(MOD_ID) +public class ChemicalBath { + /** + * Adds a Chemical Bath recipe. + * + * @param output outputs 1-3 + * @param input primary input + * @param fluidInput primary fluidInput + * @param chances chance of 3 outputs + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] output, IIngredient input, ILiquidStack fluidInput, int[] chances, int durationTicks, int euPerTick) { + if (output.length == 0) { + MineTweakerAPI.logError("chemical bath requires at least 1 output"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Chemical Bath recipe for " + input, input, fluidInput, output[0], + itemOrNull(output, 1), itemOrNull(output, 2), chances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addChemicalBathRecipe(i.nextItem(), i.nextFluid(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ChemicalReactor.java b/src/main/java/gttweaker/mods/gregtech/machines/ChemicalReactor.java new file mode 100644 index 0000000..7e928dc --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/ChemicalReactor.java @@ -0,0 +1,47 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Chemical Reactor recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.ChemicalReactor") +@ModOnly(MOD_ID) +public class ChemicalReactor { + /** + * Adds a Chemical Reactor recipe. + * + * @param output recipe output + * @param fluidOutput primary fluidInput + * @param input1 primary input + * @param input2 secondary input + * @param fluidInput primary fluidInput + * @param durationTicks reaction time, in ticks + */ + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack fluidOutput, IIngredient input1, IIngredient input2, ILiquidStack fluidInput, int durationTicks) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Chemical Reactor recipe for " + output, input1, input2, fluidInput, fluidOutput, output, durationTicks) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addChemicalRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), i.nextFluid(), i.nextItem(), i.nextInt()); + } + }); + } + + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks) { + addRecipe(output, null, input1, input2, null, durationTicks); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/CuttingSaw.java b/src/main/java/gttweaker/mods/gregtech/machines/CuttingSaw.java new file mode 100644 index 0000000..0b41485 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/CuttingSaw.java @@ -0,0 +1,62 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Saw recipes. + * + * @author DreamMasterXXL + * @author bculkin2442 + */ +@ZenClass("mods.gregtech.CuttingSaw") +@ModOnly(MOD_ID) +public class CuttingSaw { + /** + * Adds a Cutting Saw recipe. + * + * @param output1 recipe output1 + * @param output2 recipe output2 + * @param input primary input + * @param lubricant primary fluidInput + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input, ILiquidStack lubricant, int durationTicks, int euPerTick) { + if (lubricant == null) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Cutting Saw recipe for " + input, input, output1, output2, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addCutterRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Cutting Saw recipe for " + input, input, lubricant, output1, output2, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addCutterRecipe(i.nextItem(), i.nextFluid(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } + } + + @ZenMethod + public static void addRecipe(IItemStack[] output, IIngredient input, ILiquidStack lubricant, int durationTicks, int euPerTick) { + if (output.length == 0) { + MineTweakerAPI.logError("canner requires at least 1 output"); + } else { + addRecipe(output[0], itemOrNull(output, 1), input, lubricant, durationTicks, euPerTick); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/DistillationTower.java b/src/main/java/gttweaker/mods/gregtech/machines/DistillationTower.java new file mode 100644 index 0000000..46a5214 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/DistillationTower.java @@ -0,0 +1,45 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Distillation Tower recipes. + * + * @author DreamMasterXXL + * @author Blood Asp + */ +@ZenClass("mods.gregtech.DistillationTower") +@ModOnly(MOD_ID) +public class DistillationTower { + /** + * Adds an Distillation Tower recipe. + * + * @param fluidInput Fluid Input + * @param fluidOutput Up to 6 Fluid Outputs + * @param itemOutput Item output Slot + * @param durationTicks duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(ILiquidStack[] fluidOutput, IItemStack itemOutput, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + if (fluidOutput.length < 1) { + MineTweakerAPI.logError("Distillation Twower must have at least 1 Fluid output"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Distillation Tower recipe for " + fluidInput.getDisplayName(), fluidInput, fluidOutput, itemOutput, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addDistillationTowerRecipe(i.nextFluid(), i.nextFluidArr(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Distillery.java b/src/main/java/gttweaker/mods/gregtech/machines/Distillery.java new file mode 100644 index 0000000..24ef246 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Distillery.java @@ -0,0 +1,41 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Distillery recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Distillery") +@ModOnly(MOD_ID) +public class Distillery { + /** + * Adds a Distillery recipe. + * + * @param fluidOutput Fluid output + * @param circuit Circuit + * @param fluidInput fluidInput + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + * @param hidden hidden + */ + @ZenMethod + public static void addRecipe(ILiquidStack fluidOutput, IItemStack circuit, ILiquidStack fluidInput, int durationTicks, int euPerTick, boolean hidden) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Distillery recipe for " + fluidOutput, circuit, fluidInput, fluidOutput, durationTicks, euPerTick, hidden) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addDistilleryRecipe(i.nextItem(), i.nextFluid(), i.nextFluid(), i.nextInt(), i.nextInt(), i.nextBool()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java b/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java new file mode 100644 index 0000000..c6dcbc2 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Electrolyzer.java @@ -0,0 +1,70 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Electrolyzer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Electrolyzer") +@ModOnly(MOD_ID) +public class Electrolyzer { + /** + * Adds a Electrolyzer recipe. + * + * @param outputs output 1-6 + * @param fluidOutput primary fluid output + * @param input primary input + * @param cells Cell input + * @param fluidInput primary fluid input + * @param chances chance 1-6 + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, ILiquidStack fluidOutput, IIngredient input, IIngredient cells, ILiquidStack fluidInput, int[] chances, int durationTicks, int euPerTick) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Electrolyzer must have at least 1 output"); + } else if (outputs.length != chances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Electrolyzer recipe with Liquid support for " + input, input, cells, fluidInput, fluidOutput, outputs[0], + itemOrNull(outputs, 1), itemOrNull(outputs, 2), itemOrNull(outputs, 3), itemOrNull(outputs, 4), itemOrNull(outputs, 5), chances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addElectrolyzerRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), i.nextFluid(), i.nextItem(), i.nextItem(), + i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } + + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IIngredient input, int cells, int durationTicks, int euPerTick) { + if (outputs.length == 0) { + MineTweakerAPI.logError("Electrolyzer recipe requires at least 1 input"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding electrolyzer recipe with input " + input, input, cells, outputs[0], + itemOrNull(outputs, 1), itemOrNull(outputs, 2), itemOrNull(outputs, 3), itemOrNull(outputs, 4), itemOrNull(outputs, 5), durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addElectrolyzerRecipe(i.nextItem(), i.nextInt(), i.nextItem(), i.nextItem(), i.nextItem(), + i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt() + ); + } + }); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Extruder.java b/src/main/java/gttweaker/mods/gregtech/machines/Extruder.java new file mode 100644 index 0000000..33c3dee --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Extruder.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the extruder recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.Extruder") +@ModOnly(MOD_ID) +public class Extruder { + /** + * Adds an extruder recipe. + * + * @param output recipe output + * @param input recipe input + * @param shape shape (set stack size to 0 to prevent the shape from being consumed) + * @param durationTicks extruding time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, IItemStack shape, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding extruder recipe for " + output, input, shape, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addExtruderRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Fermenter.java b/src/main/java/gttweaker/mods/gregtech/machines/Fermenter.java new file mode 100644 index 0000000..4f87b7d --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Fermenter.java @@ -0,0 +1,38 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Fermenter recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Fermenter") +@ModOnly(MOD_ID) +public class Fermenter { + /** + * Adds a Fermenter recipe. + * + * @param fluidOutput primary fluidOutput + * @param fluidInput primary fluidInput + * @param duration reaction time, in ticks + * @param hidden hidden + */ + @ZenMethod + public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput, int duration, boolean hidden) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Fermenter recipe for " + fluidOutput, fluidInput, fluidOutput, duration, hidden) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFermentingRecipe(i.nextFluid(), i.nextFluid(), i.nextInt(), i.nextBool()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/FluidCanner.java b/src/main/java/gttweaker/mods/gregtech/machines/FluidCanner.java new file mode 100644 index 0000000..3c708a6 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/FluidCanner.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Fluid Canner recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.FluidCanner") +@ModOnly(MOD_ID) +public class FluidCanner { + /** + * Adds a Fluid Canner recipe. + * + * @param output output Slot + * @param input input Slot + * @param fluidOutput fluid Output Slot + * @param fluidInput fluid Input Slot + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, ILiquidStack fluidOutput, ILiquidStack fluidInput) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Fluid Canner recipe for " + input, input, fluidOutput, fluidInput) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFluidCannerRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), i.nextFluid()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/FluidExtractor.java b/src/main/java/gttweaker/mods/gregtech/machines/FluidExtractor.java new file mode 100644 index 0000000..59a9495 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/FluidExtractor.java @@ -0,0 +1,42 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Fluid Extractor recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.FluidExtractor") +@ModOnly(MOD_ID) +public class FluidExtractor { + /** + * Adds a Fluid Extractor recipe. + * + * @param output output Slot + * @param input input Slot + * @param fluidOutput fluidOutput Slot + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + * @param chance chance output slot + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, ILiquidStack fluidOutput, int durationTicks, int euPerTick, int chance) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Fluid Extractor recipe for " + input, input, output, fluidOutput, durationTicks, euPerTick, chance) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFluidExtractionRecipe(i.nextItem(), i.nextItem(), i.nextFluid(), i.nextInt(), i.nextInt(), i.nextInt()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/FluidHeater.java b/src/main/java/gttweaker/mods/gregtech/machines/FluidHeater.java new file mode 100644 index 0000000..08b26ca --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/FluidHeater.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Fluid Heater recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.FluidHeater") +@ModOnly(MOD_ID) +public class FluidHeater { + /** + * Adds a Fluid Heater recipe. + * + * @param fluidOutput Fluid output + * @param circuit Circuit + * @param fluidInput fluid input + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(ILiquidStack fluidOutput, IItemStack circuit, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Fluid Heater recipe for " + fluidOutput, circuit, fluidInput, fluidOutput, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFluidHeaterRecipe(i.nextItem(), i.nextFluid(), i.nextFluid(), i.nextInt(), i.nextInt()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/FluidSolidifier.java b/src/main/java/gttweaker/mods/gregtech/machines/FluidSolidifier.java new file mode 100644 index 0000000..92ebb3b --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/FluidSolidifier.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Fluid Solidifier recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.FluidSolidifier") +@ModOnly(MOD_ID) +public class FluidSolidifier { + /** + * Adds a Fluid Solidifier recipe. + * + * @param output output Slot + * @param mold mold Slot + * @param fluidInput fluidInput + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack mold, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Fluid Solidifier recipe for " + output, mold, fluidInput, mold, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFluidSolidifierRecipe(i.nextItem(), i.nextFluid(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ForgeHammer.java b/src/main/java/gttweaker/mods/gregtech/machines/ForgeHammer.java new file mode 100644 index 0000000..1d64c6a --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/ForgeHammer.java @@ -0,0 +1,39 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Forge Hammer recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.ForgeHammer") +@ModOnly(MOD_ID) +public class ForgeHammer { + /** + * Add a Forge Hammer recipe. + * + * @param output recipe output + * @param input recipe input + * @param durationTicks forging duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding forge hammer recipe for " + output, input, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addForgeHammerRecipe(i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/FormingPress.java b/src/main/java/gttweaker/mods/gregtech/machines/FormingPress.java new file mode 100644 index 0000000..0f7f6ab --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/FormingPress.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Forming Press recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.FormingPress") +@ModOnly(MOD_ID) +public class FormingPress { + /** + * Adds a Forming Press recipe. + * + * @param output recipe output + * @param input1 Item input + * @param input2 Press Form input + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Forming Press recipe for " + output, input1, input2, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFormingPressRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/FusionReactor.java b/src/main/java/gttweaker/mods/gregtech/machines/FusionReactor.java new file mode 100644 index 0000000..47d017e --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/FusionReactor.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Fusion Reactor recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.FusionReactor") +@ModOnly(MOD_ID) +public class FusionReactor { + /** + * Adds a Mixer recipe. + * + * @param fluidOutput primary fluid Output + * @param fluidInput1 primary fluid Input + * @param fluidInput2 secondary fluid Input + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + * @param startEU Starting at ... EU + */ + @ZenMethod + public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput1, ILiquidStack fluidInput2, int durationTicks, int euPerTick, int startEU) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Fusion Reactor recipe for " + fluidOutput, fluidInput1, fluidInput2, fluidOutput, durationTicks, euPerTick, startEU) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addFusionReactorRecipe(i.nextFluid(), i.nextFluid(), i.nextFluid(), i.nextInt(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java b/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java new file mode 100644 index 0000000..7474952 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/ImplosionCompressor.java @@ -0,0 +1,55 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Implosion Compressor recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.ImplosionCompressor") +@ModOnly(MOD_ID) +public class ImplosionCompressor { + /** + * Adds an implosion compressor recipe with a single output. + * + * @param output recipe output + * @param input primary input + * @param tnt amount of TNT needed + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int tnt) { + addRecipe(new IItemStack[]{output, null}, input, tnt); + } + + /** + * Adds an implosion compressor recipe with one or two outputs. + * + * @param output array with 1-2 outputs + * @param input primary input + * @param tnt amount of TNT needed + */ + @ZenMethod + public static void addRecipe(IItemStack[] output, IIngredient input, int tnt) { + if (output.length == 0) { + MineTweakerAPI.logError("Implosion compressor recipe requires at least 1 output"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Implosion compressor recipe for " + output[0], input, tnt, output[0], itemOrNull(output, 1)) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addImplosionRecipe(i.nextItem(), i.nextInt(), i.nextItem(), i.nextItem()); + } + }); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java b/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java new file mode 100644 index 0000000..7c6dd7d --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Lathe.java @@ -0,0 +1,57 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Access point for Lathe recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.Lathe") +@ModOnly(MOD_ID) +public class Lathe { + /** + * Adds a lathe recipe with a single output. + * + * @param output recipe output + * @param input recipe input + * @param durationTicks crafting duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int durationTicks, int euPerTick) { + addRecipe(new IItemStack[]{output, null}, input, durationTicks, euPerTick); + } + + /** + * Adds a lathe recipe with 1 or 2 outputs. + * + * @param outputs array with 1-2 outputs + * @param input recipe input + * @param durationTicks crafting duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IIngredient input, int durationTicks, int euPerTick) { + if (outputs.length == 0) { + MineTweakerAPI.logError("Lathe recipe requires at least 1 input"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding lathe recipe for " + outputs[0], input, outputs[0], itemOrNull(outputs, 1), durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addLatheRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java b/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java new file mode 100644 index 0000000..bf10c14 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Mixer.java @@ -0,0 +1,53 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Mixer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Mixer") +@ModOnly(MOD_ID) +public class Mixer { + /** + * Adds a Mixer recipe. + * + * @param output recipe output + * @param fluidOutput primary fluidInput + * @param input input 1-4 + * @param fluidInput primary fluidInput + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack fluidOutput, IIngredient[] input, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + if (input.length == 0) { + MineTweakerAPI.logError("Lathe recipe requires at least 1 input"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Mixer recipe for " + output, input[0], itemOrNull(input, 1), + itemOrNull(input, 2), itemOrNull(input, 3), fluidInput, fluidOutput, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addMixerRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextFluid(), i.nextFluid(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient[] input, int durationTicks, int euPerTick) { + addRecipe(output, null, input, null, durationTicks, euPerTick); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/OilCracker.java b/src/main/java/gttweaker/mods/gregtech/machines/OilCracker.java new file mode 100644 index 0000000..fc381e4 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/OilCracker.java @@ -0,0 +1,39 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the OilCracker recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.OilCracker") +@ModOnly(MOD_ID) +public class OilCracker { + /** + * Adds a Pyrolyse Oven recipe. + * + * @param fluidOutput recipe Fluid output + * @param fluidInput recipe Fluid input + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(ILiquidStack fluidOutput, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding OilCracker recipe for " + fluidOutput, fluidInput, fluidInput, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addCrackingRecipe(i.nextFluid(), i.nextFluid(), i.nextInt(), i.nextInt()); + } + }); + } +} + diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Packer.java b/src/main/java/gttweaker/mods/gregtech/machines/Packer.java new file mode 100644 index 0000000..a163207 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Packer.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Packer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Packer") +@ModOnly(MOD_ID) +public class Packer { + /** + * Adds a Packer recipe. + * + * @param output recipe output + * @param input1 Item input Slot 1 + * @param input2 Item input Slot 2 + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Packer recipe for " + output, input1, input2, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addBoxingRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/PlasmaArcFurnace.java b/src/main/java/gttweaker/mods/gregtech/machines/PlasmaArcFurnace.java new file mode 100644 index 0000000..b5f57b7 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/PlasmaArcFurnace.java @@ -0,0 +1,49 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Plasma Arc Furnace recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.PlasmaArcFurnace") +@ModOnly(MOD_ID) +public class PlasmaArcFurnace { + /** + * Adds an Arc Furnace recipe. + * + * @param outputs 1-4 recipe output + * @param fluidOutput primary fluidOutput + * @param input primary input + * @param fluidInput primary fluidInput + * @param outChances chances of 1-4 output + * @param durationTicks assembling duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, ILiquidStack fluidOutput, IIngredient input, ILiquidStack fluidInput, int[] outChances, int durationTicks, int euPerTick) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Plasma Arc Furnace must have at least 1 output"); + } else if (outputs.length != outChances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Plasma Arc Furnace recipe for " + input, input, fluidInput, outputs, fluidOutput, outChances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addPlasmaArcFurnaceRecipe(i.nextItem(), i.nextFluid(), i.nextItemArr(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/PlateBender.java b/src/main/java/gttweaker/mods/gregtech/machines/PlateBender.java new file mode 100644 index 0000000..5df03a5 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/PlateBender.java @@ -0,0 +1,39 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Access point to Plate Bender recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.PlateBender") +@ModOnly(MOD_ID) +public class PlateBender { + /** + * Adds a plate bender recipe. + * + * @param output recipe output + * @param input recipe input + * @param durationTicks bending time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding plate bender recipe for " + output, input, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addBenderRecipe(i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Polarizer.java b/src/main/java/gttweaker/mods/gregtech/machines/Polarizer.java new file mode 100644 index 0000000..62b7d67 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Polarizer.java @@ -0,0 +1,39 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Polarizer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Polarizer") +@ModOnly(MOD_ID) +public class Polarizer { + /** + * Adds a Polarizer recipe. + * + * @param output recipe output + * @param input Item input Slot 1 + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Polarizer recipe for " + output, input, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addPolarizerRecipe(i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/PrecisionLaser.java b/src/main/java/gttweaker/mods/gregtech/machines/PrecisionLaser.java new file mode 100644 index 0000000..2883af6 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/PrecisionLaser.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Precision Laser recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.PrecisionLaser") +@ModOnly(MOD_ID) +public class PrecisionLaser { + /** + * Adds a Laser Engraver recipe. + * + * @param output recipe output + * @param input1 Item input + * @param input2 Lens input + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Precision Laser recipe for " + output, input1, input2, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addLaserEngraverRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Printer.java b/src/main/java/gttweaker/mods/gregtech/machines/Printer.java new file mode 100644 index 0000000..ba785a1 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Printer.java @@ -0,0 +1,42 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Printer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Printer") +@ModOnly(MOD_ID) +public class Printer { + /** + * Adds a Printer recipe. + * + * @param output recipe output + * @param input primary input + * @param dataStick Data Stick + * @param ink ink fluidInput + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, IItemStack dataStick, ILiquidStack ink, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Printer recipe for " + output, input, ink, dataStick, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addPrinterRecipe(i.nextItem(), i.nextFluid(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Pulverizer.java b/src/main/java/gttweaker/mods/gregtech/machines/Pulverizer.java new file mode 100644 index 0000000..d90a43e --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Pulverizer.java @@ -0,0 +1,46 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Pulverizer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Pulverizer") +@ModOnly(MOD_ID) +public class Pulverizer { + /** + * Adds a Pulverizer recipe. + * + * @param outputs recipe outputs + * @param input primary input + * @param outChances Chances for Outputs + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IIngredient input, int[] outChances, int durationTicks, int euPerTick) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Pulverizer must have at least 1 output"); + } else if (outputs.length != outChances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Pulverizer recipe for " + input, input, outputs, outChances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addPulveriserRecipe(i.nextItem(), i.nextItemArr(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/PyrolyseOven.java b/src/main/java/gttweaker/mods/gregtech/machines/PyrolyseOven.java new file mode 100644 index 0000000..c9f91c8 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/PyrolyseOven.java @@ -0,0 +1,44 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.liquid.ILiquidStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the PyrolyseOven recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.PyrolyseOven") +@ModOnly(MOD_ID) +public class PyrolyseOven { + /** + * Adds a Pyrolyse Oven recipe. + * + * @param output recipe output + * @param fluidOutput recipe Fluid output + * @param circuit circuit preset nr. + * @param input recipe input + * @param fluidInput recipe Fluid input + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack fluidOutput, int circuit, IIngredient input, ILiquidStack fluidInput, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Pyrolyse Oven recipe for " + output, input, fluidInput, circuit, output, fluidOutput, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addPyrolyseRecipe(i.nextItem(), i.nextFluid(), i.nextInt(), i.nextItem(), i.nextFluid(), i.nextInt(), i.nextInt()); + } + }); + } +} + diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Separator.java b/src/main/java/gttweaker/mods/gregtech/machines/Separator.java new file mode 100644 index 0000000..1e8442d --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Separator.java @@ -0,0 +1,47 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; +import static gttweaker.util.ArrayHelper.itemOrNull; + +/** + * Provides access to the Separator recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Separator") +@ModOnly(MOD_ID) +public class Separator { + /** + * Adds a Separator recipe. + * + * @param input recipe input + * @param output Item output Slot 1-3 + * @param outChances Item output chances + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] output, IIngredient input, int[] outChances, int durationTicks, int euPerTick) { + if (output.length < 1) { + MineTweakerAPI.logError("Seperator must have at least 1 output"); + } else if (output.length != outChances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Separator recipe for " + input, input, output[0], itemOrNull(output, 1), itemOrNull(output, 2), outChances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addElectromagneticSeparatorRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextItem(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Sifter.java b/src/main/java/gttweaker/mods/gregtech/machines/Sifter.java new file mode 100644 index 0000000..a371a58 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Sifter.java @@ -0,0 +1,46 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Sifter recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Sifter") +@ModOnly(MOD_ID) +public class Sifter { + /** + * Adds a Sifter recipe. + * + * @param outputs 1-9 outputs + * @param input primary input + * @param outChances chances of 1-9 output + * @param durationTicks reaction time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IIngredient input, int[] outChances, int durationTicks, int euPerTick) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Sifter must have at least 1 output"); + } else if (outputs.length != outChances.length) { + MineTweakerAPI.logError("Number of Outputs does not equal number of Chances"); + } else { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Sifter recipe for " + input, input, outputs, outChances, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addSifterRecipe(i.nextItem(), i.nextItemArr(), i.nextIntArr(), i.nextInt(), i.nextInt()); + } + }); + } + } +} \ No newline at end of file diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Slicer.java b/src/main/java/gttweaker/mods/gregtech/machines/Slicer.java new file mode 100644 index 0000000..fe834c4 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Slicer.java @@ -0,0 +1,40 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Slicer recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Slicer") +@ModOnly(MOD_ID) +public class Slicer { + /** + * Adds an Slicer recipe. + * + * @param output primary output + * @param input primary input + * @param blade blade Slot + * @param durationTicks assembling duration, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, IItemStack blade, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Slicer recipe for " + output, input, blade, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addSlicerRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Unpacker.java b/src/main/java/gttweaker/mods/gregtech/machines/Unpacker.java new file mode 100644 index 0000000..e6070d3 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Unpacker.java @@ -0,0 +1,42 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Unpacker recipes. + * + * @author DreamMasterXXL + */ +@ZenClass("mods.gregtech.Unpacker") +@ModOnly(MOD_ID) +public class Unpacker { + /** + * Adds a Unpacker recipe. + * + * @param output1 recipe output Slot 1 + * @param output2 recipe output Slot 2 + * @param input recipe Input Slot + * @param durationTicks duration time, in ticks + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding Unpacker recipe for " + input, input, output1, output2, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addUnboxingRecipe(i.nextItem(), i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/VacuumFreezer.java b/src/main/java/gttweaker/mods/gregtech/machines/VacuumFreezer.java new file mode 100644 index 0000000..6b6a036 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/VacuumFreezer.java @@ -0,0 +1,38 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Vacuum Freezer recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.VacuumFreezer") +@ModOnly(MOD_ID) +public class VacuumFreezer { + /** + * Adds a vacuum freezer recipe. + * + * @param output recipe output + * @param input recipe input + * @param durationTicks freezing duration, in ticks + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int durationTicks) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding vacuum freezer recipe for " + output, input, output, durationTicks) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addVacuumFreezerRecipe(i.nextItem(), i.nextItem(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/mods/gregtech/machines/Wiremill.java b/src/main/java/gttweaker/mods/gregtech/machines/Wiremill.java new file mode 100644 index 0000000..7036891 --- /dev/null +++ b/src/main/java/gttweaker/mods/gregtech/machines/Wiremill.java @@ -0,0 +1,39 @@ +package gttweaker.mods.gregtech.machines; + +import gttweaker.mods.gregtech.AddMultipleRecipeAction; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +import static gregtech.api.enums.GT_Values.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + +/** + * Provides access to the Wiremill recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.gregtech.Wiremill") +@ModOnly(MOD_ID) +public class Wiremill { + /** + * Adds a Wiremill recipe. + * + * @param output recipe output + * @param input recipe input + * @param durationTicks processing time + * @param euPerTick eu consumption per tick + */ + @ZenMethod + public static void addRecipe(IItemStack output, IIngredient input, int durationTicks, int euPerTick) { + MineTweakerAPI.apply(new AddMultipleRecipeAction("Adding wiremill recipe for " + output, input, output, durationTicks, euPerTick) { + @Override + protected void applySingleRecipe(ArgIterator i) { + RA.addWiremillRecipe(i.nextItem(), i.nextItem(), i.nextInt(), i.nextInt()); + } + }); + } +} diff --git a/src/main/java/gttweaker/util/ArrayHelper.java b/src/main/java/gttweaker/util/ArrayHelper.java new file mode 100644 index 0000000..32cb7f7 --- /dev/null +++ b/src/main/java/gttweaker/util/ArrayHelper.java @@ -0,0 +1,10 @@ +package gttweaker.util; + +/** + * @author Techlone + */ +public class ArrayHelper { + public static T itemOrNull(T[] array, int i) { + return array.length > i ? array[i] : null; + } +} diff --git a/src/main/java/gttweaker/util/exception/AnyIngredientException.java b/src/main/java/gttweaker/util/exception/AnyIngredientException.java new file mode 100644 index 0000000..656a3a2 --- /dev/null +++ b/src/main/java/gttweaker/util/exception/AnyIngredientException.java @@ -0,0 +1,11 @@ +package gttweaker.util.exception; + +/** + * Created by Techlone + */ +public class AnyIngredientException extends RuntimeException { + @Override + public String toString() { + return "Can't add 'any' ingredient."; + } +} diff --git a/src/main/java/gttweaker/util/exception/EmptyIngredientException.java b/src/main/java/gttweaker/util/exception/EmptyIngredientException.java new file mode 100644 index 0000000..0f05056 --- /dev/null +++ b/src/main/java/gttweaker/util/exception/EmptyIngredientException.java @@ -0,0 +1,19 @@ +package gttweaker.util.exception; + +import minetweaker.api.item.IIngredient; + +/** + * Created by Techlone + */ +public class EmptyIngredientException extends RuntimeException { + public IIngredient ingredient; + + public EmptyIngredientException(IIngredient ingredient) { + this.ingredient = ingredient; + } + + @Override + public String toString() { + return "Ingredient '" + ingredient + "' is empty. Can't add recipe without items."; + } +} diff --git a/src/main/java/gttweaker/util/exception/OutOfStackSizeException.java b/src/main/java/gttweaker/util/exception/OutOfStackSizeException.java new file mode 100644 index 0000000..adbef96 --- /dev/null +++ b/src/main/java/gttweaker/util/exception/OutOfStackSizeException.java @@ -0,0 +1,20 @@ +package gttweaker.util.exception; + +import minetweaker.api.item.IIngredient; + +/** + * Created by Techlone + */ +public class OutOfStackSizeException extends RuntimeException { + private IIngredient ingredient; + private int amount; + + public OutOfStackSizeException(IIngredient ingredient, int amount) { + this.ingredient = ingredient; + this.amount = amount; + } + @Override + public String toString() { + return "Impossible add ingredient '" + ingredient + "' with amount " + amount; + } +}