Class RecipeResult
- java.lang.Object
-
- org.spongepowered.api.item.recipe.crafting.RecipeResult
-
public final class RecipeResult extends Object
The result of fulfilling aCraftingRecipe
.
-
-
Constructor Summary
Constructors Constructor Description RecipeResult(ItemStackSnapshot result, List<ItemStackSnapshot> remainingItems)
Creates a newRecipeResult
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
List<ItemStackSnapshot>
remainingItems()
Returns a list ofItemStackSnapshot
to be set in the inputCraftingGridInventory
, containsItemStackSnapshot.empty()
for slots which should be cleared.ItemStackSnapshot
result()
This method should be used instead of theRecipe.exemplaryResult()
method, as it customizes the result further depending on the specified ingredientItemStackSnapshot
.String
toString()
-
-
-
Constructor Detail
-
RecipeResult
public RecipeResult(ItemStackSnapshot result, List<ItemStackSnapshot> remainingItems)
Creates a newRecipeResult
.Note that this may be replaced with a static of method in the future.
- Parameters:
result
- The result of the crafting reciperemainingItems
- The remaining items to leave in the crafting window
-
-
Method Detail
-
result
public ItemStackSnapshot result()
This method should be used instead of theRecipe.exemplaryResult()
method, as it customizes the result further depending on the specified ingredientItemStackSnapshot
. It is advised to use the output ofRecipe.exemplaryResult()
, modify it accordingly, andreturn
it.- Returns:
- The result of fulfilling the requirements of a
CraftingRecipe
-
remainingItems
public List<ItemStackSnapshot> remainingItems()
Returns a list ofItemStackSnapshot
to be set in the inputCraftingGridInventory
, containsItemStackSnapshot.empty()
for slots which should be cleared.- Returns:
- A list of
ItemStackSnapshot
s to be set in the inputCraftingGridInventory
-
-