<commit_before>package com.blamejared.compat.betterwithmods.util;

import betterwithmods.common.registry.blockmeta.managers.BlockMetaManager;
import betterwithmods.common.registry.blockmeta.recipe.BlockMetaRecipe;
import com.blamejared.mtlib.utils.BaseUndoable;
import net.minecraft.item.ItemStack;

public class BMRemove extends BaseUndoable {

    private final BlockMetaManager recipes;
    private final ItemStack input;

    public BMRemove(String name, BlockMetaManager recipes, ItemStack input) {
        super(name);
        this.recipes = recipes;
        this.input = input;
    }

    protected String getRecipeInfo(BlockMetaRecipe recipe) {
        return recipe.getStack().getDisplayName();
    }

    @Override
    public void apply() {
        recipes.removeRecipes(input);
    }
}<commit_msg>Fixed BWM removal. Closes #542<commit_after>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;
    private final ItemStack input;

    public BMRemove(String name, BlockMetaManager recipes, ItemStack input) {
        super(name);
        this.recipes = recipes;
        this.input = input;
    }
    
    @Override
    protected String getRecipeInfo() {
        return LogHelper.getStackDescription(input);
    }
    
    @Override
    public void apply() {
        List<BlockMetaRecipe> removed = new ArrayList<>();
        for(BlockMetaRecipe o : (List<BlockMetaRecipe>) recipes.getRecipes()) {
            if(CraftTweakerMC.getIItemStack(input).matches(CraftTweakerMC.getIItemStack(o.getStack()))){
                removed.add(o);
            }
        }
        recipes.getRecipes().removeAll(removed);
    }
}
{'fraction_non_alphanumeric': 0.09302325581395349, 'fraction_numerical': 0.0014534883720930232, 'mean_word_length': 3.640449438202247, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7060496', 'n_tokens_mistral': 618, 'n_tokens_neox': 621, 'n_words': 112}