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

import betterwithmods.common.registry.blockmeta.managers.TurntableManager;
import betterwithmods.common.registry.blockmeta.recipe.TurntableRecipe;
import betterwithmods.module.compat.jei.category.TurntableRecipeCategory;
import com.blamejared.ModTweaker;
import com.blamejared.compat.betterwithmods.util.BMAdd;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.BaseListRemoval;
import com.google.common.collect.Lists;
import crafttweaker.annotations.*;
import crafttweaker.api.item.IItemStack;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.*;

import java.util.*;


@ZenClass("mods.betterwithmods.Turntable")
@ModOnly("betterwithmods")
@ZenRegister
public class Turntable {
    
    @ZenMethod
    public static void add(IItemStack inputBlock, IItemStack outputBlock, IItemStack[] additionalOutput) {
        if(!InputHelper.isABlock(inputBlock))
            LogHelper.logError("Input must be a block", new IllegalArgumentException());
        ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(inputBlock), InputHelper.toStack(outputBlock), Lists.newArrayList(InputHelper.toStacks(additionalOutput))));
    }
    
    public static class Add extends BMAdd {
        
        public Add(ItemStack input, ItemStack output, List<ItemStack> scraps) {
            super(TurntableRecipeCategory.UID, TurntableManager.INSTANCE, Lists.newArrayList(new TurntableRecipe(input, output, scraps)));
        }
    }
    
    @ZenMethod
    public static void remove(IItemStack inputBlock) {
        if(!InputHelper.isABlock(inputBlock))
            LogHelper.logError("Input must be a block", new IllegalArgumentException());
        ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(inputBlock)));
    }
    
    public static class Remove extends BaseListRemoval<TurntableRecipe> {
        
        private ItemStack input;
        
        protected Remove(ItemStack input) {
            super("Remove Turntable Recipe", Collections.emptyList());
            this.input = input;
        }
    
    
        @Override
        public void apply() {
            for(TurntableRecipe recipe : TurntableManager.INSTANCE.getRecipes()) {
                if(InputHelper.toIItemStack(input).matches(InputHelper.toIItemStack(recipe.getStack()))){
                    successful.add(recipe);
                }
            }
            System.out.println(">>>" + successful);
            for(TurntableRecipe recipe : successful) {<commit_msg>Added support for Turntable to output nothing (Closes #601)<commit_after>package com.blamejared.compat.betterwithmods;

import betterwithmods.common.registry.blockmeta.managers.TurntableManager;
import betterwithmods.common.registry.blockmeta.recipe.TurntableRecipe;
import betterwithmods.module.compat.jei.category.TurntableRecipeCategory;
import com.blamejared.ModTweaker;
import com.blamejared.compat.betterwithmods.util.BMAdd;
import com.blamejared.mtlib.helpers.*;
import com.blamejared.mtlib.utils.BaseListRemoval;
import com.google.common.collect.Lists;
import crafttweaker.annotations.*;
import crafttweaker.api.item.IItemStack;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.*;

import java.util.*;


@ZenClass("mods.betterwithmods.Turntable")
@ModOnly("betterwithmods")
@ZenRegister
public class Turntable {
    
    @ZenMethod
    public static void add(IItemStack inputBlock, IItemStack outputBlock, IItemStack[] additionalOutput) {
        if(!InputHelper.isABlock(inputBlock))
            LogHelper.logError("Input must be a block", new IllegalArgumentException());
        ModTweaker.LATE_ADDITIONS.add(new Add(InputHelper.toStack(inputBlock), InputHelper.toStack(outputBlock), Lists.newArrayList(InputHelper.toStacks(additionalOutput))));
    }
    
    public static class Add extends BMAdd {
        
        public Add(ItemStack input, ItemStack output, List<ItemStack> scraps) {
            super(TurntableRecipeCategory.UID, TurntableManager.INSTANCE, Lists.newArrayList(new TurntableRecipe(Block.getBlockFromItem(input.getItem()), input.getMetadata(), output.isEmpty() ? null : Block.getBlockFromItem(output.getItem()), output.isEmpty() ? 0 : output.getMetadata(), scraps)));
        }
    }
    
    @ZenMethod
    public static void remove(IItemStack inputBlock) {
        if(!InputHelper.isABlock(inputBlock))
            LogHelper.logError("Input must be a block", new IllegalArgumentException());
        ModTweaker.LATE_REMOVALS.add(new Remove(InputHelper.toStack(inputBlock)));
    }
    
    public static class Remove extends BaseListRemoval<TurntableRecipe> {
        
        private ItemStack input;
        
        protected Remove(ItemStack input) {
            super("Remove Turntable Recipe", Collections.emptyList());
            this.input = input;
        }
        
        
        @Override
        public void apply() {
            for(TurntableRecipe recipe : TurntableManager.INSTANCE.getRecipes()) {
                if(InputHelper.toIItemStack(input).matches(InputHelper.toIItemStack(recipe.getStack()))) {
                    successful.add(recipe);
                }
            }
            System.out.println(">>>" + successful);
            for(TurntableRecipe recipe : successful) {
{'fraction_non_alphanumeric': 0.10102707749766573, 'fraction_numerical': 0.0007469654528478057, 'mean_word_length': 3.5582978723404257, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '2496700', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1534, 'n_words': 262}