Interface ShapedCraftingRecipe.Builder
- All Superinterfaces:
AbstractBuilder<ShapedCraftingRecipe>, Builder<ShapedCraftingRecipe, ShapedCraftingRecipe.Builder>, ResettableBuilder<ShapedCraftingRecipe, ShapedCraftingRecipe.Builder>
- All Known Subinterfaces:
ShapedCraftingRecipe.Builder.AisleStep, ShapedCraftingRecipe.Builder.AisleStep.ResultStep, ShapedCraftingRecipe.Builder.EndStep, ShapedCraftingRecipe.Builder.ResultStep, ShapedCraftingRecipe.Builder.RowsStep, ShapedCraftingRecipe.Builder.RowsStep.ResultStep
- Enclosing interface:
ShapedCraftingRecipe
public static interface ShapedCraftingRecipe.Builder
extends Builder<ShapedCraftingRecipe, ShapedCraftingRecipe.Builder>
The Builder for
ShapedCraftingRecipes.
The shaped recipe pattern can be built one of two ways:
Either by defining the pattern with aisle(String...) and then setting ShapedCraftingRecipe.Builder.AisleStep.where(char, Ingredient) the ingredients are.
Or by defining the pattern using rows() adding each ShapedCraftingRecipe.Builder.RowsStep.row(Ingredient...) of ingredients after the other.
Ingredient log = Ingredient.of(LOG);
ShapedCraftingRecipe.builder()
.aisle("sss")
.where('s', log)
.result(ItemStack.of(WOODEN_PRESSURE_PLATE, 1))
.key(RessourceKey.of(plugin, "my_pressure_plate))
.build();
ShapedCraftingRecipe.builder()
.rows()
.row(log, log, log)
.result(ItemStack.of(WOODEN_PRESSURE_PLATE, 1))
.key(RessourceKey.of(plugin, "my_pressure_plate))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceIn this Step define one or more Ingredients.static interfaceIn this Step set the group of the Recipe and/or build it.static interfaceIn this Step set the result of the recipe.static interfaceIn this Step add one or more rows of Ingredients. -
Method Summary
Modifier and TypeMethodDescriptionStart building a new recipe based on the aisle pattern.rows()Start building a new recipe with ingredients based on rows.Methods inherited from interface AbstractBuilder
build
-
Method Details
-
aisle
Start building a new recipe based on the aisle pattern.Use
ShapedCraftingRecipe.Builder.AisleStep.where(char, Ingredient)to assign ingredients to characters of the aisles.Use the space character for
Ingredient.empty()Any other not assigned characters will cause an Exception when
ShapedCraftingRecipe.Builder.EndStep.build()ing the Recipe.- Parameters:
aisle- A string array of ingredients- Returns:
- The builder
-
rows
Start building a new recipe with ingredients based on rows. After this callShapedCraftingRecipe.Builder.RowsStep.row(Ingredient...)for each row of your recipe.- Returns:
- This builder
-