Package net.minecraft.recipe
Class ShapedRecipe
java.lang.Object
net.minecraft.recipe.ShapedRecipe
- All Implemented Interfaces:
CraftingRecipe,Recipe<CraftingInventory>
- Direct Known Subclasses:
MapExtendingRecipe
public class ShapedRecipe extends Object implements CraftingRecipe
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classShapedRecipe.Serializer -
Field Summary
Fields Modifier and Type Field Description private Stringgroupprivate intheightprivate Identifieridprivate DefaultedList<Ingredient>inputsprivate ItemStackoutputprivate intwidth -
Constructor Summary
Constructors Constructor Description ShapedRecipe(Identifier id, String group, int width, int height, DefaultedList<Ingredient> ingredients, ItemStack output) -
Method Summary
Modifier and Type Method Description (package private) static String[]combinePattern(String[] lines)ItemStackcraft(CraftingInventory craftingInventory)private static intfindNextIngredient(String pattern)private static intfindNextIngredientReverse(String pattern)booleanfits(int width, int height)private static Map<String,Ingredient>getComponents(JsonObject json)StringgetGroup()intgetHeight()IdentifiergetId()private static DefaultedList<Ingredient>getIngredients(String[] pattern, Map<String,Ingredient> key, int width, int height)static ItemStackgetItemStack(JsonObject json)ItemStackgetOutput()private static String[]getPattern(JsonArray json)DefaultedList<Ingredient>getPreviewInputs()RecipeSerializer<?>getSerializer()intgetWidth()booleanmatches(CraftingInventory craftingInventory, World world)private booleanmatchesSmall(CraftingInventory inv, int offsetX, int offsetY, boolean bool)booleanmethod_31584()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
getRecipeKindIcon, getRemainingStacks, isIgnoredInRecipeBook
-
Field Details
-
width
private final int width -
height
private final int height -
inputs
-
output
-
id
-
group
-
-
Constructor Details
-
ShapedRecipe
public ShapedRecipe(Identifier id, String group, int width, int height, DefaultedList<Ingredient> ingredients, ItemStack output)
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceRecipe<CraftingInventory>
-
getSerializer
- Specified by:
getSerializerin interfaceRecipe<CraftingInventory>
-
getGroup
- Specified by:
getGroupin interfaceRecipe<CraftingInventory>
-
getOutput
- Specified by:
getOutputin interfaceRecipe<CraftingInventory>
-
getPreviewInputs
- Specified by:
getPreviewInputsin interfaceRecipe<CraftingInventory>
-
fits
@Environment(CLIENT) public boolean fits(int width, int height)- Specified by:
fitsin interfaceRecipe<CraftingInventory>
-
matches
- Specified by:
matchesin interfaceRecipe<CraftingInventory>
-
matchesSmall
-
craft
- Specified by:
craftin interfaceRecipe<CraftingInventory>
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getIngredients
private static DefaultedList<Ingredient> getIngredients(String[] pattern, Map<String,Ingredient> key, int width, int height) -
combinePattern
-
method_31584
@Environment(CLIENT) public boolean method_31584()- Specified by:
method_31584in interfaceRecipe<CraftingInventory>
-
findNextIngredient
-
findNextIngredientReverse
-
getPattern
-
getComponents
-
getItemStack
-