类 ShapedRecipe

java.lang.Object
org.bukkit.inventory.ShapedRecipe
所有已实现的接口:
Recipe, Keyed

public class ShapedRecipe extends Object implements Recipe, Keyed
Represents a shaped (ie normal) crafting recipe.
  • 构造器详细资料

  • 方法详细资料

    • shape

      public ShapedRecipe shape(String... shape)
      Set the shape of this recipe to the specified rows. Each character represents a different ingredient; exactly what each character represents is set separately. The first row supplied corresponds with the upper most part of the recipe on the workbench e.g. if all three rows are supplies the first string represents the top row on the workbench.
      参数:
      shape - The rows of the recipe (up to 3 rows).
      返回:
      The changed recipe, so you can chain calls.
    • setIngredient

      public ShapedRecipe setIngredient(char key, MaterialData ingredient)
      Sets the material that a character in the recipe shape refers to.
      参数:
      key - The character that represents the ingredient in the shape.
      ingredient - The ingredient.
      返回:
      The changed recipe, so you can chain calls.
    • setIngredient

      public ShapedRecipe setIngredient(char key, Material ingredient)
      Sets the material that a character in the recipe shape refers to.
      参数:
      key - The character that represents the ingredient in the shape.
      ingredient - The ingredient.
      返回:
      The changed recipe, so you can chain calls.
    • setIngredient

      @Deprecated public ShapedRecipe setIngredient(char key, Material ingredient, int raw)
      已过时。
      Magic value
      Sets the material that a character in the recipe shape refers to.
      参数:
      key - The character that represents the ingredient in the shape.
      ingredient - The ingredient.
      raw - The raw material data as an integer.
      返回:
      The changed recipe, so you can chain calls.
    • setIngredient

      public ShapedRecipe setIngredient(char key, RecipeChoice ingredient)
    • getIngredientMap

      public Map<Character,ItemStack> getIngredientMap()
      Get a copy of the ingredients map.
      返回:
      The mapping of character to ingredients.
    • getChoiceMap

      public Map<Character,RecipeChoice> getChoiceMap()
    • getShape

      public String[] getShape()
      Get the shape.
      返回:
      The recipe's shape.
      抛出:
      NullPointerException - when not set yet
    • getResult

      public ItemStack getResult()
      Get the result.
      指定者:
      getResult 在接口中 Recipe
      返回:
      The result stack.
    • getKey

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

      原文:Return the namespaced identifier for this object.

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

      public String getGroup()
      Get the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.
      返回:
      recipe group. An empty string denotes no group. May not be null.
    • setGroup

      public void setGroup(String group)
      Set the group of this recipe. Recipes with the same group may be grouped together when displayed in the client.
      参数:
      group - recipe group. An empty string denotes no group. May not be null.