Package net.minecraft.recipe
Class ShapelessRecipe
java.lang.Object
net.minecraft.recipe.ShapelessRecipe
- All Implemented Interfaces:
CraftingRecipe,Recipe<CraftingInventory>
public class ShapelessRecipe extends Object implements CraftingRecipe
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShapelessRecipe.Serializer -
Field Summary
Fields Modifier and Type Field Description private Stringgroupprivate Identifieridprivate DefaultedList<Ingredient>inputprivate ItemStackoutput -
Constructor Summary
Constructors Constructor Description ShapelessRecipe(Identifier id, String group, ItemStack output, DefaultedList<Ingredient> input) -
Method Summary
Modifier and Type Method Description ItemStackcraft(CraftingInventory craftingInventory)Crafts this recipe.booleanfits(int width, int height)Determines whether this recipe's pattern will fit into the available crafting area.StringgetGroup()Optional group this recipe belongs in.IdentifiergetId()DefaultedList<Ingredient>getIngredients()The ingredients accepted as inputs for this recipe.ItemStackgetOutput()RecipeSerializer<?>getSerializer()booleanmatches(CraftingInventory craftingInventory, 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.CraftingRecipe
getTypeMethods inherited from interface net.minecraft.recipe.Recipe
createIcon, getRemainder, isIgnoredInRecipeBook
-
Field Details
-
id
-
group
-
output
-
input
-
-
Constructor Details
-
ShapelessRecipe
public ShapelessRecipe(Identifier id, String group, ItemStack output, DefaultedList<Ingredient> input)
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceRecipe<CraftingInventory>
-
getSerializer
- Specified by:
getSerializerin interfaceRecipe<CraftingInventory>
-
getGroup
Optional group this recipe belongs in. Used to group recipes into different categories by the recipe book.- Specified by:
getGroupin interfaceRecipe<CraftingInventory>
-
getOutput
- Specified by:
getOutputin interfaceRecipe<CraftingInventory>
-
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<CraftingInventory>
-
matches
Description copied from interface:RecipeDetermines whether this recipe matches the contents currently placed inside the available crafting grid.- Specified by:
matchesin interfaceRecipe<CraftingInventory>
-
craft
Description copied from interface:RecipeCrafts this recipe.This method may perform side effects on the
inventoryargument.This method should return a new item stack on each call.
- Specified by:
craftin interfaceRecipe<CraftingInventory>- Returns:
- the resulting item stack
-
fits
@Environment(CLIENT) public boolean fits(int width, int height)Determines whether this recipe's pattern will fit into the available crafting area.- Specified by:
fitsin interfaceRecipe<CraftingInventory>
-