Class ShapedRecipe
java.lang.Object
net.minecraft.world.item.crafting.ShapedRecipe
- All Implemented Interfaces:
CraftingRecipe,Recipe<CraftingInput>,IShapedRecipe<CraftingInput>
- Direct Known Subclasses:
MapExtendingRecipe
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final CraftingBookCategory(package private) final String(package private) static int(package private) static int(package private) final ShapedRecipePattern(package private) final ItemStack(package private) final booleanFields inherited from interface net.minecraft.world.item.crafting.Recipe
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionShapedRecipe(String p_272759_, CraftingBookCategory p_273506_, ShapedRecipePattern p_310709_, ItemStack p_272852_) ShapedRecipe(String p_250221_, CraftingBookCategory p_250716_, ShapedRecipePattern p_312200_, ItemStack p_248581_, boolean p_310619_) -
Method Summary
Modifier and TypeMethodDescriptionassemble(CraftingInput p_345083_, HolderLookup.Provider p_333236_) booleancanCraftInDimensions(int p_44161_, int p_44162_) category()getGroup()intintintgetResultItem(HolderLookup.Provider p_332111_) intgetWidth()booleanbooleanmatches(CraftingInput p_345171_, Level p_44177_) static voidsetCraftingSize(int width, int height) Expand the max width and height allowed in the deserializer.booleanMethods 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 -
pattern
-
result
-
group
-
category
-
showNotification
final boolean showNotification
-
-
Constructor Details
-
ShapedRecipe
public ShapedRecipe(String p_250221_, CraftingBookCategory p_250716_, ShapedRecipePattern p_312200_, ItemStack p_248581_, boolean p_310619_) -
ShapedRecipe
public ShapedRecipe(String p_272759_, CraftingBookCategory p_273506_, ShapedRecipePattern p_310709_, ItemStack p_272852_)
-
-
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
-
getSerializer
- Specified by:
getSerializerin interfaceRecipe<CraftingInput>
-
getGroup
- Specified by:
getGroupin interfaceRecipe<CraftingInput>
-
category
- Specified by:
categoryin interfaceCraftingRecipe
-
getResultItem
- Specified by:
getResultItemin interfaceRecipe<CraftingInput>
-
getIngredients
- Specified by:
getIngredientsin interfaceRecipe<CraftingInput>
-
showNotification
public boolean showNotification()- Specified by:
showNotificationin interfaceRecipe<CraftingInput>
-
canCraftInDimensions
public boolean canCraftInDimensions(int p_44161_, int p_44162_) - Specified by:
canCraftInDimensionsin interfaceRecipe<CraftingInput>
-
matches
- Specified by:
matchesin interfaceRecipe<CraftingInput>
-
assemble
- Specified by:
assemblein interfaceRecipe<CraftingInput>
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getRecipeWidth
public int getRecipeWidth()- Specified by:
getRecipeWidthin interfaceIShapedRecipe<CraftingInput>
-
getRecipeHeight
public int getRecipeHeight()- Specified by:
getRecipeHeightin interfaceIShapedRecipe<CraftingInput>
-
isIncomplete
public boolean isIncomplete()- Specified by:
isIncompletein interfaceRecipe<CraftingInput>
-