Class RecipeResult
- java.lang.Object
-
- org.spongepowered.api.item.recipe.crafting.RecipeResult
-
public final class RecipeResult extends java.lang.ObjectThe result of fulfilling aCraftingRecipe.
-
-
Constructor Summary
Constructors Constructor Description RecipeResult(ItemStackSnapshot result, java.util.List<ItemStackSnapshot> remainingItems)Creates a newRecipeResult.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()java.util.List<ItemStackSnapshot>remainingItems()Returns a list ofItemStackSnapshotto be set in the inputCraftingGridInventory, containsItemStackSnapshot.empty()for slots which should be cleared.ItemStackSnapshotresult()This method should be used instead of theRecipe.exemplaryResult()method, as it customizes the result further depending on the specified ingredientItemStackSnapshot.java.lang.StringtoString()
-
-
-
Constructor Detail
-
RecipeResult
public RecipeResult(ItemStackSnapshot result, java.util.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, andreturnit.- Returns:
- The result of fulfilling the requirements of a
CraftingRecipe
-
remainingItems
public java.util.List<ItemStackSnapshot> remainingItems()
Returns a list ofItemStackSnapshotto be set in the inputCraftingGridInventory, containsItemStackSnapshot.empty()for slots which should be cleared.- Returns:
- A list of
ItemStackSnapshots to be set in the inputCraftingGridInventory
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-