// Path: src/main/java/com/gmail/jannyboy11/customrecipes/api/furnace/FurnaceRecipe.java
// public interface FurnaceRecipe extends Recipe, Keyed, ConfigurationSerializable, Representable {
// 
//     /**
//      * Get the ingredient of this furnace recipe.
//      * 
//      * @return the ingredient
//      */
//     public CraftingIngredient getIngredient();
// 
//     /**
//      * Get the output of this furnace recipe.
//      * 
//      * @return the output
//      */
//     public ItemStack getResult();
// 
//     /**
//      * Get the experience that is granted for using this furnace recipe.
//      * 
//      * @return the experienced
//      */
//     public float getXp();
// 
//     /**
//      * Set the ingredient of this furnace recipe.
//      * 
//      * @param ingredient
//      */
//     public void setIngredient(CraftingIngredient ingredient);
// 
//     /**
//      * Set the output of this furnace recipe.
//      * 
//      * @param result the output
//      */
//     public void setResult(ItemStack result);
// 
//     /**
//      * Set the experience of this furnace recipe.
//      * 
//      * @param xp the experience
//      */
//     public void setXp(float xp);
//     
//     /**
//      * Gets the representation. The default implementation returns the result ItemStack.
//      * 
//      * @return the representation - same as {@link FurnaceRecipe#getResult()}
//      */
//     public default ItemStack getRepresentation() {
//         return getResult();
//     }
//     
// }
// 
// Path: src/main/java/com/gmail/jannyboy11/customrecipes/impl/crafting/CRCraftingIngredient.java
// public class CRCraftingIngredient<I extends RecipeItemStack> implements CraftingIngredient, NBTSerializable {
// 
// 	protected final I nmsIngredient;
// 
// 	public CRCraftingIngredient(I nmsIngredient) {
// 		this.nmsIngredient = nmsIngredient;
// 	}
// 
// 	@Override
// 	public boolean isIngredient(ItemStack itemStack) {
// 		return this.nmsIngredient.a(CraftItemStack.asNMSCopy(itemStack));
// 	}
// 
// 	@Override
// 	public NBTTagCompound serializeToNbt() {
// 		return NBTUtil.serializeRecipeItemStack(nmsIngredient);
// 	}
// 	
// 	@Override
// 	public Map<String, Object> serialize() {
// 		return NBTSerializable.super.serialize();
// 	}
// 
// 	public static CRChoiceIngredient asBukkitIngredient(RecipeItemStack ingredient) {
// 	    //TODO can we handle subclasses of RecipeItemStack?
// 		return ingredient == RecipeItemStack.a ? CREmptyIngredient.INSTANCE : new CRChoiceIngredient(ingredient);
// 	}
// 	
// 	public static RecipeItemStack asNMSIngredient(ChoiceIngredient ingredient) {
// 		if (ingredient instanceof CRChoiceIngredient) {
// 			CRChoiceIngredient crIngredient = (CRChoiceIngredient) ingredient;
// 			return crIngredient.nmsIngredient;
// 		}
// 		
// 		RecipeItemStack nmsIngredient = asNMSIngredient((CraftingIngredient) ingredient);
// 		ItemStack[] choices = ingredient.getChoices().stream().map(CraftItemStack::asNMSCopy).toArray(size -> new ItemStack[size]);
// 		ReflectionUtil.setFinalFieldValue(nmsIngredient, "choices", choices);
// 		
// 		return nmsIngredient;
// 	}
// 
// 	public static RecipeItemStack asNMSIngredient(CraftingIngredient ingredient) {
// 		if (ingredient instanceof CRCraftingIngredient) {
// 			@SuppressWarnings("unchecked")
// 			CRCraftingIngredient<RecipeItemStack> crIngredient = (CRCraftingIngredient<RecipeItemStack>) ingredient;
// 			return crIngredient.nmsIngredient;
// 		}
// 		
// 		//fallback
// 		return new Bukkit2NMSIngredient(ingredient).asNMSIngredient();
// 	}
// 
// }


import java.util.Objects;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_12_R1.util.CraftNamespacedKey;
import com.gmail.jannyboy11.customrecipes.api.furnace.FurnaceRecipe;
import com.gmail.jannyboy11.customrecipes.impl.crafting.CRCraftingIngredient;
import net.minecraft.server.v1_12_R1.ItemStack;
import net.minecraft.server.v1_12_R1.MinecraftKey;
import net.minecraft.server.v1_12_R1.RecipeItemStack;
package com.gmail.jannyboy11.customrecipes.impl.furnace.custom;





public class Bukkit2NMSFurnaceRecipe extends NMSFurnaceRecipe {
    
    public Bukkit2NMSFurnaceRecipe(FurnaceRecipe bukkit) {
        this.bukkit = Objects.requireNonNull(bukkit);
    }
    
    @Override
    public MinecraftKey getKey() {
        return CraftNamespacedKey.toMinecraft(bukkit.getKey());
    }
    
