fixes #219 again
This commit is contained in:
parent
c2dcaf1902
commit
d562e1222a
10 changed files with 76 additions and 86 deletions
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -74,16 +75,14 @@ public class MTAlloySmelter {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<AlloySmelterRecipe> removedRecipes = new ArrayList<AlloySmelterRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -91,7 +90,7 @@ public class MTAlloySmelter {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if(output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((AlloySmelterRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -114,12 +113,12 @@ public class MTAlloySmelter {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Alloy Smelter Recipe for " + output.getDisplayName();
|
||||
return "Removing Alloy Smelter Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Alloy Smelter Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Alloy Smelter Recipe for ";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -69,16 +70,14 @@ public class MTAssemblingMachine {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<AssemblingMachineRecipe> removedRecipes = new ArrayList<AssemblingMachineRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -86,7 +85,7 @@ public class MTAssemblingMachine {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.assemblingMachineRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((AssemblingMachineRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -109,12 +108,12 @@ public class MTAssemblingMachine {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Assembling Machine Recipe for " + output.getDisplayName();
|
||||
return "Removing Assembling Machine Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Assembling Machine Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Assembling Machine Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -68,16 +69,14 @@ public class MTBlastFurnace {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<BlastFurnaceRecipe> removedRecipes = new ArrayList<BlastFurnaceRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,7 @@ public class MTBlastFurnace {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.blastFurnaceRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((BlastFurnaceRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -108,12 +107,12 @@ public class MTBlastFurnace {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Blast Furnace Recipe for " + output.getDisplayName();
|
||||
return "Removing Blast Furnace Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Blast Furnace Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Blast Furnace Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -68,23 +69,21 @@ public class MTCentrifuge {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new RemoveInput(MinetweakerCompat.toStack(itemStack)));
|
||||
MineTweakerAPI.apply(new RemoveInput(output));
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveInput implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<CentrifugeRecipe> removedRecipes = new ArrayList<CentrifugeRecipe>();
|
||||
|
||||
public RemoveInput(ItemStack output) {
|
||||
public RemoveInput(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -92,7 +91,7 @@ public class MTCentrifuge {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.centrifugeRecipe)) {
|
||||
for (ItemStack stack : recipeType.getInputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((CentrifugeRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -115,12 +114,12 @@ public class MTCentrifuge {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Centrifuge Recipe for " + output.getDisplayName();
|
||||
return "Removing Centrifuge Recipe for";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Centrifuge Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Centrifuge Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,10 +134,10 @@ public class MTCentrifuge {
|
|||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<CentrifugeRecipe> removedRecipes = new ArrayList<CentrifugeRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -146,7 +145,7 @@ public class MTCentrifuge {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.centrifugeRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((CentrifugeRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -169,12 +168,12 @@ public class MTCentrifuge {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Centrifuge Recipe for " + output.getDisplayName();
|
||||
return "Removing Centrifuge Recipe for ";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Centrifuge Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Centrifuge Recipe for ";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -68,16 +69,14 @@ public class MTChemicalReactor {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<ChemicalReactorRecipe> removedRecipes = new ArrayList<ChemicalReactorRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,7 @@ public class MTChemicalReactor {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.chemicalReactorRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((ChemicalReactorRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -108,12 +107,12 @@ public class MTChemicalReactor {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Chemical Recipe for " + output.getDisplayName();
|
||||
return "Removing Chemical Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Chemical Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Chemical Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ 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 reborncore.common.util.ItemUtils;
|
||||
|
@ -81,16 +82,14 @@ public class MTGrinder {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<GrinderRecipe> removedRecipes = new ArrayList<GrinderRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -98,7 +97,7 @@ public class MTGrinder {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.grinderRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((GrinderRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -121,12 +120,12 @@ public class MTGrinder {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Grinder Recipe for " + output.getDisplayName();
|
||||
return "Removing Grinder Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Grinder Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Grinder Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -69,16 +70,14 @@ public class MTImplosionCompressor {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<ImplosionCompressorRecipe> removedRecipes = new ArrayList<ImplosionCompressorRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -86,7 +85,7 @@ public class MTImplosionCompressor {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.implosionCompressorRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((ImplosionCompressorRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -109,12 +108,12 @@ public class MTImplosionCompressor {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Implosion Recipe for " + output.getDisplayName();
|
||||
return "Removing Implosion Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Implosion Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Implosion Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -68,16 +69,14 @@ public class MTIndustrialElectrolyzer {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<IndustrialElectrolyzerRecipe> removedRecipes = new ArrayList<IndustrialElectrolyzerRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -85,7 +84,7 @@ public class MTIndustrialElectrolyzer {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.industrialElectrolyzerRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((IndustrialElectrolyzerRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -108,12 +107,12 @@ public class MTIndustrialElectrolyzer {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing IndustrialElectrolyzerRecipe for " + output.getDisplayName();
|
||||
return "Removing IndustrialElectrolyzerRecipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding IndustrialElectrolyzerRecipe for " + output.getDisplayName();
|
||||
return "Re-Adding IndustrialElectrolyzerRecipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,6 +5,7 @@ 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 reborncore.common.util.ItemUtils;
|
||||
|
@ -92,16 +93,14 @@ public class MTIndustrialSawmill {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<IndustrialSawmillRecipe> removedRecipes = new ArrayList<IndustrialSawmillRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -109,7 +108,7 @@ public class MTIndustrialSawmill {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.industrialSawmillRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((IndustrialSawmillRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -132,12 +131,12 @@ public class MTIndustrialSawmill {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Sawmill Recipe for " + output.getDisplayName();
|
||||
return "Removing Sawmill Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Sawmill Recipe for " + output.getDisplayName();
|
||||
return "Re-Adding Sawmill Recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ 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.ZenClass;
|
||||
|
@ -67,16 +68,14 @@ public class MTPlateCuttingMachine {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IIngredient output) {
|
||||
for(IItemStack itemStack : output.getItems()){
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(itemStack)));
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(output));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
private final ItemStack output;
|
||||
private final IIngredient output;
|
||||
List<PlateCuttingMachineRecipe> removedRecipes = new ArrayList<PlateCuttingMachineRecipe>();
|
||||
|
||||
public Remove(ItemStack output) {
|
||||
public Remove(IIngredient output) {
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
|
@ -84,7 +83,7 @@ public class MTPlateCuttingMachine {
|
|||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.plateCuttingMachineRecipe)) {
|
||||
for (ItemStack stack : recipeType.getOutputs()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((PlateCuttingMachineRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
|
@ -107,12 +106,12 @@ public class MTPlateCuttingMachine {
|
|||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing PlateCuttingMachineRecipe for " + output.getDisplayName();
|
||||
return "Removing PlateCuttingMachineRecipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding PlateCuttingMachineRecipe for " + output.getDisplayName();
|
||||
return "Re-Adding PlateCuttingMachineRecipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue