Class ShapedRecipe
java.lang.Object
net.minecraft.world.item.crafting.ShapedRecipe
- All Implemented Interfaces:
CraftingRecipe,Recipe<CraftingContainer>,IShapedRecipe<CraftingContainer>
- Direct Known Subclasses:
MapExtendingRecipe
public class ShapedRecipe
extends Object
implements CraftingRecipe, IShapedRecipe<CraftingContainer>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CraftingBookCategory(package private) final String(package private) final intprivate final ResourceLocation(package private) static int(package private) static int(package private) final NonNullList<Ingredient>(package private) final ItemStack(package private) final int -
Constructor Summary
ConstructorsConstructorDescriptionShapedRecipe(ResourceLocation p_250963_, String p_250221_, CraftingBookCategory p_250716_, int p_251480_, int p_251980_, NonNullList<Ingredient> p_252150_, ItemStack p_248581_) -
Method Summary
Modifier and TypeMethodDescriptionassemble(CraftingContainer p_44169_) booleancanCraftInDimensions(int p_44161_, int p_44162_) category()(package private) static NonNullList<Ingredient>dissolvePattern(String[] p_44203_, Map<String, Ingredient> p_44204_, int p_44205_, int p_44206_) private static intfirstNonSpace(String p_44185_) getGroup()intgetId()intintintgetWidth()booleanstatic ItemitemFromJson(com.google.gson.JsonObject p_151279_) static ItemStackitemStackFromJson(com.google.gson.JsonObject p_151275_) (package private) static Map<String,Ingredient> keyFromJson(com.google.gson.JsonObject p_44211_) private static intlastNonSpace(String p_44201_) private booleanmatches(CraftingContainer p_44171_, int p_44172_, int p_44173_, boolean p_44174_) booleanmatches(CraftingContainer p_44176_, Level p_44177_) (package private) static String[]patternFromJson(com.google.gson.JsonArray p_44197_) static voidsetCraftingSize(int width, int height) Expand the max width and height allowed in the deserializer.(package private) static String[]Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.CraftingRecipe
getTypeMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getRemainingItems, getToastSymbol, isSpecial
-
Field Details
-
MAX_WIDTH
static int MAX_WIDTH -
MAX_HEIGHT
static int MAX_HEIGHT -
width
final int width -
height
final int height -
recipeItems
-
result
-
id
-
group
-
category
-
-
Constructor Details
-
ShapedRecipe
public ShapedRecipe(ResourceLocation p_250963_, String p_250221_, CraftingBookCategory p_250716_, int p_251480_, int p_251980_, NonNullList<Ingredient> p_252150_, ItemStack p_248581_)
-
-
Method Details
-
setCraftingSize
public static void setCraftingSize(int width, int height) Expand the max width and height allowed in the deserializer. This should be called by modders who add custom crafting tables that are larger than the vanilla 3x3.- Parameters:
width- your max recipe widthheight- your max recipe height
-
getId
- Specified by:
getIdin interfaceRecipe<CraftingContainer>
-
getSerializer
- Specified by:
getSerializerin interfaceRecipe<CraftingContainer>
-
getGroup
- Specified by:
getGroupin interfaceRecipe<CraftingContainer>
-
category
- Specified by:
categoryin interfaceCraftingRecipe
-
getResultItem
- Specified by:
getResultItemin interfaceRecipe<CraftingContainer>
-
getIngredients
- Specified by:
getIngredientsin interfaceRecipe<CraftingContainer>
-
canCraftInDimensions
public boolean canCraftInDimensions(int p_44161_, int p_44162_) - Specified by:
canCraftInDimensionsin interfaceRecipe<CraftingContainer>
-
matches
- Specified by:
matchesin interfaceRecipe<CraftingContainer>
-
matches
-
assemble
- Specified by:
assemblein interfaceRecipe<CraftingContainer>
-
getWidth
public int getWidth() -
getRecipeWidth
public int getRecipeWidth()- Specified by:
getRecipeWidthin interfaceIShapedRecipe<CraftingContainer>
-
getHeight
public int getHeight() -
getRecipeHeight
public int getRecipeHeight()- Specified by:
getRecipeHeightin interfaceIShapedRecipe<CraftingContainer>
-
dissolvePattern
static NonNullList<Ingredient> dissolvePattern(String[] p_44203_, Map<String, Ingredient> p_44204_, int p_44205_, int p_44206_) -
shrink
-
isIncomplete
public boolean isIncomplete()- Specified by:
isIncompletein interfaceRecipe<CraftingContainer>
-
firstNonSpace
-
lastNonSpace
-
patternFromJson
-
keyFromJson
-
itemStackFromJson
-
itemFromJson
-