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
-
Field Summary
Modifier 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 boolean
-
Constructor Summary
ConstructorDescriptionShapedRecipe
(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
(CraftingContainer p_266686_, RegistryAccess p_266725_) boolean
canCraftInDimensions
(int p_44161_, int p_44162_) category()
getGroup()
int
int
int
getResultItem
(RegistryAccess p_266881_) int
getWidth()
boolean
boolean
matches
(CraftingContainer p_44176_, Level p_44177_) static void
setCraftingSize
(int width, int height) Expand the max width and height allowed in the deserializer.boolean
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.crafting.CraftingRecipe
getType
Methods 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:
getSerializer
in interfaceRecipe<CraftingContainer>
-
getGroup
- Specified by:
getGroup
in interfaceRecipe<CraftingContainer>
-
getRecipeWidth
public int getRecipeWidth()- Specified by:
getRecipeWidth
in interfaceIShapedRecipe<CraftingContainer>
-
category
- Specified by:
category
in interfaceCraftingRecipe
-
getRecipeHeight
public int getRecipeHeight()- Specified by:
getRecipeHeight
in interfaceIShapedRecipe<CraftingContainer>
-
getResultItem
- Specified by:
getResultItem
in interfaceRecipe<CraftingContainer>
-
getIngredients
- Specified by:
getIngredients
in interfaceRecipe<CraftingContainer>
-
showNotification
public boolean showNotification()- Specified by:
showNotification
in interfaceRecipe<CraftingContainer>
-
canCraftInDimensions
public boolean canCraftInDimensions(int p_44161_, int p_44162_) - Specified by:
canCraftInDimensions
in interfaceRecipe<CraftingContainer>
-
matches
- Specified by:
matches
in interfaceRecipe<CraftingContainer>
-
assemble
- Specified by:
assemble
in interfaceRecipe<CraftingContainer>
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
isIncomplete
public boolean isIncomplete()- Specified by:
isIncomplete
in interfaceRecipe<CraftingContainer>
-