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 SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescription(package private) final CraftingBookCategory(package private) final String(package private) final int(package private) static int(package private) static int(package private) final NonNullList<Ingredient>(package private) final ItemStack(package private) final boolean(package private) final int
- 
Constructor SummaryConstructorsConstructorDescriptionShapedRecipe(String p_250221_, CraftingBookCategory p_250716_, int p_251480_, int p_251980_, NonNullList<Ingredient> p_252150_, ItemStack p_248581_) ShapedRecipe(String p_272759_, CraftingBookCategory p_273506_, int p_272952_, int p_272920_, NonNullList<Ingredient> p_273650_, ItemStack p_272852_, boolean p_273122_) 
- 
Method SummaryModifier and TypeMethodDescriptionassemble(CraftingContainer p_266686_, RegistryAccess p_266725_) booleancanCraftInDimensions(int p_44161_, int p_44162_) category()private static intfirstNonSpace(String p_44185_) getGroup()intintintgetResultItem(RegistryAccess p_266881_) intgetWidth()booleanprivate 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_) static voidsetCraftingSize(int width, int height) Expand the max width and height allowed in the deserializer.boolean(package private) static String[]Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.CraftingRecipegetTypeMethods inherited from interface net.minecraft.world.item.crafting.RecipegetRemainingItems, getToastSymbol, isSpecial
- 
Field Details- 
MAX_WIDTHstatic int MAX_WIDTH
- 
MAX_HEIGHTstatic int MAX_HEIGHT
- 
widthfinal int width
- 
heightfinal int height
- 
recipeItems
- 
result
- 
group
- 
category
- 
showNotificationfinal boolean showNotification
 
- 
- 
Constructor Details- 
ShapedRecipepublic ShapedRecipe(String p_272759_, CraftingBookCategory p_273506_, int p_272952_, int p_272920_, NonNullList<Ingredient> p_273650_, ItemStack p_272852_, boolean p_273122_) 
- 
ShapedRecipepublic ShapedRecipe(String p_250221_, CraftingBookCategory p_250716_, int p_251480_, int p_251980_, NonNullList<Ingredient> p_252150_, ItemStack p_248581_) 
 
- 
- 
Method Details- 
setCraftingSizepublic 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 width
- height- your max recipe height
 
- 
getSerializer- Specified by:
- getSerializerin interface- Recipe<CraftingContainer>
 
- 
getGroup- Specified by:
- getGroupin interface- Recipe<CraftingContainer>
 
- 
category- Specified by:
- categoryin interface- CraftingRecipe
 
- 
getResultItem- Specified by:
- getResultItemin interface- Recipe<CraftingContainer>
 
- 
getIngredients- Specified by:
- getIngredientsin interface- Recipe<CraftingContainer>
 
- 
showNotificationpublic boolean showNotification()- Specified by:
- showNotificationin interface- Recipe<CraftingContainer>
 
- 
canCraftInDimensionspublic boolean canCraftInDimensions(int p_44161_, int p_44162_) - Specified by:
- canCraftInDimensionsin interface- Recipe<CraftingContainer>
 
- 
matches- Specified by:
- matchesin interface- Recipe<CraftingContainer>
 
- 
matches
- 
assemble- Specified by:
- assemblein interface- Recipe<CraftingContainer>
 
- 
getWidthpublic int getWidth()
- 
getRecipeWidthpublic int getRecipeWidth()- Specified by:
- getRecipeWidthin interface- IShapedRecipe<CraftingContainer>
 
- 
getHeightpublic int getHeight()
- 
getRecipeHeightpublic int getRecipeHeight()- Specified by:
- getRecipeHeightin interface- IShapedRecipe<CraftingContainer>
 
- 
shrink
- 
isIncompletepublic boolean isIncomplete()- Specified by:
- isIncompletein interface- Recipe<CraftingContainer>
 
- 
firstNonSpace
- 
lastNonSpace
 
-