# 接口的使用
org.bukkit.inventory.Recipe

使用Recipe的程序包
程序包
说明
org.bukkit
Bukkit API的顶级程序包, 包含通用的API类和接口.
org.bukkit.event.inventory
与`物品栏`操作相关的`事件`.
org.bukkit.event.player
与`玩家`相关的`事件`.
org.bukkit.inventory
参与操作玩家物品栏和物品交互的类.

- ## org.bukkit中Recipe的使用

  返回Recipe的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `static @Nullable Recipe`
  Bukkit.`getCraftingRecipe(@NotNull ItemStack[] craftingMatrix, @NotNull World world)`
  Get the `Recipe` for the list of ItemStacks provided.
  `@Nullable Recipe`
  Server.`getCraftingRecipe(@NotNull ItemStack[] craftingMatrix, @NotNull World world)`
  Get the `Recipe` for the list of ItemStacks provided.
  `static @Nullable Recipe`
  Bukkit.`getRecipe(@NotNull NamespacedKey recipeKey)`
  根据指定的 key 获取`配方`.
  `@Nullable Recipe`
  Server.`getRecipe(@NotNull NamespacedKey recipeKey)`
  根据指定的 key 获取`配方`.
  返回变量类型为Recipe的类型的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `static @NotNull List<Recipe>`
  Bukkit.`getRecipesFor(@NotNull ItemStack result)`
  获取对指定物品适用的所有合成配方的列表.
  `@NotNull List<Recipe>`
  Server.`getRecipesFor(@NotNull ItemStack result)`
  获取对指定物品适用的所有合成配方的列表.
  `static @NotNull Iterator<Recipe>`
  Bukkit.`recipeIterator()`
  获取合成配方列表迭代器.
  `@NotNull Iterator<Recipe>`
  Server.`recipeIterator()`
  获取合成配方列表迭代器.
  参数类型为Recipe的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `static boolean`
  Bukkit.`addRecipe(@Nullable Recipe recipe)`
  向合成管理器添加一个合成配方.
  `boolean`
  Server.`addRecipe(@Nullable Recipe recipe)`
  向合成管理器添加一个合成配方.

- ## org.bukkit.event.inventory中Recipe的使用

  返回Recipe的org.bukkit.event.inventory中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Recipe`
  CraftItemEvent.`getRecipe()`
  获取合成出该物品所用的合成公式.
  `@Nullable Recipe`
  PrepareItemCraftEvent.`getRecipe()`
  Get the recipe that has been formed.
  参数类型为Recipe的org.bukkit.event.inventory中的构造器
  限定符
  构造器
  说明
  ``
  `CraftItemEvent(@NotNull Recipe recipe, @NotNull InventoryView what, @NotNull InventoryType.SlotType type, int slot, @NotNull ClickType click, @NotNull InventoryAction action)`
  ``
  `CraftItemEvent(@NotNull Recipe recipe, @NotNull InventoryView what, @NotNull InventoryType.SlotType type, int slot, @NotNull ClickType click, @NotNull InventoryAction action, int key)`

- ## org.bukkit.event.player中Recipe的使用

  返回Recipe的org.bukkit.event.player中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Recipe`
  PlayerRecipeBookClickEvent.`getOriginalRecipe()`
  Gets the original recipe the player was trying to craft.
  `@NotNull Recipe`
  PlayerRecipeBookClickEvent.`getRecipe()`
  Gets the recipe the player is trying to craft.
  参数类型为Recipe的org.bukkit.event.player中的方法
  修饰符和类型
  方法
  说明
  `void`
  PlayerRecipeBookClickEvent.`setRecipe(@NotNull Recipe recipe)`
  Set the recipe that will be used.
  参数类型为Recipe的org.bukkit.event.player中的构造器
  限定符
  构造器
  说明
  ``
  `PlayerRecipeBookClickEvent(@NotNull Player player, @NotNull Recipe recipe, boolean shiftClick)`

- ## org.bukkit.inventory中Recipe的使用

  org.bukkit.inventory中Recipe的子接口
  修饰符和类型
  接口
  说明
  `interface`
  `ComplexRecipe`
  Represents a complex recipe which has imperative server-defined behavior, eg armor dyeing.
  实现Recipe的org.bukkit.inventory中的类
  修饰符和类型
  类
  说明
  `class`
  `BlastingRecipe`
  Represents a campfire recipe.
  `class`
  `CampfireRecipe`
  Represents a campfire recipe.
  `class`
  `CookingRecipe<T extends CookingRecipe>`
  Represents a cooking recipe.
  `class`
  `CraftingRecipe`
  Represents a shaped or shapeless crafting recipe.
  `class`
  `FurnaceRecipe`
  熔炉冶炼配方.
  `class`
  `MerchantRecipe`
  Represents a merchant's trade.
  `class`
  `ShapedRecipe`
  Represents a shaped (ie normal) crafting recipe.
  `class`
  `ShapelessRecipe`
  Represents a shapeless recipe, where the arrangement of the ingredients on the crafting grid does not matter.
  `class`
  `SmithingRecipe`
  Represents a smithing recipe.
  `class`
  `SmithingTransformRecipe`
  Represents a smithing transform recipe.
  `class`
  `SmithingTrimRecipe`
  Represents a smithing trim recipe.
  `class`
  `SmokingRecipe`
  Represents a campfire recipe.
  `class`
  `StonecuttingRecipe`
  Represents a Stonecutting recipe.
  返回Recipe的org.bukkit.inventory中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Recipe`
  CraftingInventory.`getRecipe()`
  Get the current recipe formed on the crafting inventory, if any.
  `@Nullable Recipe`
  SmithingInventory.`getRecipe()`
  Get the current recipe formed on the smithing table, if any.