// Path: src/main/java/gr8pefish/openglider/api/item/IGlider.java
// public interface IGlider extends INBTSerializable<NBTTagCompound> {
//     //ToDo
// 
//     //==============Flight==================
// 
//     //Blocks traveled horizontally per movement time.
//     double getHorizontalFlightSpeed();
// 
//     void setHorizontalFlightSpeed(double speed);
// 
//     //Blocks traveled vertically per movement time.
//     double getVerticalFlightSpeed();
// 
//     void setVerticalFlightSpeed(double speed);
// 
//     //Blocks traveled horizontally per movement time when going fast/pressing shift.
//     double getShiftHorizontalFlightSpeed();
// 
//     void setShiftHorizontalFlightSpeed(double speed);
// 
//     //Blocks traveled vertically per movement time when going fast/pressing shift.
//     double getShiftVerticalFlightSpeed();
// 
//     void setShiftVerticalFlightSpeed(double speed);
// 
//     //===============Wind====================
// 
//     double getWindMultiplier();
// 
//     void setWindMultiplier(double windMultiplier);
// 
//     double getAirResistance();
// 
//     void setAirResistance(double airResistance);
// 
//     //=============Durability================
// 
//     int getTotalDurability();
// 
//     void setTotalDurability(int durability);
// 
//     int getCurrentDurability(ItemStack glider);
// 
//     void setCurrentDurability(ItemStack glider, int durability);
// 
//     boolean isBroken(ItemStack glider);
// 
//     //==============Upgrades====================
//     ArrayList<ItemStack> getUpgrades(ItemStack glider);
// 
//     void removeUpgrade(ItemStack glider, ItemStack upgrade);
// 
//     void addUpgrade(ItemStack glider, ItemStack upgrade);
// 
//     //==============Misc=========================
//     ResourceLocation getModelTexture(ItemStack glider);
// 
//     void setModelTexture(ResourceLocation resourceLocation);
// 
// }
// 
// Path: src/main/java/gr8pefish/openglider/api/upgrade/UpgradeItems.java
// public class UpgradeItems {
// 
//     private static ArrayList<ItemStack> possibleUpgradeList;
// 
//     public static void initUpgradesList() {
//         possibleUpgradeList = new ArrayList<>();
// //        addToUpgradesList(new ItemStack(Items.COMPASS)); //ToDo: Add back with functionality at some point
//     }
// 
//     public static void addToUpgradesList(ItemStack stack) {
//         possibleUpgradeList.add(stack);
//     }
// 
//     public static ArrayList<ItemStack> getPossibleUpgradeList() {
//         return possibleUpgradeList;
//     }
// 
//     private static void removeFromUpgradesList(ItemStack stack) {
//         possibleUpgradeList.remove(stack);
//     }
// 
// }


import gr8pefish.openglider.api.item.IGlider;
import gr8pefish.openglider.api.upgrade.UpgradeItems;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
package gr8pefish.openglider.common.recipe;



public class RecipeHelper {

    /**
     * Helper method for getting the first glider in the recipes grid (which will be the one used)
     * @param inventoryCrafting - the inventory to search
     * @return - the glider to be crafted
     */
    public static ItemStack getFirstUpgradableGlider(InventoryCrafting inventoryCrafting) {
        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                ItemStack itemstack = inventoryCrafting.getStackInRowAndColumn(j, i);
                if (!itemstack.isEmpty() && (itemstack.getItem() instanceof IGlider)) {
                    return itemstack;
                }
            }
        }
        return null;
    }

    /**
     * Helper method for getting the first upgrade in the recipes grid (which will be the one used)
     * @param inventoryCrafting - the inventory to search
     * @return - the upgrade to be used
     */
    public static ItemStack getFirstUpgrade(InventoryCrafting inventoryCrafting){
        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                ItemStack itemstack = inventoryCrafting.getStackInRowAndColumn(j, i);
                if (!itemstack.isEmpty()) {
// Path: src/main/java/gr8pefish/openglider/api/item/IGlider.java
// public interface IGlider extends INBTSerializable<NBTTagCompound> {
//     //ToDo
// 
//     //==============Flight==================
// 
//     //Blocks traveled horizontally per movement time.
//     double getHorizontalFlightSpeed();
// 
//     void setHorizontalFlightSpeed(double speed);
// 
//     //Blocks traveled vertically per movement time.
//     double getVerticalFlightSpeed();
// 
//     void setVerticalFlightSpeed(double speed);
// 
//     //Blocks traveled horizontally per movement time when going fast/pressing shift.
//     double getShiftHorizontalFlightSpeed();
// 
//     void setShiftHorizontalFlightSpeed(double speed);
// 
//     //Blocks traveled vertically per movement time when going fast/pressing shift.
//     double getShiftVerticalFlightSpeed();
// 
//     void setShiftVerticalFlightSpeed(double speed);
// 
//     //===============Wind====================
// 
//     double getWindMultiplier();
// 
//     void setWindMultiplier(double windMultiplier);
// 
//     double getAirResistance();
// 
//     void setAirResistance(double airResistance);
// 
//     //=============Durability================
// 
//     int getTotalDurability();
// 
//     void setTotalDurability(int durability);
// 
//     int getCurrentDurability(ItemStack glider);
// 
//     void setCurrentDurability(ItemStack glider, int durability);
// 
//     boolean isBroken(ItemStack glider);
// 
//     //==============Upgrades====================
//     ArrayList<ItemStack> getUpgrades(ItemStack glider);
// 
//     void removeUpgrade(ItemStack glider, ItemStack upgrade);
// 
//     void addUpgrade(ItemStack glider, ItemStack upgrade);
// 
//     //==============Misc=========================
//     ResourceLocation getModelTexture(ItemStack glider);
// 
//     void setModelTexture(ResourceLocation resourceLocation);
// 
// }
// 
// Path: src/main/java/gr8pefish/openglider/api/upgrade/UpgradeItems.java
// public class UpgradeItems {
// 
//     private static ArrayList<ItemStack> possibleUpgradeList;
// 
//     public static void initUpgradesList() {
//         possibleUpgradeList = new ArrayList<>();
// //        addToUpgradesList(new ItemStack(Items.COMPASS)); //ToDo: Add back with functionality at some point
//     }
// 
//     public static void addToUpgradesList(ItemStack stack) {
//         possibleUpgradeList.add(stack);
//     }
// 
//     public static ArrayList<ItemStack> getPossibleUpgradeList() {
//         return possibleUpgradeList;
//     }
// 
//     private static void removeFromUpgradesList(ItemStack stack) {
//         possibleUpgradeList.remove(stack);
//     }
// 
// }


// Path: src/main/java/gr8pefish/openglider/common/recipe/RecipeHelper.java
import gr8pefish.openglider.api.item.IGlider;
import gr8pefish.openglider.api.upgrade.UpgradeItems;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;

package gr8pefish.openglider.common.recipe;



public class RecipeHelper {

    /**
     * Helper method for getting the first glider in the recipes grid (which will be the one used)
     * @param inventoryCrafting - the inventory to search
     * @return - the glider to be crafted
     */
    public static ItemStack getFirstUpgradableGlider(InventoryCrafting inventoryCrafting) {
        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                ItemStack itemstack = inventoryCrafting.getStackInRowAndColumn(j, i);
                if (!itemstack.isEmpty() && (itemstack.getItem() instanceof IGlider)) {
                    return itemstack;
                }
            }
        }
        return null;
    }

    /**
     * Helper method for getting the first upgrade in the recipes grid (which will be the one used)
     * @param inventoryCrafting - the inventory to search
     * @return - the upgrade to be used
     */
    public static ItemStack getFirstUpgrade(InventoryCrafting inventoryCrafting){
        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                ItemStack itemstack = inventoryCrafting.getStackInRowAndColumn(j, i);
                if (!itemstack.isEmpty()) {
                    for (ItemStack upgrade : UpgradeItems.getPossibleUpgradeList()) {