Interface ShapedCraftingRecipe
-
- All Superinterfaces:
CraftingRecipe
,Keyed
,Recipe
,ResourceKeyed
public interface ShapedCraftingRecipe extends CraftingRecipe
A ShapedCraftingRecipe is a CraftingRecipe that has shape and fits into a grid.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ShapedCraftingRecipe.Builder
The Builder forShapedCraftingRecipe
s.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ShapedCraftingRecipe.Builder
builder()
Creates a newShapedCraftingRecipe.Builder
to build aShapedCraftingRecipe
.int
height()
Gets the height of the grid this ShapedCraftingRecipe fits into.Ingredient
ingredient​(int x, int y)
Returns the ingredient at the specified location in this recipe.int
width()
Gets the width of the grid this ShapedCraftingRecipe fits into.-
Methods inherited from interface org.spongepowered.api.item.recipe.crafting.CraftingRecipe
group, type
-
Methods inherited from interface org.spongepowered.api.item.recipe.Recipe
exemplaryResult, ingredients, isDynamic, isValid, remainingItems, result, result
-
Methods inherited from interface org.spongepowered.api.ResourceKeyed
key
-
-
-
-
Method Detail
-
builder
static ShapedCraftingRecipe.Builder builder()
Creates a newShapedCraftingRecipe.Builder
to build aShapedCraftingRecipe
.- Returns:
- The new builder
-
ingredient
Ingredient ingredient​(int x, int y)
Returns the ingredient at the specified location in this recipe.- Parameters:
x
- The x coordinate counted from the left sidey
- The y coordinate counted from the top- Returns:
- The ingredient predicate at this position defined by the aisle
- Throws:
java.lang.IndexOutOfBoundsException
- if the location is invalid
-
width
int width()
Gets the width of the grid this ShapedCraftingRecipe fits into.- Returns:
- The width of the grid
-
height
int height()
Gets the height of the grid this ShapedCraftingRecipe fits into.- Returns:
- The height of the grid
-
-