Constructor | Description |
---|---|
ShapedRecipe(ItemStack result) |
Deprecated.
|
ShapedRecipe(NamespacedKey key,
ItemStack result) |
Create a shaped recipe to craft the specified ItemStack.
|
Modifier and Type | Method | Description |
---|---|---|
Map<Character,RecipeChoice> |
getChoiceMap() |
|
String |
getGroup() |
Get the group of this recipe.
|
Map<Character,ItemStack> |
getIngredientMap() |
Get a copy of the ingredients map.
|
NamespacedKey |
getKey() |
Return the namespaced identifier for this object.
|
ItemStack |
getResult() |
Get the result.
|
String[] |
getShape() |
Get the shape.
|
void |
setGroup(String group) |
Set the group of this recipe.
|
ShapedRecipe |
setIngredient(char key,
RecipeChoice ingredient) |
|
ShapedRecipe |
setIngredient(char key,
Material ingredient) |
Sets the material that a character in the recipe shape refers to.
|
ShapedRecipe |
setIngredient(char key,
MaterialData ingredient) |
Sets the material that a character in the recipe shape refers to.
|
ShapedRecipe |
setIngredient(char key,
Material ingredient,
int raw) |
Deprecated.
Magic value
|
ShapedRecipe |
shape(String... shape) |
Set the shape of this recipe to the specified rows.
|
@Deprecated public ShapedRecipe(@NotNull ItemStack result)
public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result)
key
- the unique recipe keyresult
- The item you want the recipe to create.shape(String...)
,
setIngredient(char, Material)
,
setIngredient(char, Material, int)
,
setIngredient(char, MaterialData)
@NotNull public ShapedRecipe shape(@NotNull String... shape)
shape
- The rows of the recipe (up to 3 rows).@NotNull public ShapedRecipe setIngredient(char key, @NotNull MaterialData ingredient)
key
- The character that represents the ingredient in the shape.ingredient
- The ingredient.@NotNull public ShapedRecipe setIngredient(char key, @NotNull Material ingredient)
key
- The character that represents the ingredient in the shape.ingredient
- The ingredient.@Deprecated @NotNull public ShapedRecipe setIngredient(char key, @NotNull Material ingredient, int raw)
key
- The character that represents the ingredient in the shape.ingredient
- The ingredient.raw
- The raw material data as an integer.@NotNull public ShapedRecipe setIngredient(char key, @NotNull RecipeChoice ingredient)
@NotNull public Map<Character,ItemStack> getIngredientMap()
@NotNull public Map<Character,RecipeChoice> getChoiceMap()
@NotNull public String[] getShape()
NullPointerException
- when not set yet@NotNull public ItemStack getResult()
@NotNull public NamespacedKey getKey()
Keyed
@NotNull public String getGroup()
public void setGroup(@NotNull String group)
group
- recipe group. An empty string denotes no group. May not be
null.Copyright © 2020. All rights reserved.