Interface CookingRecipe
-
- All Superinterfaces:
Keyed
,Recipe
,ResourceKeyed
public interface CookingRecipe extends Recipe
A general interface for cooking-type/furnace recipes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
CookingRecipe.Builder
Builds a simple furnace recipe.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static CookingRecipe.Builder
builder()
Builds a cooking recipe.Ticks
cookingTime()
Returns the cooking time in ticks.float
experience()
Returns the experience of this recipe.Ingredient
ingredient()
Returns theIngredient
for thisCookingRecipe
.boolean
isValid(ItemStackSnapshot ingredient)
Checks if the givenItemStackSnapshot
fits the required constraints to craft thisCookingRecipe
.Optional<CookingResult>
result(ItemStackSnapshot ingredient)
Returns theCookingResult
containing the resultingItemStackSnapshot
and the amount of experience released.-
Methods inherited from interface org.spongepowered.api.item.recipe.Recipe
exemplaryResult, ingredients, isDynamic, isValid, remainingItems, result, result, type
-
Methods inherited from interface org.spongepowered.api.ResourceKeyed
key
-
-
-
-
Method Detail
-
builder
static CookingRecipe.Builder builder()
Builds a cooking recipe.- Returns:
- A
CookingRecipe
builder
-
ingredient
Ingredient ingredient()
Returns theIngredient
for thisCookingRecipe
.- Returns:
- The
Ingredient
for thisCookingRecipe
.
-
isValid
boolean isValid(ItemStackSnapshot ingredient)
Checks if the givenItemStackSnapshot
fits the required constraints to craft thisCookingRecipe
.- Parameters:
ingredient
- The ingredient to check against- Returns:
- Whether this ingredient can be used to craft the result
-
result
Optional<CookingResult> result(ItemStackSnapshot ingredient)
Returns the
CookingResult
containing the resultingItemStackSnapshot
and the amount of experience released.- Parameters:
ingredient
- TheItemStackSnapshot
currently being cooked- Returns:
- The
CookingResult
, orOptional.empty()
if the recipe is not valid according toisValid(ItemStackSnapshot)
.
-
cookingTime
Ticks cookingTime()
Returns the cooking time in ticks.- Returns:
- The cooking time in ticks.
-
experience
float experience()
Returns the experience of this recipe.- Returns:
- The experience of this recipe.
-
-