Interface CookingRecipe
- All Superinterfaces:
Recipe<RecipeInput.Single>
A general interface for cooking-type/furnace recipes.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builds a simple furnace recipe. -
Method Summary
Modifier and TypeMethodDescriptionstatic CookingRecipe.Builder
builder()
Builds a cooking recipe.Returns the cooking time in ticks.float
Returns the experience of this recipe.Returns theIngredient
for thisCookingRecipe
.boolean
isValid
(ItemStackLike ingredient) Checks if the givenItemStackLike
fits the required constraints to craft thisCookingRecipe
.result
(ItemStackLike ingredient) Returns theCookingResult
containing the resultingItemStackLike
and the amount of experience released.Methods inherited from interface org.spongepowered.api.item.recipe.Recipe
exemplaryResult, isDynamic, isValid, remainingItems, result, result, type
-
Method Details
-
builder
Builds a cooking recipe.- Returns:
- A
CookingRecipe
builder
-
ingredient
Ingredient ingredient()Returns theIngredient
for thisCookingRecipe
.- Returns:
- The
Ingredient
for thisCookingRecipe
.
-
isValid
Checks if the givenItemStackLike
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
Returns the
CookingResult
containing the resultingItemStackLike
and the amount of experience released.- Parameters:
ingredient
- TheItemStackLike
currently being cooked- Returns:
- The
CookingResult
, orOptional.empty()
if the recipe is not valid according toisValid(ItemStackLike)
.
-
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.
-