RecipeFeature.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:ultrahardcore 作者:
/**
 * Check if the recipe has the given material in it
 *
 * @param r   the recipe to check
 * @param mat the material to look for
 * @return true if found, false if not
 */
private static boolean hasRecipeGotMaterial(Recipe r, Material mat)
{
    Collection<ItemStack> ingredients = null;
    //noinspection ChainOfInstanceofChecks
    if(r instanceof ShapedRecipe) {
        ingredients = ((ShapedRecipe) r).getIngredientMap().values();
    } else if(r instanceof ShapelessRecipe) {
        ingredients = ((ShapelessRecipe) r).getIngredientList();
    }
    return null != ingredients && isMaterialInList(ingredients, mat);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号