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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final intprivate final ResourceLocation(package private) static int(package private) static intprivate final NonNullList<Ingredient>private final ItemStackprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionShapedRecipe(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_) booleancanCraftInDimensions(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 intfirstNonSpace(String p_194135_0_) getGroup()intgetId()intintintgetWidth()static ItemStackitemFromJson(com.google.gson.JsonObject p_199798_0_) private static Map<String,Ingredient> keyFromJson(com.google.gson.JsonObject p_192408_0_) private static intlastNonSpace(String p_194136_0_) private booleanmatches(CraftingInventory p_77573_1_, int p_77573_2_, int p_77573_3_, boolean p_77573_4_) booleanmatches(CraftingInventory p_77569_1_, World p_77569_2_) private static String[]patternFromJson(com.google.gson.JsonArray p_192407_0_) 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.item.crafting.ICraftingRecipe
getTypeMethods 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:
getIdin interfaceIRecipe<CraftingInventory>
-
getSerializer
- Specified by:
getSerializerin interfaceIRecipe<CraftingInventory>
-
getGroup
- Specified by:
getGroupin interfaceIRecipe<CraftingInventory>
-
getResultItem
- Specified by:
getResultItemin interfaceIRecipe<CraftingInventory>
-
getIngredients
- Specified by:
getIngredientsin interfaceIRecipe<CraftingInventory>
-
canCraftInDimensions
public boolean canCraftInDimensions(int p_194133_1_, int p_194133_2_) - Specified by:
canCraftInDimensionsin interfaceIRecipe<CraftingInventory>
-
matches
- Specified by:
matchesin 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:
assemblein interfaceIRecipe<CraftingInventory>
-
getWidth
public int getWidth() -
getRecipeWidth
public int getRecipeWidth()- Specified by:
getRecipeWidthin interfaceIShapedRecipe<CraftingInventory>
-
getHeight
public int getHeight() -
getRecipeHeight
public int getRecipeHeight()- Specified by:
getRecipeHeightin 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
-