Package fr.fidorial.recipe


package fr.fidorial.recipe
Crafting recipes: the vanilla ones the server ships with, and the ones plugins add.

Recipes live in the recipe registry. A plugin builds a ShapedRecipe, a ShapelessRecipe or a TransmuteRecipe, or implements CraftingRecipe itself for logic none of those cover.

Unlike vanilla, where every grid slot takes exactly one item, an Ingredient can ask for several of the same item in one slot:

server.registries().recipes().register(
        ShapedRecipe.builder(Key.key("myplugin", "compressed_pickaxe"))
                .pattern("DDD", " S ", " S ")
                .define('D', Ingredient.of(ItemKeys.DIAMOND_BLOCK).withCount(16))
                .define('S', Ingredient.of(ItemKeys.STICK))
                .result(ItemStack.of(ItemKeys.DIAMOND_PICKAXE))
                .build(),
        plugin);
Since:
0.1.0
  • Class
    Description
    The tab of the recipe book a crafting recipe is filed under.
    The contents of a crafting grid, row by row from the top-left corner.
    A recipe that matches a crafting grid: what one craft gives, and what it takes from each slot.
    A recipe made in a crafting grid, the 2×2 one of the inventory or the 3×3 one of a crafting table.
    What one grid slot of a recipe accepts, and how many of it the craft takes from that slot.
    Answers whether an item belongs to an item tag, such as minecraft:planks.
    A recipe of the recipe registry.
    Creates the recipe objects of this package, implemented by the server.
    Where recipes are declared: the vanilla ones the server loads at startup, and the ones plugins add.
    A recipe whose ingredients must sit in a given layout, anywhere in the grid.
    Builds a ShapedRecipe, vanilla-style: a pattern of characters and what each one stands for.
    A recipe whose ingredients may sit anywhere in the grid, in any order.
    Builds a ShapelessRecipe.
    A recipe turning one item into another while keeping its components, such as dyeing a shulker box or a bundle without emptying it, or copying a filled map.
    Builds a TransmuteRecipe.