Package net.minecraft.item.crafting
Class ShapedRecipe
java.lang.Object
net.minecraft.item.crafting.ShapedRecipe
- All Implemented Interfaces:
ICraftingRecipe
,IRecipe<CraftingInventory>
,IShapedRecipe<CraftingInventory>
- Direct Known Subclasses:
MapExtendingRecipe
public class ShapedRecipe
extends Object
implements ICraftingRecipe, IShapedRecipe<CraftingInventory>
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final String
private final int
private final ResourceLocation
(package private) static int
(package private) static int
private final NonNullList<Ingredient>
private final ItemStack
private final int
-
Constructor Summary
ConstructorDescriptionShapedRecipe
(ResourceLocation p_i48162_1_, String p_i48162_2_, int p_i48162_3_, int p_i48162_4_, NonNullList<Ingredient> p_i48162_5_, ItemStack p_i48162_6_) -
Method Summary
Modifier and TypeMethodDescriptionassemble
(CraftingInventory p_77572_1_) boolean
canCraftInDimensions
(int p_194133_1_, int p_194133_2_) private static NonNullList<Ingredient>
dissolvePattern
(String[] p_192402_0_, Map<String, Ingredient> p_192402_1_, int p_192402_2_, int p_192402_3_) private static int
firstNonSpace
(String p_194135_0_) getGroup()
int
getId()
int
int
int
getWidth()
static ItemStack
itemFromJson
(com.google.gson.JsonObject p_199798_0_) private static Map<String,
Ingredient> keyFromJson
(com.google.gson.JsonObject p_192408_0_) private static int
lastNonSpace
(String p_194136_0_) private boolean
matches
(CraftingInventory p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) boolean
matches
(CraftingInventory p_77569_1_, World p_77569_2_) private static String[]
patternFromJson
(com.google.gson.JsonArray p_192407_0_) static void
setCraftingSize
(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, wait
Methods inherited from interface net.minecraft.item.crafting.ICraftingRecipe
getType
Methods inherited from interface net.minecraft.item.crafting.IRecipe
getRemainingItems, getToastSymbol, isSpecial
-
Field Details
-
MAX_WIDTH
static int MAX_WIDTH -
MAX_HEIGHT
static int MAX_HEIGHT -
width
private final int width -
height
private final int height -
recipeItems
-
result
-
id
-
group
-
-
Constructor Details
-
ShapedRecipe
public ShapedRecipe(ResourceLocation p_i48162_1_, String p_i48162_2_, int p_i48162_3_, int p_i48162_4_, NonNullList<Ingredient> p_i48162_5_, ItemStack p_i48162_6_)
-
-
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:
getId
in interfaceIRecipe<CraftingInventory>
-
getSerializer
- Specified by:
getSerializer
in interfaceIRecipe<CraftingInventory>
-
getGroup
- Specified by:
getGroup
in interfaceIRecipe<CraftingInventory>
-
getResultItem
- Specified by:
getResultItem
in interfaceIRecipe<CraftingInventory>
-
getIngredients
- Specified by:
getIngredients
in interfaceIRecipe<CraftingInventory>
-
canCraftInDimensions
public boolean canCraftInDimensions(int p_194133_1_, int p_194133_2_) - Specified by:
canCraftInDimensions
in interfaceIRecipe<CraftingInventory>
-
matches
- Specified by:
matches
in interfaceIRecipe<CraftingInventory>
-
matches
private boolean matches(CraftingInventory p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) -
assemble
- Specified by:
assemble
in interfaceIRecipe<CraftingInventory>
-
getWidth
public int getWidth() -
getRecipeWidth
public int getRecipeWidth()- Specified by:
getRecipeWidth
in interfaceIShapedRecipe<CraftingInventory>
-
getHeight
public int getHeight() -
getRecipeHeight
public int getRecipeHeight()- Specified by:
getRecipeHeight
in interfaceIShapedRecipe<CraftingInventory>
-
dissolvePattern
private static NonNullList<Ingredient> dissolvePattern(String[] p_192402_0_, Map<String, Ingredient> p_192402_1_, int p_192402_2_, int p_192402_3_) -
shrink
-
firstNonSpace
-
lastNonSpace
-
patternFromJson
-
keyFromJson
-
itemFromJson
-