diff --git a/src/main/java/com/blamejared/compat/betterwithmods/util/BMRemove.java b/src/main/java/com/blamejared/compat/betterwithmods/util/BMRemove.java index 9b6f6e4..89c5c3f 100644 --- a/src/main/java/com/blamejared/compat/betterwithmods/util/BMRemove.java +++ b/src/main/java/com/blamejared/compat/betterwithmods/util/BMRemove.java @@ -2,9 +2,13 @@ package com.blamejared.compat.betterwithmods.util; import betterwithmods.common.registry.blockmeta.managers.BlockMetaManager; import betterwithmods.common.registry.blockmeta.recipe.BlockMetaRecipe; +import com.blamejared.mtlib.helpers.LogHelper; import com.blamejared.mtlib.utils.BaseUndoable; +import crafttweaker.api.minecraft.CraftTweakerMC; import net.minecraft.item.ItemStack; +import java.util.*; + public class BMRemove extends BaseUndoable { private final BlockMetaManager recipes; @@ -15,13 +19,20 @@ public class BMRemove extends BaseUndoable { this.recipes = recipes; this.input = input; } - - protected String getRecipeInfo(BlockMetaRecipe recipe) { - return recipe.getStack().getDisplayName(); + + @Override + protected String getRecipeInfo() { + return LogHelper.getStackDescription(input); } - + @Override public void apply() { - recipes.removeRecipes(input); + List removed = new ArrayList<>(); + for(BlockMetaRecipe o : (List) recipes.getRecipes()) { + if(CraftTweakerMC.getIItemStack(input).matches(CraftTweakerMC.getIItemStack(o.getStack()))){ + removed.add(o); + } + } + recipes.getRecipes().removeAll(removed); } } \ No newline at end of file