    @Override
    public RecipeItemStack getIngredient() {
// Path: src/main/java/com/gmail/jannyboy11/customrecipes/api/furnace/FurnaceRecipe.java
// public interface FurnaceRecipe extends Recipe, Keyed, ConfigurationSerializable, Representable {
// 
//     /**
//      * Get the ingredient of this furnace recipe.
//      * 
//      * @return the ingredient
//      */
//     public CraftingIngredient getIngredient();
// 
//     /**
//      * Get the output of this furnace recipe.
//      * 
//      * @return the output
//      */
//     public ItemStack getResult();
// 
//     /**
//      * Get the experience that is granted for using this furnace recipe.
//      * 
//      * @return the experienced
//      */
//     public float getXp();
// 
//     /**
//      * Set the ingredient of this furnace recipe.
//      * 
//      * @param ingredient
//      */
//     public void setIngredient(CraftingIngredient ingredient);
// 
//     /**
//      * Set the output of this furnace recipe.
//      * 
//      * @param result the output
//      */
//     public void setResult(ItemStack result);
// 
//     /**
//      * Set the experience of this furnace recipe.
//      * 
//      * @param xp the experience
//      */
//     public void setXp(float xp);
//     
//     /**
//      * Gets the representation. The default implementation returns the result ItemStack.
//      * 
//      * @return the representation - same as {@link FurnaceRecipe#getResult()}
//      */
//     public default ItemStack getRepresentation() {
//         return getResult();
//     }
//     
// }
// 
// Path: src/main/java/com/gmail/jannyboy11/customrecipes/impl/crafting/CRCraftingIngredient.java
// public class CRCraftingIngredient<I extends RecipeItemStack> implements CraftingIngredient, NBTSerializable {
// 
// 	protected final I nmsIngredient;
// 
// 	public CRCraftingIngredient(I nmsIngredient) {
// 		this.nmsIngredient = nmsIngredient;
// 	}
// 
// 	@Override
// 	public boolean isIngredient(ItemStack itemStack) {
// 		return this.nmsIngredient.a(CraftItemStack.asNMSCopy(itemStack));
// 	}
// 
// 	@Override
// 	public NBTTagCompound serializeToNbt() {
// 		return NBTUtil.serializeRecipeItemStack(nmsIngredient);
// 	}
// 	
// 	@Override
// 	public Map<String, Object> serialize() {
// 		return NBTSerializable.super.serialize();
// 	}
// 
// 	public static CRChoiceIngredient asBukkitIngredient(RecipeItemStack ingredient) {
// 	    //TODO can we handle subclasses of RecipeItemStack?
// 		return ingredient == RecipeItemStack.a ? CREmptyIngredient.INSTANCE : new CRChoiceIngredient(ingredient);
// 	}
// 	
// 	public static RecipeItemStack asNMSIngredient(ChoiceIngredient ingredient) {
// 		if (ingredient instanceof CRChoiceIngredient) {
// 			CRChoiceIngredient crIngredient = (CRChoiceIngredient) ingredient;
// 			return crIngredient.nmsIngredient;
// 		}
// 		
// 		RecipeItemStack nmsIngredient = asNMSIngredient((CraftingIngredient) ingredient);
// 		ItemStack[] choices = ingredient.getChoices().stream().map(CraftItemStack::asNMSCopy).toArray(size -> new ItemStack[size]);
// 		ReflectionUtil.setFinalFieldValue(nmsIngredient, "choices", choices);
// 		
// 		return nmsIngredient;
// 	}
// 
// 	public static RecipeItemStack asNMSIngredient(CraftingIngredient ingredient) {
// 		if (ingredient instanceof CRCraftingIngredient) {
// 			@SuppressWarnings("unchecked")
// 			CRCraftingIngredient<RecipeItemStack> crIngredient = (CRCraftingIngredient<RecipeItemStack>) ingredient;
// 			return crIngredient.nmsIngredient;
// 		}
// 		
// 		//fallback
// 		return new Bukkit2NMSIngredient(ingredient).asNMSIngredient();
// 	}
// 
// }


// Path: src/main/java/com/gmail/jannyboy11/customrecipes/impl/furnace/custom/Bukkit2NMSFurnaceRecipe.java
import java.util.Objects;
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_12_R1.util.CraftNamespacedKey;
import com.gmail.jannyboy11.customrecipes.api.furnace.FurnaceRecipe;
import com.gmail.jannyboy11.customrecipes.impl.crafting.CRCraftingIngredient;
import net.minecraft.server.v1_12_R1.ItemStack;
import net.minecraft.server.v1_12_R1.MinecraftKey;
import net.minecraft.server.v1_12_R1.RecipeItemStack;

package com.gmail.jannyboy11.customrecipes.impl.furnace.custom;





public class Bukkit2NMSFurnaceRecipe extends NMSFurnaceRecipe {
    
    public Bukkit2NMSFurnaceRecipe(FurnaceRecipe bukkit) {
        this.bukkit = Objects.requireNonNull(bukkit);
    }
    
    @Override
    public MinecraftKey getKey() {
        return CraftNamespacedKey.toMinecraft(bukkit.getKey());
    }
    
    @Override
    public RecipeItemStack getIngredient() {
        return CRCraftingIngredient.asNMSIngredient(bukkit.getIngredient());