diff --git a/MineTweaker3-MC1710-Main/src/main/java/minetweaker/api/minecraft/MineTweakerMC.java b/MineTweaker3-MC1710-Main/src/main/java/minetweaker/api/minecraft/MineTweakerMC.java index 5e984c6..e1a565b 100644 --- a/MineTweaker3-MC1710-Main/src/main/java/minetweaker/api/minecraft/MineTweakerMC.java +++ b/MineTweaker3-MC1710-Main/src/main/java/minetweaker/api/minecraft/MineTweakerMC.java @@ -412,6 +412,24 @@ public class MineTweakerMC { return (FluidStack) stack.getInternal(); } + /** + * Converts an array of MT liquid stacks into an array of MCF fluid stacks + * + */ + public static FluidStack[] getLiquidStacks(ILiquidStack[] stacks) { + if(stacks == null) { + return null; + } + + FluidStack[] res = new FluidStack[stacks.length]; + + for (int i = 0; i < stacks.length; i++) { + ILiquidStack liquidStack = stacks[i]; + res[i] = getLiquidStack(liquidStack); + } + return res; + } + private static final HashMap oreDictArrays = new HashMap(); public static IOreDictEntry getOreDictEntryFromArray(List array) { if (!oreDictArrays.containsKey(array)) { diff --git a/MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/game/MCGame.java b/MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/game/MCGame.java index b6b41da..67e167d 100644 --- a/MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/game/MCGame.java +++ b/MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/game/MCGame.java @@ -21,7 +21,8 @@ import minetweaker.api.item.IItemDefinition; import minetweaker.api.liquid.ILiquidDefinition; import minetweaker.api.minecraft.MineTweakerMC; import minetweaker.api.world.IBiome; -import minetweaker.mc1710.GuiCannotRemodify; +// TODO Find this +// import minetweaker.mc1710.GuiCannotRemodify; import minetweaker.mc1710.entity.MCEntityDefinition; import minetweaker.mc1710.item.MCItemDefinition; import minetweaker.mc1710.liquid.MCLiquidDefinition; @@ -134,11 +135,13 @@ public class MCGame implements IGame { MineTweakerAPI.getLogger().logError("Reload of scripts blocked (script lock)"); if (Minecraft.isGuiEnabled()) { - Minecraft.getMinecraft().displayGuiScreen( + // Commented out due to unresolved import + /** Minecraft.getMinecraft().displayGuiScreen( new GuiCannotRemodify( "Minecraft has been tweaked for another server", "with modifications that cannot be rolled back.", "Please restart your game.")); + **/ } } diff --git a/MineTweaker3-MC1710-Mod-GregTech/build.gradle b/MineTweaker3-MC1710-Mod-GregTech/build.gradle index 747fbd1..3ec4d53 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/build.gradle +++ b/MineTweaker3-MC1710-Mod-GregTech/build.gradle @@ -30,7 +30,7 @@ dependencies { compile project(':ZenScript') compile project(':MineTweaker3-API') compile project(':MineTweaker3-MC1710-Main') - compile files('libs/gregtech_1.7.10-5.05.11-dev.jar') + compile files('libs/gregtech_1.7.10-5.08.25-dev.jar') } task makeRegistry(type: RegisterZenClassesTask) { diff --git a/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech-1.7.10-api.jar b/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech-1.7.10-api.jar index 7d1d32b..574dacc 100644 Binary files a/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech-1.7.10-api.jar and b/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech-1.7.10-api.jar differ diff --git a/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech_1.7.10-5.08.25-dev.jar b/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech_1.7.10-5.08.25-dev.jar new file mode 100644 index 0000000..e9650c2 Binary files /dev/null and b/MineTweaker3-MC1710-Mod-GregTech/libs/gregtech_1.7.10-5.08.25-dev.jar differ diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/AlloySmelter.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/AlloySmelter.java index 267a92b..981c3b7 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/AlloySmelter.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/AlloySmelter.java @@ -1,7 +1,7 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; +import gregtech.api.enums.GT_Values; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +16,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.AlloySmelter") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class AlloySmelter { /** * Adds an alloy smelter recipe. @@ -53,7 +53,7 @@ public class AlloySmelter { @Override public void apply() { - GregTech_API.sRecipeAdder.addAlloySmelterRecipe( + GT_Values.RA.addAlloySmelterRecipe( MineTweakerMC.getItemStack(input1), MineTweakerMC.getItemStack(input2), MineTweakerMC.getItemStack(output), diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Amplifabricator.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Amplifabricator.java index 64ecb5d..9bd9f21 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Amplifabricator.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Amplifabricator.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Amplifabricator") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Amplifabricator { /** * Adds an amplifier. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ArcFurnace.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ArcFurnace.java new file mode 100644 index 0000000..e9a2126 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ArcFurnace.java @@ -0,0 +1,64 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.ArcFurnace") +public class ArcFurnace { + private static final class AddRecipeAction extends OneWayAction { + private IItemStack[] outputs; + private IItemStack input; + private ILiquidStack lInput; + private int[] chances; + private int dur; + private int euT; + private boolean reqPlasma; + + public AddRecipeAction(IItemStack[] outputs, IItemStack input, ILiquidStack lInput, int[] chances, int dur, int euT, boolean reqPlasma) { + this.outputs = outputs; + this.input = input; + this.lInput = lInput; + this.chances = chances; + this.dur = dur; + this.euT = euT; + this.reqPlasma = reqPlasma; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding " + input.getDisplayName() + " to Arc Furnace"; + } + + @Override + public void apply() { + if(reqPlasma) { + RA.addSimpleArcFurnaceRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getItemStacks(outputs) + , chances, dur, euT); + } else { + RA.addPlasmaArcFurnaceRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getItemStacks(outputs) + , chances, dur, euT); + } + } + } + + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IItemStack input, ILiquidStack lInput, int[] chances, int dur, int euT, boolean reqPlasma) { + MineTweakerAPI.apply(new AddRecipeAction(outputs, input, lInput, chances, dur, euT, reqPlasma)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Assembler.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Assembler.java index d0ad251..19ca6f9 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Assembler.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Assembler.java @@ -1,11 +1,13 @@ package minetweaker.mods.gregtech.machines; +import static gregtech.api.enums.GT_Values.RA; + import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; 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; @@ -16,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Assembler") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Assembler { /** * Adds an assemble recipe. @@ -32,6 +34,47 @@ public class Assembler { MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, euPerTick)); } + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, ILiquidStack lInput, int dur, int euT) { + MineTweakerAPI.apply(new AddFluidRecipeAction(output, input1, input2, lInput, dur, euT)); + } + private static final class AddFluidRecipeAction extends OneWayAction { + private IItemStack output; + private IItemStack input1; + private IItemStack input2; + private ILiquidStack lInput; + private int dur; + private int euT; + + public AddFluidRecipeAction(IItemStack output, IItemStack input1, IItemStack input2, ILiquidStack lInput, + int dur, int euT) { + this.output = output; + this.input1 = input1; + this.input2 = input2; + this.lInput = lInput; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding circuit assembler recipe w/ fluids"; + } + + @Override + public void apply() { + RA.addAssemblerRecipe(MineTweakerMC.getItemStack(input1) + , MineTweakerMC.getItemStack(input2) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } // ###################### // ### Action classes ### // ###################### diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Autoclave.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Autoclave.java new file mode 100644 index 0000000..4275528 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Autoclave.java @@ -0,0 +1,56 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.Autoclave") +public class Autoclave { + private static final class AddAutoclavingAction extends OneWayAction { + private IItemStack output; + private IItemStack input; + private ILiquidStack lInput; + private int chance; + private int dur; + private int euT; + + public AddAutoclavingAction(IItemStack output, IItemStack input, ILiquidStack lInput, int chance, int dur, + int euT) { + this.output = output; + this.input = input; + this.lInput = lInput; + this.chance = chance; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding autoclaving for " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addAutoclaveRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getItemStack(output) + , chance, dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input, ILiquidStack lInput, int chance, int dur, int euT) { + MineTweakerAPI.apply(new AddAutoclavingAction(output, input, lInput, chance, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BlastFurnace.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BlastFurnace.java index abbb5d1..acf4125 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BlastFurnace.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BlastFurnace.java @@ -1,11 +1,13 @@ package minetweaker.mods.gregtech.machines; +import static gregtech.api.enums.GT_Values.RA; + import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; 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; @@ -16,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.BlastFurnace") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class BlastFurnace { /** * Adds a recipe with a single output. @@ -52,6 +54,56 @@ public class BlastFurnace { } } + public static void addRecipe(IItemStack output1, IItemStack output2, ILiquidStack lOutput, ILiquidStack lInput, IItemStack input1, IItemStack input2, int dur, int euT, int level) { + MineTweakerAPI.apply(new AddFluidRecipeAction(output1, output2, lOutput, lInput, input1, input2, dur, euT, level)); + } + + private static final class AddFluidRecipeAction extends OneWayAction { + private IItemStack output1; + private IItemStack output2; + private ILiquidStack lOutput; + private IItemStack input1; + private IItemStack input2; + private int dur; + private int euT; + private int level; + private ILiquidStack lInput; + + public AddFluidRecipeAction(IItemStack output1, IItemStack output2, ILiquidStack lOutput, ILiquidStack lInput, + IItemStack input1, IItemStack input2, int dur, int euT, int level) { + this.output1 = output1; + this.output2 = output2; + this.lOutput = lOutput; + this.lInput = lInput; + this.input1 = input1; + this.input2 = input2; + this.dur = dur; + this.euT = euT; + this.level = level; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Added blast furnace recipe w/ liquids"; + } + + @Override + public void apply() { + RA.addBlastRecipe(MineTweakerMC.getItemStack(input1) + , MineTweakerMC.getItemStack(input2) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getLiquidStack(lOutput) + , MineTweakerMC.getItemStack(output1) + , MineTweakerMC.getItemStack(output2) + , dur, euT, level); + } + } + // ###################### // ### Action classes ### // ###################### @@ -77,7 +129,7 @@ public class BlastFurnace { @Override public void apply() { - GregTech_API.sRecipeAdder.addBlastRecipe( + RA.addBlastRecipe( MineTweakerMC.getItemStack(input1), MineTweakerMC.getItemStack(input2), MineTweakerMC.getItemStack(output1), diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Boxing.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Boxing.java index eb7a56d..c5d0d25 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Boxing.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Boxing.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Boxing") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Boxing { /** * Adds a boxing recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BrewingMachine.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BrewingMachine.java new file mode 100644 index 0000000..22093fb --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/BrewingMachine.java @@ -0,0 +1,51 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.BrewingMachine") +public class BrewingMachine { + private static final class AddBrewingRecipeAction extends OneWayAction { + private boolean hidden; + private IItemStack catalyst; + private ILiquidStack input; + private ILiquidStack output; + + public AddBrewingRecipeAction(ILiquidStack output, ILiquidStack input, IItemStack catalyst, boolean hidden) { + this.output = output; + this.input = input; + this.catalyst = catalyst; + this.hidden = hidden; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding recipe for brewing " + output.getDisplayName(); + } + + @Override + public void apply() { + RA.addBrewingRecipe(MineTweakerMC.getItemStack(catalyst) + , MineTweakerMC.getLiquidStack(input).getFluid() + , MineTweakerMC.getLiquidStack(output).getFluid() + , hidden); + } + } + + @ZenMethod + public static void addBrewingRecipe(ILiquidStack output, ILiquidStack input, IItemStack catalyst, boolean hidden) { + MineTweakerAPI.apply(new AddBrewingRecipeAction(output, input, catalyst, hidden)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/CNC.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/CNC.java index 3fa4b6d..e40021d 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/CNC.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/CNC.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.CNC") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class CNC { /** * Adds a CNC recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Canner.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Canner.java index 53f54fb..8e276a1 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Canner.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Canner.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Canner") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Canner { /** * Adds a canner recipe with a single output. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Centrifuge.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Centrifuge.java index e58240b..9444586 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Centrifuge.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Centrifuge.java @@ -1,12 +1,15 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; + +import static gregtech.api.enums.GT_Values.RA; + import java.util.Arrays; 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; @@ -16,7 +19,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan */ @ZenClass("mods.gregtech.Centrifuge") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Centrifuge { /** * Adds a centrifuge recipe. @@ -43,14 +46,22 @@ public class Centrifuge { * @param duration centrifuging time, in ticks */ @ZenMethod - public static void addRecipeFuelCan(IItemStack[] outputs, IItemStack input, int duration) { + 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, -1, duration)); + MineTweakerAPI.apply(new AddRecipeAction(outputs, input, -numCans, duration)); } } + @ZenMethod + public static void addRecipe(IItemStack[] outputs, ILiquidStack lOutput, IItemStack input1, IItemStack input2, ILiquidStack lInput, int[] chances, int durationTicks, int euPt) { + if (outputs.length < 1) { + MineTweakerAPI.logError("centrifuge must have at least 1 output"); + } else { + MineTweakerAPI.apply(new AddFluidRecipeAction(outputs, lOutput, input1, input2, lInput, chances, durationTicks, euPt)); + } + } // ###################### // ### Action classes ### // ###################### @@ -70,7 +81,7 @@ public class Centrifuge { @Override public void apply() { - GregTech_API.sRecipeAdder.addCentrifugeRecipe( + RA.addCentrifugeRecipe( MineTweakerMC.getItemStack(input), cells, MineTweakerMC.getItemStack(output[0]), @@ -126,4 +137,58 @@ public class Centrifuge { return true; } } + + private static class AddFluidRecipeAction extends OneWayAction { + + private IItemStack[] output; + private ILiquidStack lOutput; + private IItemStack input; + private ILiquidStack lInput; + private int durationTicks; + private int euPt; + private IItemStack input2; + private int[] chances; + + public AddFluidRecipeAction(IItemStack[] outputs, ILiquidStack lOutput, IItemStack input1, IItemStack input2, + ILiquidStack lInput, int[] chances, int durationTicks, int euPt) { + this.output = outputs; + this.lOutput = lOutput; + this.input = input1; + this.input2 = input2; + + this.lInput = lInput; + this.chances = chances; + this.durationTicks = durationTicks; + this.euPt = euPt; + } + + @Override + public void apply() { + RA.addCentrifugeRecipe( + MineTweakerMC.getItemStack(input), + MineTweakerMC.getItemStack(input2), + MineTweakerMC.getLiquidStack(lInput), + MineTweakerMC.getLiquidStack(lOutput), + 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, + durationTicks, + euPt); + } + + @Override + public String describe() { + return "Adding centrifuge recipe w/ fluids"; + } + + @Override + public Object getOverrideKey() { + return null; + } + + } } diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalBath.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalBath.java index a744f3c..01b3b10 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalBath.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalBath.java @@ -1,65 +1,37 @@ package minetweaker.mods.gregtech.machines; -import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + 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; -/** - * Provides access to the Chemical Reactor recipes. - * - * @author Stan Hebben - */ @ZenClass("mods.gregtech.ChemicalBath") -@ModOnly(MOD_ID) public class ChemicalBath { - /** - * Adds a Chemical Reactor recipe. - * - * @param output recipe output - * @param input1 primary input - * @param input2 secondary input - * @param durationTicks reaction time, in ticks - */ - @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; - } + private static final class AddFluidBathingAction extends OneWayAction { + private IItemStack output1; + private IItemStack output2; + private IItemStack output3; + private IItemStack input; + private ILiquidStack bathingFluid; + private int[] chances; + private int dur; + private int euT; - @Override - public void apply() { - GregTech_API.sRecipeAdder.addChemicalRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - duration); - } - - @Override - public String describe() { - return "Adding chemical reactor recipe for " + output; + public AddFluidBathingAction(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack input, + ILiquidStack bathingFluid, int[] chances, int dur, int euT) { + this.output1 = output1; + this.output2 = output2; + this.output3 = output3; + this.input = input; + this.bathingFluid = bathingFluid; + this.chances = chances; + this.dur = dur; + this.euT = euT; } @Override @@ -68,37 +40,24 @@ public class ChemicalBath { } @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; + public String describe() { + return "Adding bathing of " + input.getDisplayName(); } @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; + public void apply() { + RA.addChemicalBathRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getLiquidStack(bathingFluid) + , MineTweakerMC.getItemStack(output1) + , MineTweakerMC.getItemStack(output2) + , MineTweakerMC.getItemStack(output3) + , chances, dur, euT); } } + + @ZenMethod + public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack input, + ILiquidStack bathingFluid, int[] chances, int dur, int euT) { + MineTweakerAPI.apply(new AddFluidBathingAction(output1, output2, output3, input, bathingFluid, chances, dur, euT)); + } } diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalReactor.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalReactor.java index 2e26609..4a40d81 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalReactor.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ChemicalReactor.java @@ -1,11 +1,13 @@ package minetweaker.mods.gregtech.machines; +import static gregtech.api.enums.GT_Values.RA; + import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; 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; @@ -16,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.ChemicalReactor") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class ChemicalReactor { /** * Adds a Chemical Reactor recipe. @@ -31,6 +33,51 @@ public class ChemicalReactor { MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks)); } + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack lOutput, IItemStack input1, IItemStack input2, ILiquidStack lInput, int dur) { + MineTweakerAPI.apply(new AddFluidRecipeAction(output, lOutput, input1, input2, lInput, dur)); + } + + private static final class AddFluidRecipeAction extends OneWayAction { + private IItemStack output; + private ILiquidStack lOutput; + private IItemStack input1; + private IItemStack input2; + private ILiquidStack lInput; + private int dur; + + public AddFluidRecipeAction(IItemStack output, ILiquidStack lOutput, IItemStack input1, IItemStack input2, + ILiquidStack lInput, int dur) { + this.output = output; + // TODO Auto-generated constructor stub + this.lOutput = lOutput; + this.input1 = input1; + this.input2 = input2; + this.lInput = lInput; + this.dur = dur; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding chemical reaction w/ fluids"; + } + + @Override + public void apply() { + RA.addChemicalRecipe(MineTweakerMC.getItemStack(input1) + ,MineTweakerMC.getItemStack(input2) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getLiquidStack(lOutput) + , MineTweakerMC.getItemStack(output) + , dur); + } + } + // ###################### // ### Action classes ### // ###################### @@ -50,7 +97,7 @@ public class ChemicalReactor { @Override public void apply() { - GregTech_API.sRecipeAdder.addChemicalRecipe( + RA.addChemicalRecipe( MineTweakerMC.getItemStack(input1), MineTweakerMC.getItemStack(input2), MineTweakerMC.getItemStack(output), diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Cutter.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Cutter.java new file mode 100644 index 0000000..2a1c691 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Cutter.java @@ -0,0 +1,65 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.Cutter") +public class Cutter { + private static final class AddCutterRecipeAction extends OneWayAction { + private IItemStack output1; + private IItemStack output2; + private ILiquidStack lubricant; + private IItemStack input; + private int dur; + private int euT; + + public AddCutterRecipeAction(IItemStack output1, IItemStack output2, ILiquidStack lubricant, IItemStack input, + int dur, int euT) { + this.output1 = output1; + this.output2 = output2; + this.lubricant = lubricant; + this.input = input; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding cutting action for " + input.getDisplayName(); + } + + @Override + public void apply() { + if(lubricant == null) { + RA.addCutterRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(output1) + , MineTweakerMC.getItemStack(output2) + , dur, euT); + } else { + RA.addCutterRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getLiquidStack(lubricant) + , MineTweakerMC.getItemStack(output1) + , MineTweakerMC.getItemStack(output2) + , dur, euT); + } + } + } + + @ZenMethod + public static void addRecipe(IItemStack output1, IItemStack output2, ILiquidStack lubricant, + IItemStack input, int dur,int euT) { + MineTweakerAPI.apply(new AddCutterRecipeAction(output1, output2, lubricant, input, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/DistillationTower.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/DistillationTower.java index 4bebe07..ed67ff2 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/DistillationTower.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/DistillationTower.java @@ -1,12 +1,15 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; + +import static gregtech.api.enums.GT_Values.RA; + import java.util.Arrays; 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; @@ -17,7 +20,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.DistillationTower") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class DistillationTower { /** * Adds a distillation tower recipe with a single output. @@ -51,6 +54,47 @@ public class DistillationTower { } } + @ZenMethod + public static void addRecipe(ILiquidStack input, ILiquidStack[] outputs, IItemStack iOutput, int dur, int euT) { + MineTweakerAPI.apply(new AddFluidDistillationAction(input, outputs, iOutput, dur, euT)); + } + + private static final class AddFluidDistillationAction extends OneWayAction { + private ILiquidStack input; + private ILiquidStack[] outputs; + private IItemStack iOutput; + private int dur; + private int euT; + + public AddFluidDistillationAction(ILiquidStack input, ILiquidStack[] outputs, IItemStack iOutput, int dur, + int euT) { + this.input = input; + // TODO Auto-generated constructor stub + this.outputs = outputs; + this.iOutput = iOutput; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding fluid distillation of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addDistillationTowerRecipe(MineTweakerMC.getLiquidStack(input) + , MineTweakerMC.getLiquidStacks(outputs) + , MineTweakerMC.getItemStack(iOutput) + , dur, euT); + } + } + // ###################### // ### Action classes ### // ###################### diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Distillery.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Distillery.java new file mode 100644 index 0000000..76c6b0c --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Distillery.java @@ -0,0 +1,56 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.Distillery") +public class Distillery { + private static final class AddDistillationAction extends OneWayAction { + private ILiquidStack output; + private ILiquidStack input; + private IItemStack circuit; + private int dur; + private int euT; + private boolean hidden; + + public AddDistillationAction(ILiquidStack output, ILiquidStack input, IItemStack circuit, + int dur, int euT, boolean hidden) { + this.output = output; + this.input = input; + this.circuit = circuit; + this.dur = dur; + this.euT = euT; + this.hidden = hidden; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding distillation of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addDistilleryRecipe(MineTweakerMC.getItemStack(circuit) + , MineTweakerMC.getLiquidStack(input) + , MineTweakerMC.getLiquidStack(output) + , dur, euT, hidden); + } + } + + @ZenMethod + public static void addRecipe(ILiquidStack output, ILiquidStack input, IItemStack circuit, int dur, int euT, boolean hidden) { + MineTweakerAPI.apply(new AddDistillationAction(output, input, circuit, dur, euT, hidden)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ElectroMagneticSeperator.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ElectroMagneticSeperator.java new file mode 100644 index 0000000..e06f120 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ElectroMagneticSeperator.java @@ -0,0 +1,59 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.ElectroMagneticSeperator") +public class ElectroMagneticSeperator { + private static final class AddElectromagneticSeperationAction extends OneWayAction { + private IItemStack output1; + private IItemStack output2; + private IItemStack output3; + private IItemStack input; + private int[] chances; + private int dur; + private int euT; + + public AddElectromagneticSeperationAction(IItemStack output1, IItemStack output2, IItemStack output3, + IItemStack input, int[] chances, int dur, int euT) { + this.output1 = output1; + this.output2 = output2; + this.output3 = output3; + this.input = input; + this.chances = chances; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding electro-magnetic seperation of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addElectromagneticSeparatorRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(output1) + , MineTweakerMC.getItemStack(output2) + , MineTweakerMC.getItemStack(output3) + , chances, dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack input, int[] chances, + int dur, int euT) { + MineTweakerAPI.apply(new AddElectromagneticSeperationAction(output1, output2, output3, input, chances, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Electrolyzer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Electrolyzer.java index 43e53f6..8ee3f8a 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Electrolyzer.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Electrolyzer.java @@ -1,12 +1,15 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; + +import static gregtech.api.enums.GT_Values.RA; + import java.util.Arrays; 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; @@ -17,7 +20,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Electrolyzer") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Electrolyzer { /** * Adds an electrolyzer recipe. @@ -37,6 +40,14 @@ public class Electrolyzer { } } + @ZenMethod + public static void addRecipe(IItemStack[] outputs, ILiquidStack lOutput, IItemStack input1, IItemStack input2, ILiquidStack lInput, int[] chances, int durationTicks, int euPt) { + if (outputs.length < 1) { + MineTweakerAPI.logError("Electrolyzer must have at least 1 output"); + } else { + MineTweakerAPI.apply(new AddFluidRecipeAction(outputs, lOutput, input1, input2, lInput, chances, durationTicks, euPt)); + } + } // ###################### // ### Action classes ### // ###################### @@ -58,7 +69,7 @@ public class Electrolyzer { @Override public void apply() { - GregTech_API.sRecipeAdder.addElectrolyzerRecipe( + RA.addElectrolyzerRecipe( MineTweakerMC.getItemStack(input), cells, MineTweakerMC.getItemStack(output[0]), @@ -119,4 +130,59 @@ public class Electrolyzer { return true; } } + + private static class AddFluidRecipeAction extends OneWayAction { + + private IItemStack[] output; + private ILiquidStack lOutput; + private IItemStack input; + private ILiquidStack lInput; + private int durationTicks; + private int euPt; + private IItemStack input2; + private int[] chances; + + public AddFluidRecipeAction(IItemStack[] outputs, ILiquidStack lOutput, IItemStack input1, IItemStack input2, + ILiquidStack lInput, int[] chances, int durationTicks, int euPt) { + this.output = outputs; + this.lOutput = lOutput; + this.input = input1; + this.input2 = input2; + + this.lInput = lInput; + this.chances = chances; + this.durationTicks = durationTicks; + this.euPt = euPt; + } + + @Override + public void apply() { + RA.addElectrolyzerRecipe( + MineTweakerMC.getItemStack(input), + MineTweakerMC.getItemStack(input2), + MineTweakerMC.getLiquidStack(lInput), + MineTweakerMC.getLiquidStack(lOutput), + 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, + durationTicks, + euPt); + } + + @Override + public String describe() { + return "Adding electrolyzer recipe w/ fluids"; + } + + @Override + public Object getOverrideKey() { + return null; + } + + } + } diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Extruder.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Extruder.java index 2d8bcd9..827a1fd 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Extruder.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Extruder.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Extruder") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Extruder { /** * Adds an extruder recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fermenter.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fermenter.java new file mode 100644 index 0000000..33e2dc6 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fermenter.java @@ -0,0 +1,49 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.liquid.ILiquidStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.Fermenter") +public class Fermenter { + private static final class AddFermentationAction extends OneWayAction { + private ILiquidStack input; + private ILiquidStack output; + private int dur; + private boolean hidden; + + public AddFermentationAction(ILiquidStack input, ILiquidStack output, int dur, boolean hidden) { + this.input = input; + this.output = output; + this.dur = dur; + this.hidden = hidden; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding fermentation of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addFermentingRecipe(MineTweakerMC.getLiquidStack(input) + , MineTweakerMC.getLiquidStack(output) + , dur, hidden); + } + } + + @ZenMethod + public static void addRecipe(ILiquidStack input, ILiquidStack output, int dur, boolean hidden) { + MineTweakerAPI.apply(new AddFermentationAction(input, output, dur, hidden)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidCanner.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidCanner.java new file mode 100644 index 0000000..fb81fe6 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidCanner.java @@ -0,0 +1,51 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.FluidCanner") +public class FluidCanner { + private static final class AddFluidCanningAction extends OneWayAction { + private IItemStack output; + private ILiquidStack lOutput; + private ILiquidStack lInput; + private IItemStack input; + + public AddFluidCanningAction(IItemStack output, ILiquidStack lOutput, ILiquidStack lInput, IItemStack input) { + this.output = output; + this.lOutput = lOutput; + this.lInput = lInput; + this.input = input; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding canning of " + lInput.getDisplayName(); + } + + @Override + public void apply() { + RA.addFluidCannerRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(output) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getLiquidStack(lOutput)); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack lOutput, IItemStack input, ILiquidStack lInput) { + MineTweakerAPI.apply(new AddFluidCanningAction(output, lOutput, lInput, input)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidHeater.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidHeater.java new file mode 100644 index 0000000..91b1113 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidHeater.java @@ -0,0 +1,54 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.FluidHeater") +public class FluidHeater { + private static final class AddFluidHeatingAction extends OneWayAction { + private ILiquidStack output; + private ILiquidStack input; + private IItemStack circuit; + private int dur; + private int euT; + + public AddFluidHeatingAction(ILiquidStack output, ILiquidStack input, IItemStack circuit, int dur, int euT) { + this.output = output; + this.input = input; + this.circuit = circuit; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding heating of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addFluidHeaterRecipe(MineTweakerMC.getItemStack(circuit) + , MineTweakerMC.getLiquidStack(input) + , MineTweakerMC.getLiquidStack(output) + , dur, euT); + + } + } + + @ZenMethod + public static void addRecipe(ILiquidStack output, ILiquidStack input, IItemStack circuit, int dur, int euT) { + MineTweakerAPI.apply(new AddFluidHeatingAction(output, input, circuit, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidSmelter.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidSmelter.java new file mode 100644 index 0000000..1779441 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidSmelter.java @@ -0,0 +1,56 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.FluidSmelter") +public class FluidSmelter { + private static final class AddFluidSmeltingAction extends OneWayAction { + private ILiquidStack output; + private IItemStack input; + private IItemStack remains; + private int chance; + private int dur; + private int euT; + + public AddFluidSmeltingAction(ILiquidStack output, IItemStack input, IItemStack remains, int chance, int dur, + int euT) { + this.output = output; + this.input = input; + this.remains = remains; + this.chance = chance; + this.dur = dur; + this.euT = euT; + } + + @Override + public void apply() { + RA.addFluidSmelterRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(remains) + , MineTweakerMC.getLiquidStack(output) + , chance, dur, euT); + } + + @Override + public String describe() { + return "Adding fluid smelting for " + input.getDisplayName(); + } + + @Override + public Object getOverrideKey() { + return null; + } + } + + @ZenMethod + public static void addRecipe(ILiquidStack output, IItemStack input, IItemStack remains, int chance, int dur, int euT) { + MineTweakerAPI.apply(new AddFluidSmeltingAction(output, input, remains, chance, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidSolidifier.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidSolidifier.java new file mode 100644 index 0000000..752e506 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FluidSolidifier.java @@ -0,0 +1,53 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.FluidSolidifier") +public class FluidSolidifier { + private static final class AddFluidSolidificationAction extends OneWayAction { + private IItemStack output; + private ILiquidStack input; + private IItemStack mold; + private int dur; + private int euT; + + public AddFluidSolidificationAction(IItemStack output, ILiquidStack input, IItemStack mold, int dur, int euT) { + this.output = output; + this.input = input; + this.mold = mold; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding solidification of fluid " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addFluidSolidifierRecipe(MineTweakerMC.getItemStack(mold) + , MineTweakerMC.getLiquidStack(input) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack input, IItemStack mold, int dur, int euT) { + MineTweakerAPI.apply(new AddFluidSolidificationAction(output, input, mold, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ForgeHammer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ForgeHammer.java index 4ce7ba5..d226d0c 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ForgeHammer.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ForgeHammer.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.ForgeHammer") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class ForgeHammer { /** * Add a Forge Hammer recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FormingPress.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FormingPress.java new file mode 100644 index 0000000..09a51e0 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FormingPress.java @@ -0,0 +1,52 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.FormingPress") +public class FormingPress { + private static final class AddPressFormingAction extends OneWayAction { + private IItemStack output; + private IItemStack input; + private IItemStack form; + private int dur; + private int euT; + + public AddPressFormingAction(IItemStack output, IItemStack input, IItemStack form, int dur, int euT) { + this.output = output; + this.input = input; + this.form = form; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Added press forming of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addFormingPressRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(form) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input, IItemStack form, int dur, int euT) { + MineTweakerAPI.apply(new AddPressFormingAction(output, input, form, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fuels.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fuels.java index 3d92219..0d78f59 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fuels.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Fuels.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Fuels") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Fuels { /** * Adds a Diesel Engine fuel. If the given item does not contain any liquid, diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FusionReactor.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FusionReactor.java index 3f07eb7..7804ac5 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FusionReactor.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/FusionReactor.java @@ -1,11 +1,11 @@ package minetweaker.mods.gregtech.machines; -import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; +import static gregtech.api.enums.GT_Values.RA; + 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; @@ -13,67 +13,33 @@ import stanhebben.zenscript.annotations.ZenMethod; /** * Provides access to the fusion reactor recipes. * - * @author Stan Hebben + * @author Stan Hebben (rewritten by Ben) */ @ZenClass("mods.gregtech.FusionReactor") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class FusionReactor { /** - * Adds a Fusion Reactor recipe. - * - * @param output reactor output - * @param input1 primary input - * @param input2 secondary input - * @param durationTicks fusion duration, in ticks - * @param energyPerTick eu consumption per tick - * @param startEnergy starting energy + * Action to add a recipe to the fusion reactor + * @author ben + * */ - @ZenMethod - public static void addRecipe(IItemStack output, IItemStack input1, IItemStack input2, int durationTicks, int energyPerTick, int startEnergy) { - MineTweakerAPI.apply(new AddRecipeAction(output, input1, input2, durationTicks, energyPerTick, startEnergy)); - } - - // ###################### - // ### Action classes ### - // ###################### - - private static class AddRecipeAction extends OneWayAction { - private final IItemStack output; - private final IItemStack input1; - private final IItemStack input2; - private final int durationTicks; - private final int energyPerTick; - private final int startEnergy; - - public AddRecipeAction( - IItemStack output, - IItemStack input1, - IItemStack input2, - int durationTicks, - int energyPerTick, - int startEnergy) { - this.output = output; - this.input1 = input1; - this.input2 = input2; - this.durationTicks = durationTicks; - this.energyPerTick = energyPerTick; - this.startEnergy = startEnergy; - } + private static final class AddFusionReactionAction extends OneWayAction { + private ILiquidStack output; + private ILiquidStack input1; + private ILiquidStack input2; + private int durationTicks; + private int energyPerTick; + private int startEnergy; - @Override - public void apply() { - GregTech_API.sRecipeAdder.addFusionReactorRecipe( - MineTweakerMC.getItemStack(input1), - MineTweakerMC.getItemStack(input2), - MineTweakerMC.getItemStack(output), - durationTicks, - energyPerTick, - startEnergy); - } - - @Override - public String describe() { - return "Adding fusion reactor recipe for " + output; + public AddFusionReactionAction(ILiquidStack output, ILiquidStack input1, ILiquidStack input2, int durationTicks, + int energyPerTick, int startEnergy) { + this.output = output; + // TODO Auto-generated constructor stub + this.input1 = input1; + this.input2 = input2; + this.durationTicks = durationTicks; + this.energyPerTick = energyPerTick; + this.startEnergy = startEnergy; } @Override @@ -82,45 +48,31 @@ public class FusionReactor { } @Override - public int hashCode() { - int hash = 5; - hash = 97 * hash + (this.output != null ? this.output.hashCode() : 0); - hash = 97 * hash + (this.input1 != null ? this.input1.hashCode() : 0); - hash = 97 * hash + (this.input2 != null ? this.input2.hashCode() : 0); - hash = 97 * hash + this.durationTicks; - hash = 97 * hash + this.energyPerTick; - hash = 97 * hash + this.startEnergy; - return hash; + public String describe() { + return "Adding fusion recipe for " + output.getName(); } @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.durationTicks != other.durationTicks) { - return false; - } - if (this.energyPerTick != other.energyPerTick) { - return false; - } - if (this.startEnergy != other.startEnergy) { - return false; - } - return true; + public void apply() { + RA.addFusionReactorRecipe(MineTweakerMC.getLiquidStack(input1), MineTweakerMC.getLiquidStack(input2), MineTweakerMC.getLiquidStack(output) + , durationTicks, energyPerTick, startEnergy); } } + + /** + * Adds a Fusion Reactor recipe. + * + * @param input1 = first Input (not null, and respects StackSize) + * @param input2= second Input (not null, and respects StackSize) + * @param output = Output of the Fusion (can be null, and respects StackSize) + * @param durationInTicks = How many ticks the Fusion lasts (must be > 0) + * @param energyPerTick = The EU generated per Tick (can even be negative!) + * @param startEnergy = EU needed for heating the Reactor up (must be >= 0) + */ + @ZenMethod + public static void addRecipe(ILiquidStack output, ILiquidStack input1, ILiquidStack input2, int durationTicks, int energyPerTick, int startEnergy) { + MineTweakerAPI.apply(new AddFusionReactionAction(output, input1, input2, durationTicks, energyPerTick, startEnergy)); + } + + } diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Grinder.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Grinder.java index 631d2ec..c8f167c 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Grinder.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Grinder.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import gregtech.api.util.GT_ModHandler; import java.util.Arrays; import minetweaker.MineTweakerAPI; @@ -19,7 +18,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Grinder") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Grinder { /** * Adds a recipe with a single output. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ImplosionCompressor.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ImplosionCompressor.java index 01e4caa..9dd4a0b 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ImplosionCompressor.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/ImplosionCompressor.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.ImplosionCompressor") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class ImplosionCompressor { /** * Adds an implosion compressor recipe with a single output. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/LaserEngraver.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/LaserEngraver.java new file mode 100644 index 0000000..cbc10d4 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/LaserEngraver.java @@ -0,0 +1,52 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.LaserEngraver") +public class LaserEngraver { + private static final class AddLaserEngravingAction extends OneWayAction { + private IItemStack output; + private IItemStack input; + private IItemStack lens; + private int dur; + private int euT; + + public AddLaserEngravingAction(IItemStack output, IItemStack input, IItemStack lens, int dur, int euT) { + this.output = output; + this.input = input; + this.lens = lens; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Added laser engraving of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addLaserEngraverRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(lens) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input, IItemStack lens, int dur, int euT) { + MineTweakerAPI.apply(new AddLaserEngravingAction(output, input, lens, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Lathe.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Lathe.java index 3e96030..5b23698 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Lathe.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Lathe.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Lathe") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Lathe { /** * Adds a lathe recipe with a single output. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Mixer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Mixer.java new file mode 100644 index 0000000..6340437 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Mixer.java @@ -0,0 +1,68 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.Mixer") +public class Mixer { + private static final class AddMixingAction extends OneWayAction { + private IItemStack output; + private ILiquidStack lOutput; + private IItemStack input1; + private IItemStack input2; + private IItemStack input3; + private IItemStack input4; + private int dur; + private int euT; + private ILiquidStack lInput; + + public AddMixingAction(IItemStack output, ILiquidStack lOutput, ILiquidStack lInput, IItemStack input1, IItemStack input2, + IItemStack input3, IItemStack input4, int dur, int euT) { + this.output = output; + this.lOutput = lOutput; + this.lInput = lInput; + this.input1 = input1; + this.input2 = input2; + this.input3 = input3; + this.input4 = input4; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding mixing w/ multiple inputs"; + } + + @Override + public void apply() { + RA.addMixerRecipe(MineTweakerMC.getItemStack(input1) + , MineTweakerMC.getItemStack(input2) + , MineTweakerMC.getItemStack(input3) + , MineTweakerMC.getItemStack(input4) + , MineTweakerMC.getLiquidStack(lInput) + , MineTweakerMC.getLiquidStack(lOutput) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, ILiquidStack lOutput, ILiquidStack lInput, IItemStack input1, IItemStack input2, + IItemStack input3, IItemStack input4, int dur, int euT) { + MineTweakerAPI.apply(new AddMixingAction(output, lOutput, lInput, input1, input2, input3, input4, dur, euT)); + } + +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateBender.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateBender.java index baaada2..c114ad5 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateBender.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateBender.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.PlateBender") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class PlateBender { /** * Adds a plate bender recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateCutter.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateCutter.java index 9c52315..4d0dd2f 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateCutter.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/PlateCutter.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -17,7 +16,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.PlateCutter") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class PlateCutter { /** * Adds a plate cutter recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Polarizer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Polarizer.java new file mode 100644 index 0000000..4fba029 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Polarizer.java @@ -0,0 +1,50 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.Polarizer") +public class Polarizer { + + private static final class AddPolarizationRecipeAction extends OneWayAction { + private IItemStack output; + private IItemStack input; + private int dur; + private int euT; + + public AddPolarizationRecipeAction(IItemStack output, IItemStack input, int dur, int euT) { + this.output = output; + this.input = input; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding polarization of " + input.getDisplayName() + " to " + output.getDisplayName(); + } + + @Override + public void apply() { + RA.addPolarizerRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input, int dur, int euT) { + MineTweakerAPI.apply(new AddPolarizationRecipeAction(output, input, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Printer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Printer.java new file mode 100644 index 0000000..e4b8e22 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Printer.java @@ -0,0 +1,57 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +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; + +@ZenClass("mods.gregtech.printer") +public class Printer { + private static final class AddPrintingAction extends OneWayAction { + private IItemStack output; + private IItemStack input; + private IItemStack special; + private ILiquidStack ink; + private int dur; + private int euT; + + public AddPrintingAction(IItemStack output, IItemStack input, IItemStack special, ILiquidStack ink, int dur, + int euT) { + this.output = output; + this.input = input; + this.special = special; + this.ink = ink; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Added printing of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addPrinterRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getLiquidStack(ink) + , MineTweakerMC.getItemStack(special) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack output, IItemStack input, IItemStack special, ILiquidStack ink, int dur, int euT) { + MineTweakerAPI.apply(new AddPrintingAction(output, input, special, ink, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Pulveriser.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Pulveriser.java new file mode 100644 index 0000000..6cb4542 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Pulveriser.java @@ -0,0 +1,51 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.Pulveriser") +public class Pulveriser { + private static final class AddPulverisingAction extends OneWayAction { + private IItemStack[] outputs; + private IItemStack input; + private int[] chances; + private int dur; + private int euT; + + public AddPulverisingAction(IItemStack[] outputs, IItemStack input, int[] chances, int dur, int euT) { + this.outputs = outputs; + this.input = input; + this.chances = chances; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Added pulverising of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addPulveriserRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStacks(outputs) + , chances, dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IItemStack input, int[] chances, int dur, int euT) { + MineTweakerAPI.apply(new AddPulverisingAction(outputs, input, chances, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sifter.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sifter.java new file mode 100644 index 0000000..7834397 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sifter.java @@ -0,0 +1,51 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.Sifter") +public class Sifter { + private static final class AddSiftingAction extends OneWayAction { + private IItemStack[] outputs; + private IItemStack input; + private int[] chances; + private int dur; + private int euT; + + public AddSiftingAction(IItemStack[] outputs, IItemStack input, int[] chances, int dur, int euT) { + this.outputs = outputs; + this.input = input; + this.chances = chances; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Added sifting of " + input.getDisplayName(); + } + + @Override + public void apply() { + RA.addSifterRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStacks(outputs) + , chances, dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack[] outputs, IItemStack input, int[] chances, int dur, int euT) { + MineTweakerAPI.apply(new AddSiftingAction(outputs, input, chances, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Slicer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Slicer.java new file mode 100644 index 0000000..69d2a2a --- /dev/null +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Slicer.java @@ -0,0 +1,52 @@ +package minetweaker.mods.gregtech.machines; + +import static gregtech.api.enums.GT_Values.RA; + +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +@ZenClass("mods.gregtech.Slicer") +public class Slicer { + private static final class AddSlicingRecipeAction extends OneWayAction { + private IItemStack input; + private IItemStack shape; + private IItemStack output; + private int dur; + private int euT; + + public AddSlicingRecipeAction(IItemStack input, IItemStack shape, IItemStack output, int dur, int euT) { + this.input = input; + this.shape = shape; + this.output = output; + this.dur = dur; + this.euT = euT; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Adding slicing of " + input.getDisplayName() + " into " + output.getDisplayName(); + } + + @Override + public void apply() { + RA.addSlicerRecipe(MineTweakerMC.getItemStack(input) + , MineTweakerMC.getItemStack(shape) + , MineTweakerMC.getItemStack(output) + , dur, euT); + } + } + + @ZenMethod + public static void addRecipe(IItemStack input, IItemStack shape, IItemStack output, int dur, int euT) { + MineTweakerAPI.apply(new AddSlicingRecipeAction(input, shape, output, dur, euT)); + } +} diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sonictron.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sonictron.java index e94c81c..736930c 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sonictron.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Sonictron.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Sonictron") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Sonictron { /** * Adds a sonictron sound. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/VacuumFreezer.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/VacuumFreezer.java index c92f222..d21764e 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/VacuumFreezer.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/VacuumFreezer.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.VacuumFreezer") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class VacuumFreezer { /** * Adds a vacuum freezer recipe. diff --git a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Wiremill.java b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Wiremill.java index 18e2059..ffa9c16 100644 --- a/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Wiremill.java +++ b/MineTweaker3-MC1710-Mod-GregTech/src/main/java/minetweaker/mods/gregtech/machines/Wiremill.java @@ -1,7 +1,6 @@ package minetweaker.mods.gregtech.machines; import gregtech.api.GregTech_API; -import static gregtech.api.GregTech_API.MOD_ID; import minetweaker.MineTweakerAPI; import minetweaker.OneWayAction; import minetweaker.annotations.ModOnly; @@ -16,7 +15,7 @@ import stanhebben.zenscript.annotations.ZenMethod; * @author Stan Hebben */ @ZenClass("mods.gregtech.Wiremill") -@ModOnly(MOD_ID) +@ModOnly("gregtech") public class Wiremill { /** * Adds a Wiremill recipe. diff --git a/MineTweaker3-MC1710-Mod-IC2/build.gradle b/MineTweaker3-MC1710-Mod-IC2/build.gradle index c7beddf..59ff741 100644 --- a/MineTweaker3-MC1710-Mod-IC2/build.gradle +++ b/MineTweaker3-MC1710-Mod-IC2/build.gradle @@ -30,7 +30,7 @@ dependencies { compile project(':ZenScript') compile project(':MineTweaker3-API') compile project(':MineTweaker3-MC1710-Main') - compile files('libs/industrialcraft-2-2.2.491-experimental-api.jar') + compile files('libs/industrialcraft-2-2.2.756-experimental-api.jar') } task makeRegistry(type: RegisterZenClassesTask) { diff --git a/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.491-experimental-api.jar b/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.491-experimental-api.jar deleted file mode 100644 index e638b56..0000000 Binary files a/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.491-experimental-api.jar and /dev/null differ diff --git a/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.756-experimental-api.jar b/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.756-experimental-api.jar new file mode 100644 index 0000000..d579f0e Binary files /dev/null and b/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.756-experimental-api.jar differ diff --git a/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.491-experimental-dev.jar b/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.756-experimental-dev.jar similarity index 59% rename from MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.491-experimental-dev.jar rename to MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.756-experimental-dev.jar index 6b11947..f5f9880 100644 Binary files a/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.491-experimental-dev.jar and b/MineTweaker3-MC1710-Mod-IC2/libs/industrialcraft-2-2.2.756-experimental-dev.jar differ diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/Crop.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/Crop.java new file mode 100644 index 0000000..066d165 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/Crop.java @@ -0,0 +1,84 @@ +package minetweaker.mods.ic2.crops; + +import ic2.api.crops.CropCard; +import stanhebben.zenscript.annotations.ZenCaster; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenGetter; +import stanhebben.zenscript.annotations.ZenMethod; + +/** + * Read-only data accessor for crops + * @author ben + * + */ +@ZenClass("mods.ic2.Crop") +public class Crop { + private CropCard cc; + + @ZenGetter("name") + public String name() { + return cc.name(); + } + + @ZenGetter("owner") + public String owner() { + return cc.owner(); + } + + @ZenGetter("displayName") + public String displayName() { + return cc.displayName(); + } + + @ZenGetter("hashCode") + public int hashCode() { + return cc.hashCode(); + } + + @ZenGetter("discoveredBy") + public String discoveredBy() { + return cc.discoveredBy(); + } + + @ZenMethod + public String desc(int i) { + return cc.desc(i); + } + + @ZenGetter("tier") + public int tier() { + return cc.tier(); + } + + @ZenMethod + public int stat(int n) { + return cc.stat(n); + } + + @ZenGetter("attributes") + public String[] attributes() { + return cc.attributes(); + } + + @ZenGetter("maxSize") + public int maxSize() { + return cc.maxSize(); + } + + @ZenGetter("dropGainChance") + public float dropGainChance() { + return cc.dropGainChance(); + } + + @ZenCaster + public String toString() { + return cc.toString(); + } + + public Crop(CropCard cc) { + super(); + this.cc = cc; + } + + +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/CropsConfig.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/CropsConfig.java new file mode 100644 index 0000000..5159d13 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/CropsConfig.java @@ -0,0 +1,262 @@ +package minetweaker.mods.ic2.crops; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import ic2.api.crops.CropCard; +import ic2.api.crops.Crops; +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import net.minecraftforge.common.BiomeDictionary; +import stanhebben.zenscript.annotations.ZenCaster; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenGetter; +/** + * Provides access to IC2 crop system in general + * @author ben + * + */ +import stanhebben.zenscript.annotations.ZenMethod; +@ZenClass("mods.ic2.CropsConfig") +@ModOnly("IC2") +public class CropsConfig { + /** + * Action to add a new seed for a base crop + * @author ben + * + */ + private static final class RegisterBaseSeedAction extends OneWayAction { + private IItemStack seed; + private CropCard c; + private int sz; + private int growth; + private int gain; + private int resist; + + public RegisterBaseSeedAction(IItemStack seed, CropCard c, int sz, int growth, int gain, int resist) { + this.seed = seed; + this.c = c; + this.sz = sz; + this.growth = growth; + this.gain = gain; + this.resist = resist; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + return "Registering base seed for crop " + c.name(); + } + + @Override + public void apply() { + Crops.instance.registerBaseSeed(MineTweakerMC.getItemStack(seed), c, sz, growth, gain, resist); + } + } + + + + /** + * Action to register a new crop + * @author ben + * + */ + private static final class RegisterCropCardAction extends OneWayAction { + private CropCard c; + + public RegisterCropCardAction(CropCard c) { + this.c = c; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public String describe() { + // TODO Auto-generated method stub + return "Registering crop " + c.name(); + } + + @Override + public void apply() { + Crops.instance.registerCrop(c); + } + } + + + /** + * Action to add a biome nutrient bonus + * @author ben + * + */ + private static final class AddBiomeNutrientBonusAction extends OneWayAction { + private String biomeType; + private int nutrientBonus; + + public AddBiomeNutrientBonusAction(String biomeType, int nutrientBonus) { + this.biomeType = biomeType; + this.nutrientBonus = nutrientBonus; + } + + @Override + public Object getOverrideKey() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String describe() { + return "Setting biome nutrient bonus for " + biomeType + " biomes to " + + nutrientBonus; + } + + @Override + public void apply() { + Crops.instance.addBiomenutrientsBonus(BiomeDictionary.Type.valueOf(biomeType), + nutrientBonus); + } + } + + /** + * Action to add a biome humidity bonus + * @author ben + * + */ + private static final class AddBiomeHumidityBonusAction extends OneWayAction { + private String biomeType; + private int humidityBonus; + + public AddBiomeHumidityBonusAction(String biomeType, int humidityBonus) { + this.biomeType = biomeType; + this.humidityBonus = humidityBonus; + } + + @Override + public Object getOverrideKey() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String describe() { + return "Setting biome humidity bonus for " + biomeType + " biomes to " + + humidityBonus; + } + + @Override + public void apply() { + Crops.instance.addBiomehumidityBonus(BiomeDictionary.Type.valueOf(biomeType), + humidityBonus); + } + } + + /** + * Add a nutrient bonus to crops in a specific biome + */ + @ZenMethod + public static void addBiomeNutrientBonus(String biomeType, int nutrientBonus) { + if(BiomeDictionary.Type.valueOf(biomeType) == null) { + MineTweakerAPI.logWarning("invalid biome type: " + biomeType); + } else if (nutrientBonus < -10 || nutrientBonus > 10) { + MineTweakerAPI.logWarning("nutrient bonus " + nutrientBonus + + " not in -10, +10 range"); + } else { + MineTweakerAPI.apply(new AddBiomeNutrientBonusAction(biomeType, nutrientBonus)); + } + } + + /** + * Add a humidity bonus to crops in a specific biome + */ + @ZenMethod + public static void addBiomeHumidityBonus(String biomeType, int humidityBonus) { + if(BiomeDictionary.Type.valueOf(biomeType) == null) { + MineTweakerAPI.logWarning("invalid biome type: " + biomeType); + } else if (humidityBonus < -10 || humidityBonus > 10) { + MineTweakerAPI.logWarning("humidity bonus " + humidityBonus + + " not in -10, +10 range"); + } else { + MineTweakerAPI.apply(new AddBiomeHumidityBonusAction(biomeType, humidityBonus)); + } + } + + /** + * Creates a new synthetic crop to manipulate + * @param cropOwner The mod that owns the crop + * @param cropName The name of the crop + */ + @ZenMethod + public static SyntheticCrop newCrop(String cropName, String cropOwner) { + return new SyntheticCrop(cropName, cropOwner); + } + + /** + * Register a crop into the crop system + */ + @ZenMethod + public static void registerCrop(CropCard c) { + MineTweakerAPI.apply(new RegisterCropCardAction(c)); + } + + /** + * Register a new base seed item to plant a crop + * + * @param seed The item to plant with + * @param c The crop being planted + * @param sz The initial size of the planted crop + * @param growth The initial growth stat of the planted crop + * @param gain The initial gain stat of the planted crop + * @param resist The initial resistance of the planted crop + */ + public static void registerBaseSeed(IItemStack seed, CropCard c, int sz, + int growth, int gain, int resist) { + MineTweakerAPI.apply(new RegisterBaseSeedAction(seed, c, sz, growth, gain, resist)); + } + + /** + * Get a crop by its name and owning mod + * @param owner The mod that owns the crop + * @param name The name of the crop + * @return A crop with the given name, owned by the given mod + */ + @ZenMethod + public static Crop getCrop(String owner, String name) { + return new Crop(Crops.instance.getCropCard(owner, name)); + } + + /** + * Get a crop by the seed that plants it + * @param seed The seed that plants the crop + * @return The crop planted by the seed + */ + @ZenMethod + public static Crop getCrop(IItemStack seed) { + return new Crop(Crops.instance.getCropCard(MineTweakerMC.getItemStack(seed))); + } + + /** + * Get all of the currently registered crops + * @return All of the currently registered crops + */ + @ZenGetter("crops") + public static List getAllCrops() { + Collection ccList = Crops.instance.getCrops(); + + List cList = new ArrayList(ccList.size()); + for (CropCard cropCard : ccList) { + cList.add(new Crop(cropCard)); + } + + return cList; + } +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/GrowthRequirements.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/GrowthRequirements.java new file mode 100644 index 0000000..c7d9ea1 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/GrowthRequirements.java @@ -0,0 +1,144 @@ +package minetweaker.mods.ic2.crops; + +import minetweaker.api.item.IItemStack; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenGetter; +import stanhebben.zenscript.annotations.ZenSetter; + +/** + * Contains all of the growth requirements for an IC2 crop in one easy place + * @author ben + * + */ +@ZenClass("mods.ic2.GrowthRequirements") +public class GrowthRequirements { + + private int minNutrients; + private int minHumidity; + private int minAirQuality; + + private int minLight; + private int maxLight = 17; + + private IItemStack requiredBlock; + + /** + * Get the minimum amount of nutrients this plant needs to grow + * @return The minimum amount of nutrients this plant needs + */ + @ZenGetter("minNutrients") + public int getMinNutrients() { + return minNutrients; + } + + /** + * Set the minimum amount of nutrients this plant needs to grow + * @param minNutrients The new minimum amount of nutrients this plant requires + */ + @ZenSetter("minNutrients") + public void setMinNutrients(int minNutrients) { + this.minNutrients = minNutrients; + } + + /** + * Get the minimum amount of humidity this plant requires + * @return The minimum amount of humidity this plant requires + */ + @ZenGetter("minHumidity") + public int getMinHumidity() { + return minHumidity; + } + + /** + * Set the minimum amount of humidity this plant requires + * @param minHumidity The new minimum amount of humidity this plant requires + */ + @ZenSetter("minHumidity") + public void setMinHumidity(int minHumidity) { + this.minHumidity = minHumidity; + } + + /** + * Get the minimum air quality this plant requires + * @return The minimum air quality this plant requires + */ + @ZenGetter("minAirQuality") + public int getMinAirQuality() { + return minAirQuality; + } + + /** + * Set the minimum air quality this plant requires + * @param minAirQuality The new amount of air quality this plant requires + */ + @ZenSetter("minAirQuality") + public void setMinAirQuality(int minAirQuality) { + this.minAirQuality = minAirQuality; + } + + /** + * Get the minimum amount of light this plant requires + * @return The minimum amount of light this plant requires + */ + @ZenGetter("minLight") + public int getMinLight() { + return minLight; + } + + /** + * Set the minimum amount of light this plant requires + * @param minLight The new minimum amount of light this plant requires + */ + @ZenSetter("minLight") + public void setMinLight(int minLight) { + this.minLight = minLight; + } + + /** + * Get the maximum amount of light this plant can have + * @return The maximum amount of light this plant can have + */ + @ZenGetter("maxLight") + public int getMaxLight() { + return maxLight; + } + + /** + * Set the maximum amount of light this plant can have + * @param maxLight The new maximum amount of light thi plant can have + */ + @ZenSetter("maxLight") + public void setMaxLight(int maxLight) { + this.maxLight = maxLight; + } + + /** + * Get the block that is required to be below this one + * @return The block required to be below this one + */ + @ZenGetter("requiredBlock") + public IItemStack getRequiredBlock() { + return requiredBlock; + } + + /** + * Set the block required to be below this one + * @param requiredBlock The new block required to be below this one + */ + @ZenSetter("requiredBlock") + public void setRequiredBlock(IItemStack requiredBlock) { + this.requiredBlock = requiredBlock; + } + + + public GrowthRequirements(int minNutrients, int minHumidity, int minAirQuality, int minLight, int maxLight, + IItemStack requiredBlock) { + super(); + this.minNutrients = minNutrients; + this.minHumidity = minHumidity; + this.minAirQuality = minAirQuality; + this.minLight = minLight; + this.maxLight = maxLight; + this.requiredBlock = requiredBlock; + } +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/SyntheticCrop.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/SyntheticCrop.java new file mode 100644 index 0000000..41ec1f8 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/crops/SyntheticCrop.java @@ -0,0 +1,295 @@ +package minetweaker.mods.ic2.crops; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ic2.api.crops.CropCard; +import ic2.api.crops.ICropTile; +import minetweaker.MineTweakerAPI; +import minetweaker.api.item.IItemStack; +import minetweaker.api.minecraft.MineTweakerMC; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenGetter; +import stanhebben.zenscript.annotations.ZenMethod; +import stanhebben.zenscript.annotations.ZenSetter; + +/** + * A synthetic crop, created in ZS + * + * For your crop textures to be picked up, put them at owner + ":crops/crop" + + * name + "." + size where owner is the mod responsible for the crop name is the + * name of the crop size is the current size of the crop, starting at 0 for new + * crops + * + * Localizations will be looked for at owner + ".crop." + name where each field + * has the value it has above + * + * @author ben + * + */ +@ZenClass("mods.ic2.Crop") +public class SyntheticCrop extends CropCard { + + private String name; + private String owner; + + private int tier; + + private int[] stats = new int[4]; + private String[] attributes; + + private int maxSize; + + private float dropChance; + private IItemStack fruit; + + private GrowthRequirements reqs; + + /** + * Create a new synthetic crop + * + * @param cropName + * The name of this crop + * @param cropOwner + * The mod creating this crop + */ + public SyntheticCrop(String cropName, String cropOwner) { + name = cropName; + } + + // Required IC2 Interface + /** + * Gets the name of this crop used as a identifier + */ + @Override + @ZenGetter("name") + public String name() { + return name; + } + + /** + * Get the mod that owns this crop + */ + @Override + @ZenGetter("owner") + public String owner() { + return owner; + } + + /** + * Gets the localization key used for this crop + */ + @Override + public String displayName() { + return owner + ".crop." + name; + } + + /** + * Gets the seed tier of this crop. + */ + @Override + @ZenGetter("tier") + public int tier() { + return tier; + } + + /** + * Gets the value of a particular stat for this crop + * + * Stats: - 0: Chemistry (Industrial uses based on chemical plant + * components) - 1: Consumable (Food, potion ingredients, stuff meant to be + * eaten or similarly used) - 2: Defensive (Plants with defense capabilities + * (damaging, explosive, chemical) or special abilities in general) - 3: + * Colorful (How colorful/aesthetically/beautiful is the plant, like + * dye-plants or plants without actual effects) - 4: Weed (Is this plant + * weed-like and rather unwanted/quick-spreading? Rare super-breed plants + * should have low values here) + * + */ + @Override + @ZenMethod + public int stat(int n) { + return stats[n]; + } + + /** + * Gets any additional attributes of this crop + */ + @Override + @ZenGetter("attributes") + public String[] attributes() { + return attributes; + } + + /** + * Gets the maximum size of this crop + */ + @Override + @ZenGetter("maxSize") + public int maxSize() { + return maxSize; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerSprites(IIconRegister iconRegister) { + textures = new IIcon[maxSize()]; + + for (int i = 1; i <= textures.length; i++) { + textures[i - 1] = iconRegister.registerIcon(owner() + ":crop/crop" + name() + "." + i); + } + } + + @Override + public boolean canGrow(ICropTile crop) { + if (crop.getSize() == maxSize) { + return false; + } else if (reqs == null) { + return true; + } else { + if(!crop.isBlockBelow(MineTweakerMC.getBlock(reqs.getRequiredBlock()))) { + return false; + } else if(crop.getAirQuality() < reqs.getMinAirQuality()){ + return false; + } else if(crop.getHumidity() < reqs.getMinHumidity()) { + return false; + } else if(crop.getNutrients() < reqs.getMinNutrients()) { + return false; + } else { + int lgh = crop.getLightLevel(); + return reqs.getMinLight() < lgh && reqs.getMaxLight() > lgh; + } + } + } + + @Override + public int getOptimalHavestSize(ICropTile crop) { + return maxSize; + } + + @Override + public boolean canBeHarvested(ICropTile crop) { + return crop.getSize() == maxSize; + } + + @Override + public ItemStack getGain(ICropTile crop) { + return MineTweakerMC.getItemStack(fruit); + } + + /** + * Gets the chance for this crop to drop an item + */ + @Override + @ZenGetter("dropChance") + public float dropGainChance() { + return dropChance; + }; + + // ZS Support + + /** + * Sets the tier of this crop + * + * @param tier + * The new tier of this crop + */ + @ZenSetter("tier") + public void setTier(int tier) { + this.tier = tier; + } + + /** + * Sets all of the stats for this crop + * + * @param stats + * The new stats to give to this crop + */ + @ZenSetter("stats") + public void setStats(int[] stats) { + this.stats = stats; + } + + /** + * Sets an individual stat for this crop + * + * @param stat + * The stat to set a value for + * @param val + * The new value for this stat + */ + @ZenMethod + public void setStat(int stat, int val) { + if (stat < 0 || stat > 3) { + MineTweakerAPI.logWarning("invalid stat index " + stat); + } else { + stats[stat] = val; + } + } + + /** + * Sets the additional attributes for this crop + * + * @param attributes + * Sets the attributes of this crop + */ + @ZenSetter("attributes") + public void setAttributes(String[] attributes) { + this.attributes = attributes; + } + + /** + * Sets the maximum size this crop goes to + * + * @param maxSize + * The new max size of this crop + */ + @ZenSetter("maxSize") + public void setMaxSize(int maxSize) { + this.maxSize = maxSize; + } + + /** + * Sets the item this crop gives when harvested + * + * @param fruit + * The item to give from the crop + */ + @ZenSetter("fruit") + public void setFruit(IItemStack fruit) { + this.fruit = fruit; + } + + /** + * Sets the chance for this plant to yield its fruit + * + * @param dropChance + * The new chance for this plant to yield fruit + */ + @ZenSetter("dropChance") + public void setDropChance(int dropChance) { + this.dropChance = dropChance; + } + + /** + * Get the current requirements for this plant to grow + * + * @return The current growth requirements for this plant + */ + public GrowthRequirements getReqs() { + return reqs; + } + + /** + * Set the current growth requirements for this plant to grow + * + * @param reqs + * The new requirements for this plant to grow + */ + public void setReqs(GrowthRequirements reqs) { + this.reqs = reqs; + } + +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/BlastFurnace.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/BlastFurnace.java new file mode 100644 index 0000000..ce6b8a6 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/BlastFurnace.java @@ -0,0 +1,71 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package minetweaker.mods.ic2.machines; + +import ic2.api.recipe.RecipeOutput; +import ic2.api.recipe.Recipes; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import static minetweaker.api.minecraft.MineTweakerMC.getIItemStack; +import static minetweaker.api.minecraft.MineTweakerMC.getItemStack; +import static minetweaker.api.minecraft.MineTweakerMC.getItemStacks; +import minetweaker.mods.ic2.IC2RecipeInput; +import minetweaker.mods.ic2.MachineAddRecipeAction; +import stanhebben.zenscript.annotations.NotNull; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +/** + * Provides access to the IC2 Blast Furnace recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.ic2.BlastFurnace") +@ModOnly("IC2") +public class BlastFurnace { + /** + * Adds a new recipe to the blast furnace. + * + * The recipe input can be any pattern, as long as the stack size is determined. + * The output can be any item stack. + * + * @param output recipe output + * @param ingredient recipe input + */ + @ZenMethod + public static void addRecipe( + @NotNull IItemStack output, + @NotNull IIngredient ingredient) { + if (ingredient.getAmount() < 0) { + MineTweakerAPI.logWarning("invalid ingredient: " + ingredient + " - stack size not known"); + } else { + MineTweakerAPI.apply(new MachineAddRecipeAction( + "blast furnace", + Recipes.blastfurance, + getItemStacks(output), + null, + new IC2RecipeInput(ingredient))); + } + } + + /** + * Determines the recipe output for the given input. Will return the output + * of a single item, even if the stack contains multiple items. + * + * @param input recipe input + * @return recipe output + */ + @ZenMethod + public static IItemStack getOutput( + @NotNull IItemStack input) { + RecipeOutput output = Recipes.blastfurance.getOutputFor(getItemStack(input), false); + if (output == null || output.items.isEmpty()) return null; + return getIItemStack(output.items.get(0)); + } +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/BlockCutter.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/BlockCutter.java new file mode 100644 index 0000000..06231fd --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/BlockCutter.java @@ -0,0 +1,71 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package minetweaker.mods.ic2.machines; + +import ic2.api.recipe.RecipeOutput; +import ic2.api.recipe.Recipes; +import minetweaker.MineTweakerAPI; +import minetweaker.annotations.ModOnly; +import minetweaker.api.item.IIngredient; +import minetweaker.api.item.IItemStack; +import static minetweaker.api.minecraft.MineTweakerMC.getIItemStack; +import static minetweaker.api.minecraft.MineTweakerMC.getItemStack; +import static minetweaker.api.minecraft.MineTweakerMC.getItemStacks; +import minetweaker.mods.ic2.IC2RecipeInput; +import minetweaker.mods.ic2.MachineAddRecipeAction; +import stanhebben.zenscript.annotations.NotNull; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +/** + * Provides access to the IC2 Block Cutter recipes. + * + * @author Stan Hebben + */ +@ZenClass("mods.ic2.BlockCutter") +@ModOnly("IC2") +public class BlockCutter { + /** + * Adds a new recipe to the block cutter. + * + * The recipe input can be any pattern, as long as the stack size is determined. + * The output can be any item stack. + * + * @param output recipe output + * @param ingredient recipe input + */ + @ZenMethod + public static void addRecipe( + @NotNull IItemStack output, + @NotNull IIngredient ingredient) { + if (ingredient.getAmount() < 0) { + MineTweakerAPI.logWarning("invalid ingredient: " + ingredient + " - stack size not known"); + } else { + MineTweakerAPI.apply(new MachineAddRecipeAction( + "block cutter", + Recipes.blockcutter, + getItemStacks(output), + null, + new IC2RecipeInput(ingredient))); + } + } + + /** + * Determines the recipe output for the given input. Will return the output + * of a single item, even if the stack contains multiple items. + * + * @param input recipe input + * @return recipe output + */ + @ZenMethod + public static IItemStack getOutput( + @NotNull IItemStack input) { + RecipeOutput output = Recipes.blockcutter.getOutputFor(getItemStack(input), false); + if (output == null || output.items.isEmpty()) return null; + return getIItemStack(output.items.get(0)); + } +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/FluidHeatGenerator.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/FluidHeatGenerator.java new file mode 100644 index 0000000..e061463 --- /dev/null +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/FluidHeatGenerator.java @@ -0,0 +1,91 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package minetweaker.mods.ic2.machines; + +import ic2.api.recipe.Recipes; +import minetweaker.MineTweakerAPI; +import minetweaker.OneWayAction; +import minetweaker.annotations.ModOnly; +import minetweaker.api.liquid.ILiquidStack; +import net.minecraftforge.fluids.FluidRegistry; +import stanhebben.zenscript.annotations.ZenClass; +import stanhebben.zenscript.annotations.ZenMethod; + +/** + * Add a fluid to the fluid heat generator + * @author Stan + */ +@ZenClass("mods.ic2.FluidHeatGenerator") +@ModOnly("IC2") +public class FluidHeatGenerator { + @ZenMethod + public static void addFluid(ILiquidStack liquidPerTick, int heatPerTick) { + MineTweakerAPI.apply(new AddFluidAction(liquidPerTick.getName(), liquidPerTick.getAmount(), heatPerTick)); + } + + @ZenMethod + public static boolean accepts(ILiquidStack liquid) { + return Recipes.FluidHeatGenerator.acceptsFluid(FluidRegistry.getFluid(liquid.getName())); + } + + private static class AddFluidAction extends OneWayAction { + private final String name; + private final int liquidPerTick; + private final int heatPerTick; + + public AddFluidAction(String name, int liquidPerTick, int heatPerTick) { + this.name = name; + this.liquidPerTick = liquidPerTick; + this.heatPerTick = heatPerTick; + } + + @Override + public void apply() { + Recipes.FluidHeatGenerator.addFluid(name, liquidPerTick, heatPerTick); + } + + @Override + public String describe() { + return "Adding liquid " + name + " as fluid heat generator fuel"; + } + + @Override + public Object getOverrideKey() { + return null; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 47 * hash + (this.name != null ? this.name.hashCode() : 0); + hash = 47 * hash + this.liquidPerTick; + hash = 47 * hash + this.heatPerTick; + return hash; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final AddFluidAction other = (AddFluidAction) obj; + if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) { + return false; + } + if (this.liquidPerTick != other.liquidPerTick) { + return false; + } + if (this.heatPerTick != other.heatPerTick) { + return false; + } + return true; + } + } +} diff --git a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/SemiFluidGenerator.java b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/SemiFluidGenerator.java index c1bfe9f..348713c 100644 --- a/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/SemiFluidGenerator.java +++ b/MineTweaker3-MC1710-Mod-IC2/src/main/java/minetweaker/mods/ic2/machines/SemiFluidGenerator.java @@ -16,7 +16,7 @@ import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod; /** - * + * Add a fluid to the semi-fluid generator * @author Stan */ @ZenClass("mods.ic2.SemiFluidGenerator") diff --git a/MineTweaker3-MC1710-Mod-MFR/build.gradle b/MineTweaker3-MC1710-Mod-MFR/build.gradle index c52bc48..fc9033e 100644 --- a/MineTweaker3-MC1710-Mod-MFR/build.gradle +++ b/MineTweaker3-MC1710-Mod-MFR/build.gradle @@ -30,7 +30,7 @@ dependencies { compile project(':ZenScript') compile project(':MineTweaker3-API') compile project(':MineTweaker3-MC1710-Main') - compile files('libs/MineFactoryReloaded-[1.7.10]2.8.0RC2-557.jar', 'libs/ThermalFoundation-[1.7.10]1.0.0B1-6.jar', 'libs/CoFHCore-[1.7.10]3.0.0B3-26.jar') + compile files('libs/MineFactoryReloaded-[1.7.10]2.8.0-104.jar', 'libs/ThermalFoundation-[1.7.10]1.2.0-102.jar', 'libs/CoFHCore-[1.7.10]3.0.3-303.jar') } task makeRegistry(type: RegisterZenClassesTask) { diff --git a/MineTweaker3-MC1710-Mod-MFR/libs/CoFHCore-[1.7.10]3.0.0B3-26.jar b/MineTweaker3-MC1710-Mod-MFR/libs/CoFHCore-[1.7.10]3.0.0B3-26.jar deleted file mode 100644 index 0b38537..0000000 Binary files a/MineTweaker3-MC1710-Mod-MFR/libs/CoFHCore-[1.7.10]3.0.0B3-26.jar and /dev/null differ diff --git a/MineTweaker3-MC1710-Mod-MFR/libs/CoFHCore-[1.7.10]3.0.3-303.jar b/MineTweaker3-MC1710-Mod-MFR/libs/CoFHCore-[1.7.10]3.0.3-303.jar new file mode 100644 index 0000000..1de6d6e Binary files /dev/null and b/MineTweaker3-MC1710-Mod-MFR/libs/CoFHCore-[1.7.10]3.0.3-303.jar differ diff --git a/MineTweaker3-MC1710-Mod-MFR/libs/MineFactoryReloaded-[1.7.10]2.8.0-104.jar b/MineTweaker3-MC1710-Mod-MFR/libs/MineFactoryReloaded-[1.7.10]2.8.0-104.jar new file mode 100644 index 0000000..19ef285 Binary files /dev/null and b/MineTweaker3-MC1710-Mod-MFR/libs/MineFactoryReloaded-[1.7.10]2.8.0-104.jar differ diff --git a/MineTweaker3-MC1710-Mod-MFR/libs/MineFactoryReloaded-[1.7.10]2.8.0RC2-557.jar b/MineTweaker3-MC1710-Mod-MFR/libs/MineFactoryReloaded-[1.7.10]2.8.0RC2-557.jar deleted file mode 100644 index a16ab58..0000000 Binary files a/MineTweaker3-MC1710-Mod-MFR/libs/MineFactoryReloaded-[1.7.10]2.8.0RC2-557.jar and /dev/null differ diff --git a/MineTweaker3-MC1710-Mod-MFR/libs/ThermalFoundation-[1.7.10]1.0.0B1-6.jar b/MineTweaker3-MC1710-Mod-MFR/libs/ThermalFoundation-[1.7.10]1.0.0B1-6.jar deleted file mode 100644 index 8984612..0000000 Binary files a/MineTweaker3-MC1710-Mod-MFR/libs/ThermalFoundation-[1.7.10]1.0.0B1-6.jar and /dev/null differ diff --git a/MineTweaker3-MC1710-Mod-MFR/libs/ThermalFoundation-[1.7.10]1.2.0-102.jar b/MineTweaker3-MC1710-Mod-MFR/libs/ThermalFoundation-[1.7.10]1.2.0-102.jar new file mode 100644 index 0000000..33d20a5 Binary files /dev/null and b/MineTweaker3-MC1710-Mod-MFR/libs/ThermalFoundation-[1.7.10]1.2.0-102.jar differ diff --git a/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/FertilizableType.java b/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/FertilizableType.java index 0968b36..770d9df 100644 --- a/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/FertilizableType.java +++ b/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/FertilizableType.java @@ -4,7 +4,7 @@ * and open the template in the editor. */ -package stanhebben.minetweaker.mods.mfr; +package minetweaker.mods.mfr; /** * diff --git a/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/PrePlantAction.java b/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/PrePlantAction.java index 0b0ee1e..9b4598a 100644 --- a/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/PrePlantAction.java +++ b/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/PrePlantAction.java @@ -4,7 +4,7 @@ * and open the template in the editor. */ -package stanhebben.minetweaker.mods.mfr; +package minetweaker.mods.mfr; /** * diff --git a/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/machines/Fertilizer.java b/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/machines/Fertilizer.java index 352d0fa..393ca36 100644 --- a/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/machines/Fertilizer.java +++ b/MineTweaker3-MC1710-Mod-MFR/src/main/java/minetweaker/mods/mfr/machines/Fertilizer.java @@ -21,7 +21,7 @@ import powercrystals.minefactoryreloaded.MFRRegistry; import powercrystals.minefactoryreloaded.api.FertilizerType; import powercrystals.minefactoryreloaded.api.IFactoryFertilizable; import powercrystals.minefactoryreloaded.api.IFactoryFertilizer; -import stanhebben.minetweaker.mods.mfr.FertilizableType; +import minetweaker.mods.mfr.FertilizableType; import stanhebben.zenscript.annotations.Optional; import stanhebben.zenscript.annotations.ZenClass; import stanhebben.zenscript.annotations.ZenMethod;