Added all of the machines to minetweaker. (untested)

This commit is contained in:
modmuss50 2015-08-27 10:22:17 +01:00
parent c8e7e923ed
commit d33c93005d
8 changed files with 965 additions and 0 deletions

View file

@ -0,0 +1,132 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.chemicalReactorRecipe")
public class MTChemicalReactor{
@ZenMethod
public static void addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
if (oInput1 == null)
return;
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
if (oInput2 == null)
return;
ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), ticktime, euTick);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final ChemicalReactorRecipe recipe;
public Add(ChemicalReactorRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding Chemical Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing Chemical Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output)
{
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
List<ChemicalReactorRecipe> removedRecipes;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.chemicalReactorRecipe)){
for(ItemStack stack : recipeType.getOutputs()){
if(ItemUtils.isItemEqual(stack, output, true, false)){
removedRecipes.add((ChemicalReactorRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo()
{
if(removedRecipes!=null){
for(ChemicalReactorRecipe recipe : removedRecipes){
if(recipe!=null){
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe()
{
return "Removing Chemical Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Re-Adding Chemical Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
@Override
public boolean canUndo()
{
return true;
}
}
}

View file

@ -0,0 +1,144 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.liquid.ILiquidStack;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.GrinderRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.grinder")
public class MTGrinder {
@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);
}
@ZenMethod
public static void addRecipe(IItemStack output1 ,IItemStack output2 ,IItemStack output3,IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
if (oInput1 == null)
return;
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
if (oInput2 == null)
return;
FluidStack fluidStack = null;
if(fluid != null){
fluidStack = MinetweakerCompat.toFluidStack(fluid);
}
GrinderRecipe r = new GrinderRecipe(oInput1, oInput2,fluidStack, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final GrinderRecipe recipe;
public Add(GrinderRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding Grinder Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing Grinder Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output)
{
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
List<GrinderRecipe> removedRecipes;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.grinderRecipe)){
for(ItemStack stack : recipeType.getOutputs()){
if(ItemUtils.isItemEqual(stack, output, true, false)){
removedRecipes.add((GrinderRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo()
{
if(removedRecipes!=null){
for(GrinderRecipe recipe : removedRecipes){
if(recipe!=null){
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe()
{
return "Removing Grinder Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Re-Adding Grinder Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
@Override
public boolean canUndo()
{
return true;
}
}
}

View file

@ -0,0 +1,132 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.implosionCompressor")
public class MTImplosionCompressor {
@ZenMethod
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
if (oInput1 == null)
return;
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
if (oInput2 == null)
return;
ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), ticktime, euTick);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final ImplosionCompressorRecipe recipe;
public Add(ImplosionCompressorRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding Implosion Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing Implosion Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output)
{
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
List<ImplosionCompressorRecipe> removedRecipes;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.implosionCompressorRecipe)){
for(ItemStack stack : recipeType.getOutputs()){
if(ItemUtils.isItemEqual(stack, output, true, false)){
removedRecipes.add((ImplosionCompressorRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo()
{
if(removedRecipes!=null){
for(ImplosionCompressorRecipe recipe : removedRecipes){
if(recipe!=null){
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe()
{
return "Removing Implosion Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Re-Adding Implosion Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
@Override
public boolean canUndo()
{
return true;
}
}
}

View file

@ -0,0 +1,132 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.industrialElectrolyzer")
public class MTIndustrialElectrolyzer {
@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);
if (oInput1 == null)
return;
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
if (oInput2 == null)
return;
IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final IndustrialElectrolyzerRecipe recipe;
public Add(IndustrialElectrolyzerRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding IndustrialElectrolyzerRecipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing IndustrialElectrolyzerRecipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output)
{
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
List<IndustrialElectrolyzerRecipe> removedRecipes;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.industrialElectrolyzerRecipe)){
for(ItemStack stack : recipeType.getOutputs()){
if(ItemUtils.isItemEqual(stack, output, true, false)){
removedRecipes.add((IndustrialElectrolyzerRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo()
{
if(removedRecipes!=null){
for(IndustrialElectrolyzerRecipe recipe : removedRecipes){
if(recipe!=null){
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe()
{
return "Removing IndustrialElectrolyzerRecipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Re-Adding IndustrialElectrolyzerRecipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
@Override
public boolean canUndo()
{
return true;
}
}
}

View file

@ -0,0 +1,155 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.liquid.ILiquidStack;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.industrialSawmill")
public class MTIndustrialSawmill {
@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);
}
@ZenMethod
public static void addRecipe(IItemStack output1 ,IItemStack output2 ,IItemStack output3, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
addRecipe(output1, output2, output3, input1, input2, null, ticktime, euTick, true);
}
@ZenMethod
public static void addRecipe(IItemStack output1 ,IItemStack output2 ,IItemStack output3, IIngredient input1, IIngredient input2, int ticktime, int euTick, boolean useOreDic) {
addRecipe(output1, output2, output3, input1, input2, null, ticktime, euTick, useOreDic);
}
@ZenMethod
public static void addRecipe(IItemStack output1 ,IItemStack output2 ,IItemStack output3, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
if (oInput1 == null)
return;
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
if (oInput2 == null)
return;
FluidStack fluidStack = null;
if(fluid != null){
fluidStack = MinetweakerCompat.toFluidStack(fluid);
}
IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, oInput2,fluidStack, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), ticktime, euTick, useOreDic);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final IndustrialSawmillRecipe recipe;
public Add(IndustrialSawmillRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding Sawmill Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing Sawmill Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output)
{
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction
{
private final ItemStack output;
List<IndustrialSawmillRecipe> removedRecipes;
public Remove(ItemStack output)
{
this.output = output;
}
@Override
public void apply()
{
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.industrialSawmillRecipe)){
for(ItemStack stack : recipeType.getOutputs()){
if(ItemUtils.isItemEqual(stack, output, true, false)){
removedRecipes.add((IndustrialSawmillRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo()
{
if(removedRecipes!=null){
for(IndustrialSawmillRecipe recipe : removedRecipes){
if(recipe!=null){
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe()
{
return "Removing Sawmill Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo()
{
return "Re-Adding Sawmill Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey()
{
return null;
}
@Override
public boolean canUndo()
{
return true;
}
}
}

View file

@ -0,0 +1,128 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.LatheRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.lathe")
public class MTLathe {
@ZenMethod
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
if (oInput1 == null)
return;
LatheRecipe r = new LatheRecipe(oInput1, MinetweakerCompat.toStack(output), ticktime, euTick);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final LatheRecipe recipe;
public Add(LatheRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding Lathe Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing Lathe Recipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction {
private final ItemStack output;
List<LatheRecipe> removedRecipes;
public Remove(ItemStack output) {
this.output = output;
}
@Override
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.latheRecipe)) {
for (ItemStack stack : recipeType.getOutputs()) {
if (ItemUtils.isItemEqual(stack, output, true, false)) {
removedRecipes.add((LatheRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo() {
if (removedRecipes != null) {
for (LatheRecipe recipe : removedRecipes) {
if (recipe != null) {
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe() {
return "Removing Lathe Recipe for " + output.getDisplayName();
}
@Override
public String describeUndo() {
return "Re-Adding Lathe Recipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
@Override
public boolean canUndo() {
return true;
}
}
}

View file

@ -0,0 +1,128 @@
package techreborn.compat.minetweaker;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.IBaseRecipeType;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.machines.PlateCuttingMachineRecipe;
import techreborn.lib.Reference;
import techreborn.util.ItemUtils;
import java.util.List;
@ZenClass("mods.techreborn.plateCuttingMachine")
public class MTPlateCuttingMachine {
@ZenMethod
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
if (oInput1 == null)
return;
PlateCuttingMachineRecipe r = new PlateCuttingMachineRecipe(oInput1, MinetweakerCompat.toStack(output), ticktime, euTick);
MineTweakerAPI.apply(new Add(r));
}
private static class Add implements IUndoableAction {
private final PlateCuttingMachineRecipe recipe;
public Add(PlateCuttingMachineRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
RecipeHandler.recipeList.remove(recipe);
}
@Override
public String describe() {
return "Adding PlateCuttingMachineRecipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public String describeUndo() {
return "Removing PlateCuttingMachineRecipe for " + recipe.getOutput(0).getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
}
private static class Remove implements IUndoableAction {
private final ItemStack output;
List<PlateCuttingMachineRecipe> removedRecipes;
public Remove(ItemStack output) {
this.output = output;
}
@Override
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.plateCuttingMachineRecipe)) {
for (ItemStack stack : recipeType.getOutputs()) {
if (ItemUtils.isItemEqual(stack, output, true, false)) {
removedRecipes.add((PlateCuttingMachineRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public void undo() {
if (removedRecipes != null) {
for (PlateCuttingMachineRecipe recipe : removedRecipes) {
if (recipe != null) {
RecipeHandler.addRecipe(recipe);
}
}
}
}
@Override
public String describe() {
return "Removing PlateCuttingMachineRecipe for " + output.getDisplayName();
}
@Override
public String describeUndo() {
return "Re-Adding PlateCuttingMachineRecipe for " + output.getDisplayName();
}
@Override
public Object getOverrideKey() {
return null;
}
@Override
public boolean canUndo() {
return true;
}
}
}

View file

@ -9,11 +9,14 @@ import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import minetweaker.api.item.IngredientStack;
import minetweaker.api.liquid.ILiquidStack;
import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import techreborn.compat.ICompatModule;
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
import static minetweaker.api.minecraft.MineTweakerMC.getLiquidStack;
public class MinetweakerCompat implements ICompatModule {
@ -33,6 +36,13 @@ public class MinetweakerCompat implements ICompatModule {
MineTweakerAPI.registerClass(MTAssemblingMachine.class);
MineTweakerAPI.registerClass(MTBlastFurnace.class);
MineTweakerAPI.registerClass(MTCentrifuge.class);
MineTweakerAPI.registerClass(MTChemicalReactor.class);
MineTweakerAPI.registerClass(MTGrinder.class);
MineTweakerAPI.registerClass(MTImplosionCompressor.class);
MineTweakerAPI.registerClass(MTIndustrialElectrolyzer.class);
MineTweakerAPI.registerClass(MTIndustrialSawmill.class);
MineTweakerAPI.registerClass(MTLathe.class);
MineTweakerAPI.registerClass(MTPlateCuttingMachine.class);
}
@Override
@ -59,5 +69,9 @@ public class MinetweakerCompat implements ICompatModule {
return null;
}
}
public static FluidStack toFluidStack(ILiquidStack iStack)
{
return getLiquidStack(iStack);
}
}