Revert "fixes #219 again"

This reverts commit d562e1222a.
This commit is contained in:
Modmuss50 2015-11-13 08:26:51 +00:00
parent 2331e3c35d
commit a7001bbfd7
10 changed files with 86 additions and 76 deletions

View file

@ -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