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()))); }
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) { this(CraftNamespacedKey.fromMinecraft(recipe.key), result); this.recipe = recipe; }
public CraftShapedRecipe(ItemStack result, ShapedRecipes recipe) { this(result); this.recipe = recipe; }