Fixes #219
This commit is contained in:
parent
f2e41cf360
commit
d928472d84
13 changed files with 152 additions and 51 deletions
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -25,8 +26,18 @@ public class MTAlloySmelter extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.alloySmelteRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -12,6 +13,7 @@ import techreborn.lib.Reference;
|
|||
@ZenClass("mods.techreborn.assemblingMachine")
|
||||
public class MTAssemblingMachine extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
@ -22,8 +24,17 @@ public class MTAssemblingMachine extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.assemblingMachineRecipe;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -10,6 +11,7 @@ import techreborn.lib.Reference;
|
|||
|
||||
@ZenClass("mods.techreborn.blastFurnace")
|
||||
public class MTBlastFurnace extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
@ -20,8 +22,17 @@ public class MTBlastFurnace extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.blastFurnaceRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -9,7 +10,8 @@ import techreborn.api.recipe.machines.CentrifugeRecipe;
|
|||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.centrifuge")
|
||||
public class MTCentrifuge extends MTGeneric{
|
||||
public class MTCentrifuge extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
@ -20,8 +22,17 @@ public class MTCentrifuge extends MTGeneric{
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.centrifugeRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -9,7 +10,8 @@ import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
|||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.chemicalReactorRecipe")
|
||||
public class MTChemicalReactor extends MTGeneric{
|
||||
public class MTChemicalReactor extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
@ -20,8 +22,17 @@ public class MTChemicalReactor extends MTGeneric{
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.chemicalReactorRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import stanhebben.zenscript.annotations.ZenMethod;
|
|||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,7 +19,7 @@ import java.util.List;
|
|||
public class MTFusionReactor {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime){
|
||||
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
|
||||
FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) MinetweakerCompat.toObject(topInput), (ItemStack) MinetweakerCompat.toObject(bottomInput), MinetweakerCompat.toStack(output), startEU, euTick, tickTime);
|
||||
MineTweakerAPI.apply(new Add(reactorRecipe));
|
||||
}
|
||||
|
|
|
@ -3,11 +3,9 @@ package techreborn.compat.minetweaker;
|
|||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
|
@ -16,26 +14,14 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
public class MTGeneric {
|
||||
|
||||
static MTGeneric instance;
|
||||
|
||||
public String getMachineName(){
|
||||
public static String getMachineName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public MTGeneric() {
|
||||
instance = new MTGeneric();
|
||||
}
|
||||
|
||||
public static void addRecipe(BaseRecipe recipe){
|
||||
public static void addRecipe(BaseRecipe recipe) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, instance.getMachineName()));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
private final BaseRecipe recipe;
|
||||
|
||||
|
@ -74,12 +60,7 @@ public class MTGeneric {
|
|||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), instance.getMachineName()));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
public static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
@ -121,7 +102,7 @@ public class MTGeneric {
|
|||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding " + name +" recipe for " + output.getDisplayName();
|
||||
return "Re-Adding " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,7 +117,7 @@ public class MTGeneric {
|
|||
}
|
||||
|
||||
|
||||
private static class RemoveInput implements IUndoableAction {
|
||||
public static class RemoveInput implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
@ -178,7 +159,7 @@ public class MTGeneric {
|
|||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding " + name +" recipe";
|
||||
return "Re-Adding " + name + " recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
|
@ -12,6 +13,8 @@ import techreborn.lib.Reference;
|
|||
|
||||
@ZenClass("mods.techreborn.grinder")
|
||||
public class MTGrinder extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
|
||||
|
@ -33,8 +36,17 @@ public class MTGrinder extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.grinderRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -10,6 +11,7 @@ import techreborn.lib.Reference;
|
|||
|
||||
@ZenClass("mods.techreborn.implosionCompressor")
|
||||
public class MTImplosionCompressor extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
@ -21,8 +23,17 @@ public class MTImplosionCompressor extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.implosionCompressorRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -10,6 +11,8 @@ import techreborn.lib.Reference;
|
|||
|
||||
@ZenClass("mods.techreborn.industrialElectrolyzer")
|
||||
public class MTIndustrialElectrolyzer extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(cells);
|
||||
|
@ -20,8 +23,17 @@ public class MTIndustrialElectrolyzer extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialElectrolyzerRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
|
@ -13,6 +14,7 @@ import techreborn.lib.Reference;
|
|||
@ZenClass("mods.techreborn.industrialSawmill")
|
||||
public class MTIndustrialSawmill extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, input1, input2, fluid, ticktime, euTick, true);
|
||||
|
@ -44,8 +46,17 @@ public class MTIndustrialSawmill extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialSawmillRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -19,8 +20,17 @@ public class MTPlateCuttingMachine extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.plateCuttingMachineRecipe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -19,8 +20,17 @@ public class MTVacuumFreezer extends MTGeneric {
|
|||
addRecipe(r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.vacuumFreezerRecipe;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue