Class RecipeResult
- java.lang.Object
-
- org.spongepowered.api.item.recipe.crafting.RecipeResult
-
public final class RecipeResult extends java.lang.Object
The 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 boolean
equals(java.lang.Object o)
int
hashCode()
java.util.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
.java.lang.String
toString()
-
-
-
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, andreturn
it.- Returns:
- The result of fulfilling the requirements of a
CraftingRecipe
-
remainingItems
public java.util.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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-