public static CraftShapedRecipe fromBukkitRecipe(ShapedRecipe recipe) {
if (recipe instanceof CraftShapedRecipe) {
return (CraftShapedRecipe) recipe;
}
CraftShapedRecipe ret = new CraftShapedRecipe(recipe.getResult());
String[] shape = recipe.getShape();
ret.shape(shape);
Map<Character, ItemStack> ingredientMap = recipe.getIngredientMap();
for (char c : ingredientMap.keySet()) {
ItemStack stack = ingredientMap.get(c);
if (stack != null) {
ret.setIngredient(c, stack.getType(), stack.getDurability());
}
}
return ret;
}
CraftShapedRecipe.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:CraftBukkit
作者:
评论列表
文章目录