Java 类net.minecraft.server.ShapedRecipes 实例源码

项目:Brynhildr    文件:CraftShapedRecipe.java   
public void addToCraftingManager() {
    String[] shape = this.getShape();
    Map<Character, ItemStack> ingred = this.getIngredientMap();
    int width = shape[0].length();
    NonNullList<RecipeItemStack> data = NonNullList.withSize(shape.length * width, RecipeItemStack.a);

    for (int i = 0; i < shape.length; i++) {
        String row = shape[i];
        for (int j = 0; j < row.length(); j++) {
            data.set(i * width + j, RecipeItemStack.a(new net.minecraft.server.ItemStack[]{CraftItemStack.asNMSCopy(ingred.get(row.charAt(j)))}));
        }
    }

    CraftingManager.a(CraftNamespacedKey.toMinecraft(this.getKey()), new ShapedRecipes("", width, shape.length, data, CraftItemStack.asNMSCopy(this.getResult())));
}
项目:Brynhildr    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(CraftNamespacedKey.fromMinecraft(recipe.key), result);
    this.recipe = recipe;
}
项目:CraftBukkit    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(result);
    this.recipe = recipe;
}
项目:Craftbukkit    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(result);
    this.recipe = recipe;
}
项目:Almura-Server    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(result);
    this.recipe = recipe;
}
项目:Tweakkit-Server    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(result);
    this.recipe = recipe;
}
项目:SpigotSource    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(result);
    this.recipe = recipe;
}
项目:Craft-city    文件:CraftShapedRecipe.java   
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) {
    this(result);
    this.recipe = recipe;
}