parent
2331e3c35d
commit
a7001bbfd7
10 changed files with 86 additions and 76 deletions
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -74,14 +73,16 @@ public class MTAlloySmelter {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<AlloySmelterRecipe> removedRecipes = new ArrayList<AlloySmelterRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -89,7 +90,7 @@ public class MTAlloySmelter {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if(output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((AlloySmelterRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -112,12 +113,12 @@ public class MTAlloySmelter {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Alloy Smelter Recipe";
|
||||
return "Removing Alloy Smelter Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Alloy Smelter Recipe for ";
|
||||
return "Re-Adding Alloy Smelter Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -69,14 +68,16 @@ public class MTAssemblingMachine {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<AssemblingMachineRecipe> removedRecipes = new ArrayList<AssemblingMachineRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -84,7 +85,7 @@ public class MTAssemblingMachine {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.assemblingMachineRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((AssemblingMachineRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -107,12 +108,12 @@ public class MTAssemblingMachine {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Assembling Machine Recipe";
|
||||
return "Removing Assembling Machine Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Assembling Machine Recipe";
|
||||
return "Re-Adding Assembling Machine Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -68,14 +67,16 @@ public class MTBlastFurnace {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<BlastFurnaceRecipe> removedRecipes = new ArrayList<BlastFurnaceRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -83,7 +84,7 @@ public class MTBlastFurnace {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.blastFurnaceRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((BlastFurnaceRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -106,12 +107,12 @@ public class MTBlastFurnace {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Blast Furnace Recipe";
|
||||
return "Removing Blast Furnace Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Blast Furnace Recipe";
|
||||
return "Re-Adding Blast Furnace Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -68,21 +67,23 @@ public class MTCentrifuge {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new RemoveInput(output));
|
||||
MineTweakerAPI.apply(new RemoveInput(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveInput implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<CentrifugeRecipe> removedRecipes = new ArrayList<CentrifugeRecipe>();
|
||||
|
||||
public RemoveInput(IIngredient output) {
|
||||
public RemoveInput(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -90,7 +91,7 @@ public class MTCentrifuge {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.centrifugeRecipe)) {
|
||||
for (ItemStack stack : recipeType.getInputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((CentrifugeRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -113,12 +114,12 @@ public class MTCentrifuge {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Centrifuge Recipe for";
|
||||
return "Removing Centrifuge Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Centrifuge Recipe";
|
||||
return "Re-Adding Centrifuge Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -133,10 +134,10 @@ public class MTCentrifuge {
|
|||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<CentrifugeRecipe> removedRecipes = new ArrayList<CentrifugeRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -144,7 +145,7 @@ public class MTCentrifuge {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.centrifugeRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((CentrifugeRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -167,12 +168,12 @@ public class MTCentrifuge {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Centrifuge Recipe for ";
|
||||
return "Removing Centrifuge Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Centrifuge Recipe for ";
|
||||
return "Re-Adding Centrifuge Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -68,14 +67,16 @@ public class MTChemicalReactor {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<ChemicalReactorRecipe> removedRecipes = new ArrayList<ChemicalReactorRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -83,7 +84,7 @@ public class MTChemicalReactor {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.chemicalReactorRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((ChemicalReactorRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -106,12 +107,12 @@ public class MTChemicalReactor {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Chemical Recipe";
|
||||
return "Removing Chemical Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Chemical Recipe";
|
||||
return "Re-Adding Chemical Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,7 +5,6 @@ import minetweaker.MineTweakerAPI;
|
|||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
@ -81,14 +80,16 @@ public class MTGrinder {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<GrinderRecipe> removedRecipes = new ArrayList<GrinderRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -96,7 +97,7 @@ public class MTGrinder {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.grinderRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((GrinderRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -119,12 +120,12 @@ public class MTGrinder {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Grinder Recipe";
|
||||
return "Removing Grinder Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Grinder Recipe";
|
||||
return "Re-Adding Grinder Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -69,14 +68,16 @@ public class MTImplosionCompressor {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<ImplosionCompressorRecipe> removedRecipes = new ArrayList<ImplosionCompressorRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -84,7 +85,7 @@ public class MTImplosionCompressor {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.implosionCompressorRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((ImplosionCompressorRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -107,12 +108,12 @@ public class MTImplosionCompressor {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Implosion Recipe";
|
||||
return "Removing Implosion Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Implosion Recipe";
|
||||
return "Re-Adding Implosion Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -68,14 +67,16 @@ public class MTIndustrialElectrolyzer {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<IndustrialElectrolyzerRecipe> removedRecipes = new ArrayList<IndustrialElectrolyzerRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -83,7 +84,7 @@ public class MTIndustrialElectrolyzer {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.industrialElectrolyzerRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((IndustrialElectrolyzerRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -106,12 +107,12 @@ public class MTIndustrialElectrolyzer {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing IndustrialElectrolyzerRecipe";
|
||||
return "Removing IndustrialElectrolyzerRecipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding IndustrialElectrolyzerRecipe";
|
||||
return "Re-Adding IndustrialElectrolyzerRecipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,7 +5,6 @@ import minetweaker.MineTweakerAPI;
|
|||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
@ -92,14 +91,16 @@ public class MTIndustrialSawmill {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<IndustrialSawmillRecipe> removedRecipes = new ArrayList<IndustrialSawmillRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -107,7 +108,7 @@ public class MTIndustrialSawmill {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.industrialSawmillRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((IndustrialSawmillRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -130,12 +131,12 @@ public class MTIndustrialSawmill {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Sawmill Recipe";
|
||||
return "Removing Sawmill Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Sawmill Recipe";
|
||||
return "Re-Adding Sawmill Recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,7 +4,6 @@ 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 stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
@ -67,14 +66,16 @@ public class MTPlateCuttingMachine {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
private final ItemStack output;
|
||||
List<PlateCuttingMachineRecipe> removedRecipes = new ArrayList<PlateCuttingMachineRecipe>();
|
||||
|
||||
public Remove(IIngredient output) {
|
||||
public Remove(ItemStack output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -82,7 +83,7 @@ public class MTPlateCuttingMachine {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.plateCuttingMachineRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((PlateCuttingMachineRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -105,12 +106,12 @@ public class MTPlateCuttingMachine {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing PlateCuttingMachineRecipe";
|
||||
return "Removing PlateCuttingMachineRecipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding PlateCuttingMachineRecipe";
|
||||
return "Re-Adding PlateCuttingMachineRecipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue