public static boolean canCraftUpgrade(String upgradeName, List<ItemStack> craftItems) {
        Upgrade upgrade = null;

        // Loops through all of the upgrades
        for (Upgrade u : upgrades) {
            // Checks if the upgrade's name equals to the provided upgrade's name
            if (u.getName().equalsIgnoreCase(upgradeName)) {
                // Set the upgrade
                upgrade = u;
                break;
            }
        }

        Map<Material, Integer> upgradeMaterials = upgrade.getMaterials();

        // Checks if the chest's items are more than needed
        if (craftItems.size() > upgradeMaterials.size())
            return false;

        Map<Material, Boolean> existingMaterials = new HashMap<>();

        for (Material material : upgradeMaterials.keySet())
            existingMaterials.put(material, false);

        for (ItemStack itemStack : craftItems) {
            Material itemMaterial = itemStack.getType();
            Integer itemQuantity = itemStack.getAmount();

            if (upgradeMaterials.containsKey(itemMaterial) && upgradeMaterials.get(itemMaterial) == itemQuantity)
                existingMaterials.put(itemMaterial, true);
        }

        for (boolean taken : existingMaterials.values())
            if (!taken)
                return false;

        return true;
    }