Interface ShapedCraftingRecipe.Builder
-
- All Superinterfaces:
AbstractBuilder<RecipeRegistration>,Buildable.Builder<RecipeRegistration>,Builder<RecipeRegistration,ShapedCraftingRecipe.Builder>,ResettableBuilder<RecipeRegistration,ShapedCraftingRecipe.Builder>,ResourceKeyedBuilder<RecipeRegistration,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 ResourceKeyedBuilder<RecipeRegistration,ShapedCraftingRecipe.Builder>
The Builder forShapedCraftingRecipes.The shaped recipe pattern can be built one of two ways:
Either by defining the pattern with
aisle(java.lang.String...)and then settingShapedCraftingRecipe.Builder.AisleStep.where(char, org.spongepowered.api.item.recipe.crafting.Ingredient)the ingredients are.Or by defining the pattern using
rows()adding eachShapedCraftingRecipe.Builder.RowsStep.row(org.spongepowered.api.item.recipe.crafting.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 Classes Modifier and Type Interface Description static interfaceShapedCraftingRecipe.Builder.AisleStepIn this Step define one or more Ingredients.static interfaceShapedCraftingRecipe.Builder.EndStepIn this Step set the group of the Recipe and/or build it.static interfaceShapedCraftingRecipe.Builder.ResultStepIn this Step set the result of the recipe.static interfaceShapedCraftingRecipe.Builder.RowsStepIn this Step add one or more rows of Ingredients.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ShapedCraftingRecipe.Builder.AisleStepaisle(java.lang.String... aisle)Start building a new recipe based on the aisle pattern.ShapedCraftingRecipe.Builder.RowsSteprows()Start building a new recipe with ingredients based on rows.-
Methods inherited from interface net.kyori.adventure.util.Buildable.Builder
build
-
Methods inherited from interface org.spongepowered.api.util.ResourceKeyedBuilder
key
-
-
-
-
Method Detail
-
aisle
ShapedCraftingRecipe.Builder.AisleStep aisle(java.lang.String... aisle)
Start building a new recipe based on the aisle pattern.Use
ShapedCraftingRecipe.Builder.AisleStep.where(char, org.spongepowered.api.item.recipe.crafting.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
ShapedCraftingRecipe.Builder.RowsStep rows()
Start building a new recipe with ingredients based on rows. After this callShapedCraftingRecipe.Builder.RowsStep.row(org.spongepowered.api.item.recipe.crafting.Ingredient...)for each row of your recipe.- Returns:
- This builder
-
-