// Path: src/main/java/cn/mccraft/chinacraft/init/CCCapabilities.java
// public interface CCCapabilities {
//     @RegCapability(storageClass = CapabilityCrusherStats.Storage.class, implClass = CapabilityCrusherStats.Implementation.class)
//     @CapabilityInject(CrusherStats.class)
//     Capability<CrusherStats> CRUSHER_STATS_CAPABILITY = null;
// 
//     @RegCapability(storageClass = CapabilityColor.Storage.class, implClass = CapabilityColor.Implementation.class)
//     @CapabilityInject(ItemStackColorable.class)
//     Capability<ItemStackColorable> ITEM_STACK_COLORABLE_CAPABILITY = null;
// 
//     @RegCapability(storageClass = CapabilitySilkworm.Storage.class, implClass = CapabilitySilkworm.Implementation.class)
//     @CapabilityInject(Silkworm.class)
//     Capability<Silkworm> SILKWORM_CAPABILITY = null;
// }
// 
// Path: src/main/java/cn/mccraft/chinacraft/item/ItemCCSilk.java
// public class ItemCCSilk extends ItemCCBase {
//     public ItemCCSilk() {
//         setCreativeTab(CCCreativeTabs.tabSilkworm);
//     }
// 
//     @Override
//     public void addInformation(ItemStack stack, EntityPlayer worldIn, List<String> tooltip, boolean flagIn) {
//         tooltip.add(I18n.format("item.silk.lore", stack.getCapability(CCCapabilities.ITEM_STACK_COLORABLE_CAPABILITY, null).getColor()));
//     }
// 
//     @Override
//     public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
//         try {
//             for (EnumDyeColor color : EnumDyeColor.values()) {
//                 ItemStack stack = new ItemStack(item);
//                 stack.getCapability(CCCapabilities.ITEM_STACK_COLORABLE_CAPABILITY, null).setColor(color.func_176768_e().colorValue);
//                 stacks.add(stack);
//             }
//         } catch (Exception e) {
//             e.printStackTrace();
//         }
//     }
// }


import cn.mccraft.chinacraft.init.CCCapabilities;
import cn.mccraft.chinacraft.item.ItemCCSilk;
import com.google.common.collect.Lists;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import java.util.List;
            } else {
                if (itemstack1.getItem() != Items.DYE)
                    return false;
                list.add(itemstack1);
            }
        }

        return !itemstack.isEmpty() && !list.isEmpty();
    }

    @Override
    public ItemStack getCraftingResult(InventoryCrafting inv) {
        ItemStack itemstack = ItemStack.EMPTY;
        int[] aint = new int[3];
        int i = 0;
        int j = 0;
        ItemCCSilk itemsilk = null;

        for (int k = 0; k < inv.getSizeInventory(); ++k) {
            ItemStack itemstack1 = inv.getStackInSlot(k);

            if (!itemstack1.isEmpty()) if (itemstack1.getItem() instanceof ItemCCSilk) {
                itemsilk = (ItemCCSilk) itemstack1.getItem();

                if (!itemstack.isEmpty())
                    return ItemStack.EMPTY;

                itemstack = itemstack1.copy();
                itemstack.setCount(1);

// Path: src/main/java/cn/mccraft/chinacraft/init/CCCapabilities.java
// public interface CCCapabilities {
//     @RegCapability(storageClass = CapabilityCrusherStats.Storage.class, implClass = CapabilityCrusherStats.Implementation.class)
//     @CapabilityInject(CrusherStats.class)
//     Capability<CrusherStats> CRUSHER_STATS_CAPABILITY = null;
// 
//     @RegCapability(storageClass = CapabilityColor.Storage.class, implClass = CapabilityColor.Implementation.class)
//     @CapabilityInject(ItemStackColorable.class)
//     Capability<ItemStackColorable> ITEM_STACK_COLORABLE_CAPABILITY = null;
// 
//     @RegCapability(storageClass = CapabilitySilkworm.Storage.class, implClass = CapabilitySilkworm.Implementation.class)
//     @CapabilityInject(Silkworm.class)
//     Capability<Silkworm> SILKWORM_CAPABILITY = null;
// }
// 
// Path: src/main/java/cn/mccraft/chinacraft/item/ItemCCSilk.java
// public class ItemCCSilk extends ItemCCBase {
//     public ItemCCSilk() {
//         setCreativeTab(CCCreativeTabs.tabSilkworm);
//     }
// 
//     @Override
//     public void addInformation(ItemStack stack, EntityPlayer worldIn, List<String> tooltip, boolean flagIn) {
//         tooltip.add(I18n.format("item.silk.lore", stack.getCapability(CCCapabilities.ITEM_STACK_COLORABLE_CAPABILITY, null).getColor()));
//     }
// 
//     @Override
//     public void getSubItems(@Nonnull Item item, CreativeTabs tab, NonNullList<ItemStack> stacks) {
//         try {
//             for (EnumDyeColor color : EnumDyeColor.values()) {
//                 ItemStack stack = new ItemStack(item);
//                 stack.getCapability(CCCapabilities.ITEM_STACK_COLORABLE_CAPABILITY, null).setColor(color.func_176768_e().colorValue);
//                 stacks.add(stack);
//             }
//         } catch (Exception e) {
//             e.printStackTrace();
//         }
//     }
// }


// Path: src/main/java/cn/mccraft/chinacraft/item/crafting/RecipesSilkDyes.java
import cn.mccraft.chinacraft.init.CCCapabilities;
import cn.mccraft.chinacraft.item.ItemCCSilk;
import com.google.common.collect.Lists;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import java.util.List;

            } else {
                if (itemstack1.getItem() != Items.DYE)
                    return false;
                list.add(itemstack1);
            }
        }

        return !itemstack.isEmpty() && !list.isEmpty();
    }

    @Override
    public ItemStack getCraftingResult(InventoryCrafting inv) {
        ItemStack itemstack = ItemStack.EMPTY;
        int[] aint = new int[3];
        int i = 0;
        int j = 0;
        ItemCCSilk itemsilk = null;

        for (int k = 0; k < inv.getSizeInventory(); ++k) {
            ItemStack itemstack1 = inv.getStackInSlot(k);

            if (!itemstack1.isEmpty()) if (itemstack1.getItem() instanceof ItemCCSilk) {
                itemsilk = (ItemCCSilk) itemstack1.getItem();

                if (!itemstack.isEmpty())
                    return ItemStack.EMPTY;

                itemstack = itemstack1.copy();
                itemstack.setCount(1);

                int l = itemstack1.getCapability(CCCapabilities.ITEM_STACK_COLORABLE_CAPABILITY, null).getColor();