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 class
ShapedRecipe.Serializer
-
Field Summary
Fields Modifier and Type Field Description private String
group
private int
height
private Identifier
id
private DefaultedList<Ingredient>
inputs
private ItemStack
output
private int
width
-
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)
ItemStack
craft(CraftingInventory craftingInventory)
private static int
findNextIngredient(String pattern)
private static int
findNextIngredientReverse(String pattern)
boolean
fits(int width, int height)
private static Map<String,Ingredient>
getComponents(JsonObject json)
String
getGroup()
int
getHeight()
Identifier
getId()
private static DefaultedList<Ingredient>
getIngredients(String[] pattern, Map<String,Ingredient> key, int width, int height)
static ItemStack
getItemStack(JsonObject json)
ItemStack
getOutput()
private static String[]
getPattern(JsonArray json)
DefaultedList<Ingredient>
getPreviewInputs()
RecipeSerializer<?>
getSerializer()
int
getWidth()
boolean
matches(CraftingInventory craftingInventory, World world)
private boolean
matchesSmall(CraftingInventory inv, int offsetX, int offsetY, boolean bool)
boolean
method_31584()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.recipe.CraftingRecipe
getType
Methods 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:
getId
in interfaceRecipe<CraftingInventory>
-
getSerializer
- Specified by:
getSerializer
in interfaceRecipe<CraftingInventory>
-
getGroup
- Specified by:
getGroup
in interfaceRecipe<CraftingInventory>
-
getOutput
- Specified by:
getOutput
in interfaceRecipe<CraftingInventory>
-
getPreviewInputs
- Specified by:
getPreviewInputs
in interfaceRecipe<CraftingInventory>
-
fits
@Environment(CLIENT) public boolean fits(int width, int height)- Specified by:
fits
in interfaceRecipe<CraftingInventory>
-
matches
- Specified by:
matches
in interfaceRecipe<CraftingInventory>
-
matchesSmall
-
craft
- Specified by:
craft
in 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_31584
in interfaceRecipe<CraftingInventory>
-
findNextIngredient
-
findNextIngredientReverse
-
getPattern
-
getComponents
-
getItemStack
-