类 ShapedRecipe
-
构造器概要
构造器构造器说明ShapedRecipe(@NotNull ItemStack result) 已过时。配方必须有键。ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) 创建一个合成指定物品的配方。 -
方法概要
修饰符和类型方法说明获取选择映射的副本。获取成分映射的副本。getShape()获取形状。setIngredient(char key, @NotNull RecipeChoice ingredient) 设置配方形状中某个字符代表的材料。setIngredient(char key, @NotNull Material ingredient) 设置配方形状中某个字符代表的材料。setIngredient(char key, @NotNull MaterialData ingredient) 设置配方形状中某个字符引用的RecipeChoice。setIngredient(char key, @NotNull Material ingredient, int raw) 已过时。魔法值。设置此配方的形状为指定的行。从类继承的方法 org.bukkit.inventory.CraftingRecipe
checkResult, getCategory, getGroup, getKey, getResult, setCategory, setGroup
-
构造器详细资料
-
ShapedRecipe
已过时。配方必须有键。请改用ShapedRecipe(NamespacedKey, ItemStack)。原文:Create a shaped recipe to craft the specified ItemStack. The constructor merely determines the result and type; to set the actual recipe, you'll need to call the appropriate methods.
创建一个合成指定物品的配方。构造函数仅决定结果和类型;要设置实际配方,你需要调用适当的方法。 -
ShapedRecipe
创建一个合成指定物品的配方。构造函数仅决定结果和类型;要设置实际配方,你需要调用适当的方法。- 参数:
key- 配方的唯一键。result- 你希望配方创建的物品。- 抛出:
IllegalArgumentException- 如果result是空物品(AIR)。- 另请参阅:
-
shape(String...)setIngredient(char, Material)setIngredient(char, Material, int)setIngredient(char, MaterialData)原文:Create a shaped recipe to craft the specified ItemStack. The constructor merely determines the result and type; to set the actual recipe, you'll need to call the appropriate methods.
-
-
方法详细资料
-
shape
设置此配方的形状为指定的行。每个字符代表不同的成分;空格字符必须为空,每个字符代表什么需要单独设置。第一行对应工作台最上方的部分,例如如果提供三行,第一行代表工作台最上面一行。- 参数:
shape- 配方的行(最多3行)。- 返回:
- 修改后的配方,以便链式调用。
原文:Set the shape of this recipe to the specified rows. Each character represents a different ingredient; excluding space characters, which must be empty, 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.
-
setIngredient
@NotNull public @NotNull ShapedRecipe setIngredient(char key, @NotNull @NotNull MaterialData ingredient) 设置配方形状中某个字符引用的RecipeChoice。注意,在设置成分之前,必须先使用shape(String...)定义配方的形状。- 参数:
key- 形状中代表成分的字符。ingredient- 成分。- 返回:
- 修改后的配方,以便链式调用。
- 抛出:
IllegalArgumentException- 如果key是空格字符。IllegalArgumentException- 如果key未出现在形状中。原文:Sets the
RecipeChoicethat a character in the recipe shape refers to.Note that before an ingredient can be set, the recipe's shape must be defined with
shape(String...).
-
setIngredient
@NotNull public @NotNull ShapedRecipe setIngredient(char key, @NotNull @NotNull Material ingredient) 设置配方形状中某个字符代表的材料。注意,在设置成分之前,必须先使用shape(String...)定义配方的形状。- 参数:
key- 形状中代表成分的字符。ingredient- 成分。- 返回:
- 修改后的配方,以便链式调用。
- 抛出:
IllegalArgumentException- 如果key是空格字符。IllegalArgumentException- 如果key未出现在形状中。原文:Sets the material that a character in the recipe shape refers to.
Note that before an ingredient can be set, the recipe's shape must be defined with
shape(String...).
-
setIngredient
@Deprecated(since="1.6.2") @NotNull public @NotNull ShapedRecipe setIngredient(char key, @NotNull @NotNull Material ingredient, int raw) 已过时。魔法值。原文:Sets the material that a character in the recipe shape refers to.
Note that before an ingredient can be set, the recipe's shape must be defined with
shape(String...).设置配方形状中某个字符代表的材料。注意,在设置成分之前,必须先使用shape(String...)定义配方的形状。- 参数:
key- 形状中代表成分的字符。ingredient- 成分。raw- 原始材料数据的整数值。- 返回:
- 修改后的配方,以便链式调用。
- 抛出:
IllegalArgumentException- 如果key是空格字符。IllegalArgumentException- 如果key未出现在形状中。
-
setIngredient
@NotNull public @NotNull ShapedRecipe setIngredient(char key, @NotNull @NotNull RecipeChoice ingredient) 设置配方形状中某个字符代表的材料。注意,在设置成分之前,必须先使用shape(String...)定义配方的形状。- 参数:
key- 形状中代表成分的字符。ingredient- 成分。- 返回:
- 修改后的配方,以便链式调用。
- 抛出:
IllegalArgumentException- 如果key是空格字符。IllegalArgumentException- 如果key未出现在形状中。原文:Sets the material that a character in the recipe shape refers to.
Note that before an ingredient can be set, the recipe's shape must be defined with
shape(String...).
-
getIngredientMap
获取成分映射的副本。- 返回:
- 字符到成分的映射。
原文:Get a copy of the ingredients map.
-
getChoiceMap
获取选择映射的副本。- 返回:
- 字符到成分的映射。
原文:Get a copy of the choice map.
-
getShape
获取形状。- 返回:
- 配方的形状。
- 抛出:
NullPointerException- 尚未设置时抛出。原文:Get the shape.
-