package org.cyclops.cyclopscore.recipe.xml;

import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.oredict.OreIngredient;
import org.cyclops.cyclopscore.init.RecipeHandler;

/**
 * Item type handler for ore dictionary keys.
 * @author rubensworks
 */
public class OreDictItemTypeHandler extends DefaultItemTypeHandler {

	@Override
	protected Ingredient makeIngredient(RecipeHandler recipeHandler, String key, int amount, int meta, boolean nbtSensitive) {
        if (nbtSensitive) {
            throw new IllegalArgumentException("NBT-sensitivity can not be defined on oredict ingredients: " + key);
        }
        return new OreIngredient(key);
    }
	
}

@@ -38,16 +38,53 @@
 e.xml;%0A%0A
+import net.minecraft.item.ItemStack;%0A
 import n
@@ -118,24 +118,24 @@
 Ingredient;%0A
-
 import net.m
@@ -223,16 +223,75 @@
 ndler;%0A%0A
+import javax.annotation.Nonnull;%0Aimport java.util.Arrays;%0A%0A
 /**%0A * I
@@ -719,16 +719,16 @@
       %7D%0A
-
         
@@ -752,24 +752,513 @@
 redient(key)
+ %7B%0A            @Nonnull%0A            @Override%0A            public ItemStack%5B%5D getMatchingStacks() %7B%0A                if (amount %3E 0) %7B%0A                    return Arrays.stream(super.getMatchingStacks()).map(stack -%3E %7B%0A                        stack = stack.copy();%0A                        stack.setCount(amount);%0A                        return stack;%0A                    %7D).toArray(ItemStack%5B%5D::new);%0A                %7D%0A                return super.getMatchingStacks();%0A            %7D%0A        %7D
 ;%0A    %7D%0A%09%0A%7D%0A

Fix XML recipe oredict ingredients not adhering to stacksizes