类 CraftingRecipe

java.lang.Object
org.bukkit.inventory.CraftingRecipe
所有已实现的接口:
Recipe, Keyed
直接已知子类:
DyeRecipe, ImbueRecipe, ShapedRecipe, ShapelessRecipe, TransmuteRecipe

public abstract class CraftingRecipe extends Object implements Recipe, Keyed
代表一个有序或无序的合成配方。
  • 构造器详细资料

  • 方法详细资料

    • getKey

      @NotNull public @NotNull NamespacedKey getKey()
      从接口复制的说明: Keyed
      返回用于此对象的命名空间标识符.

      原文:Return the namespaced identifier for this object.

      指定者:
      getKey 在接口中 Keyed
      返回:
      标识此对象的 key
    • getResult

      @NotNull public @NotNull ItemStack getResult()
      获取此配方的结果。

      原文: Get the result of this recipe.

      指定者:
      getResult 在接口中 Recipe
      返回:
      结果物品堆。
    • getGroup

      @NotNull public @NotNull String getGroup()
      获取此配方的分组。具有相同分组的配方在客户端显示时可能会被分组在一起。

      原文: Get the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.

      返回:
      配方分组。空字符串表示没有分组。不能为 null。
    • setGroup

      public void setGroup(@NotNull @NotNull String group)
      设置此配方的分组。具有相同分组的配方在客户端显示时可能会被分组在一起。

      原文: Set the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.

      参数:
      group - 配方分组。空字符串表示没有分组。不能为 null。
    • getCategory

      @NotNull public @NotNull CraftingBookCategory getCategory()
      获取此配方在配方书中出现的类别。
      如果未设置,则默认为 CraftingBookCategory.MISC。

      原文: Gets the category which this recipe will appear in the recipe book under.
      Defaults to CraftingBookCategory.MISC if not set.

      返回:
      配方书类别
    • setCategory

      public void setCategory(@NotNull @NotNull CraftingBookCategory category)
      设置此配方在配方书中出现的类别。
      如果未设置,则默认为 CraftingBookCategory.MISC。

      原文: Sets the category which this recipe will appear in the recipe book under.
      Defaults to CraftingBookCategory.MISC if not set.

      参数:
      category - 配方书类别
    • checkResult

      @Internal @NotNull protected static @NotNull ItemStack checkResult(@NotNull @NotNull ItemStack result)
      检查用于 CraftingRecipe 相关构造器的 ItemStack 是否为空。

      原文: Checks an ItemStack to be used in constructors related to CraftingRecipe is not empty.

      参数:
      result - 一个 ItemStack
      返回:
      相同的结果 ItemStack
      抛出:
      IllegalArgumentException - 如果 result 是空物品(AIR)