Package net.minecraft.recipe
Class AbstractCookingRecipe
java.lang.Object
net.minecraft.recipe.AbstractCookingRecipe
- Direct Known Subclasses:
BlastingRecipe,CampfireCookingRecipe,SmeltingRecipe,SmokingRecipe
public abstract class AbstractCookingRecipe extends Object implements Recipe<Inventory>
-
Field Summary
Fields Modifier and Type Field Description protected intcookTimeprotected floatexperienceprotected Stringgroupprotected Identifieridprotected Ingredientinputprotected ItemStackoutputprotected RecipeType<?>type -
Constructor Summary
Constructors Constructor Description AbstractCookingRecipe(RecipeType<?> type, Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime) -
Method Summary
Modifier and Type Method Description ItemStackcraft(Inventory inventory)Crafts this recipe.booleanfits(int width, int height)Determines whether this recipe's pattern will fit into the available crafting area.intgetCookTime()floatgetExperience()StringgetGroup()Optional group this recipe belongs in.IdentifiergetId()DefaultedList<Ingredient>getIngredients()The ingredients accepted as inputs for this recipe.ItemStackgetOutput()RecipeType<?>getType()booleanmatches(Inventory inventory, World world)Determines whether this recipe matches the contents currently placed inside the available crafting grid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.recipe.Recipe
createIcon, getRemainder, getSerializer, isIgnoredInRecipeBook
-
Field Details
-
type
-
id
-
group
-
input
-
output
-
experience
protected final float experience -
cookTime
protected final int cookTime
-
-
Constructor Details
-
AbstractCookingRecipe
public AbstractCookingRecipe(RecipeType<?> type, Identifier id, String group, Ingredient input, ItemStack output, float experience, int cookTime)
-
-
Method Details
-
matches
Determines whether this recipe matches the contents currently placed inside the available crafting grid. -
craft
Crafts this recipe.This method may perform side effects on the
inventoryargument.This method should return a new item stack on each call.
-
fits
@Environment(CLIENT) public boolean fits(int width, int height)Determines whether this recipe's pattern will fit into the available crafting area. -
getIngredients
The ingredients accepted as inputs for this recipe. Used by the recipe book when displaying a ghost form of this recipe on the crafting grid as well as for previewing the possible inputs in the book itself.- Specified by:
getIngredientsin interfaceRecipe<Inventory>
-
getExperience
public float getExperience() -
getOutput
-
getGroup
Optional group this recipe belongs in. Used to group recipes into different categories by the recipe book. -
getCookTime
public int getCookTime() -
getId
-
getType
-