public static <T> T accept(Recipe recipe, RecipeVisitor<T> visitor) {
if (recipe instanceof ShapedRecipe) {
ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
return visitor.visit(shapedRecipe);
} else if (recipe instanceof ShapelessRecipe) {
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
return visitor.visit(shapelessRecipe);
} else if (recipe instanceof FurnaceRecipe) {
FurnaceRecipe furnaceRecipe = (FurnaceRecipe) recipe;
return visitor.visit(furnaceRecipe);
}
return visitor.visitOther(recipe);
}
RecipeAcceptor.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:craftinomicon
作者:
评论列表
文章目录