Class AbstractRecipe
java.lang.Object
io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.AbstractRecipe
This class abstracts away from concrete recipes.
 It supports 
ShapedRecipe, ShapelessRecipe and
 recipes made using the EnhancedCraftingTable.- Author:
 - TheBusyBiscuit
 - See Also:
 - 
AbstractAutoCrafterVanillaRecipeSlimefunItemRecipe
 
- 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRecipe(Collection<Predicate<ItemStack>> ingredients, ItemStack result) Protected constructor. - 
Method Summary
Modifier and TypeMethodDescriptionThis returns theCollectionof ingredients asPredicates.This returns the result of thisAbstractRecipe.booleanThis returns whether or not this recipe has been enabled.static AbstractRecipeof(SlimefunItem item, RecipeType recipeType) This static accessor is forSlimefunItemrecipes.static AbstractRecipeThis is our static accessor for theAbstractRecipeclass.voidsetEnabled(boolean enabled) This method enables or disables this recipe.abstract voidshow(ChestMenu menu, AsyncRecipeChoiceTask task) This will visually represent thisAbstractRecipein the givenChestMenu. 
- 
Constructor Details
- 
AbstractRecipe
@ParametersAreNonnullByDefault protected AbstractRecipe(Collection<Predicate<ItemStack>> ingredients, ItemStack result) Protected constructor. For implementation classes only.- Parameters:
 ingredients- The ingredients for this recipe as predicatesresult- The resultingItemStack
 
 - 
 - 
Method Details
- 
getIngredients
This returns theCollectionof ingredients asPredicates.- Returns:
 - The ingredients for this 
AbstractRecipe 
 - 
getResult
This returns the result of thisAbstractRecipe. This will return the originalItemStack, so make sure toItemStack.clone()it.- Returns:
 - The resulting 
ItemStack 
 - 
isEnabled
public boolean isEnabled()This returns whether or not this recipe has been enabled. A disabled recipe will not be crafted.- Returns:
 - Whether this recipe is enabled
 
 - 
setEnabled
public void setEnabled(boolean enabled) This method enables or disables this recipe. A disabled recipe will not be crafted.- Parameters:
 enabled- Whether this recipe is enabled
 - 
show
This will visually represent thisAbstractRecipein the givenChestMenu. AnyRecipeChoice.MaterialChoicewill be cycled through using theAsyncRecipeChoiceTask.- Parameters:
 menu- TheChestMenuto display the recipe intask- TheAsyncRecipeChoiceTaskinstance
 - 
of
This is our static accessor for theAbstractRecipeclass. It will create a newVanillaRecipefor the givenRecipeif it is a validRecipe.Currently supported recipe types are
ShapedRecipeandShapelessRecipe. If theRecipeis null or none of the aforementioned types, null will be returned.- Parameters:
 recipe- TheRecipeto wrap- Returns:
 - The wrapped 
AbstractRecipeor null 
 - 
of
@Nullable public static AbstractRecipe of(@Nullable SlimefunItem item, @Nonnull RecipeType recipeType) This static accessor is forSlimefunItemrecipes. Note that theSlimefunItemmust be crafted using the specifiedRecipeType, otherwise null will be returned.- Parameters:
 item- TheSlimefunItemthe recipe belongs torecipeType- TheRecipeType- Returns:
 - The wrapped 
AbstractRecipeor null 
 
 -