Class ShapedRecipePattern
java.lang.Object
net.minecraft.world.item.crafting.ShapedRecipePattern
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<ShapedRecipePattern.Data> static final charprivate final intprivate final intprivate final List<Optional<Ingredient>> static final com.mojang.serialization.MapCodec<ShapedRecipePattern> private static final intDeprecated.(package private) static int(package private) static intstatic final StreamCodec<RegistryFriendlyByteBuf, ShapedRecipePattern> private final booleanprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionShapedRecipePattern(int pWidth, int pHeight, List<Optional<Ingredient>> pIngredients, Optional<ShapedRecipePattern.Data> pData) -
Method Summary
Modifier and TypeMethodDescriptionprivate static ShapedRecipePatterncreateFromNetwork(Integer pWidth, Integer pHeight, List<Optional<Ingredient>> pIngredients) private static intfirstNonEmpty(String pRow) static intstatic intintheight()private static intlastNonEmpty(String pRow) booleanmatches(CraftingInput pInput) private booleanmatches(CraftingInput pInput, boolean pSymmetrical) static ShapedRecipePatternof(Map<Character, Ingredient> pKey, String... pPattern) static ShapedRecipePatternstatic voidsetCraftingSize(int width, int height) Expand the max width and height allowed in the deserializer.(package private) static String[]private static com.mojang.serialization.DataResult<ShapedRecipePattern> unpack(ShapedRecipePattern.Data pData) intwidth()
-
Field Details
-
MAX_SIZE
Deprecated.Neo: usegetMaxWidth()andgetMaxHeight()- See Also:
-
EMPTY_SLOT
public static final char EMPTY_SLOT- See Also:
-
maxWidth
static int maxWidth -
maxHeight
static int maxHeight -
MAP_CODEC
-
STREAM_CODEC
-
width
private final int width -
height
private final int height -
ingredients
-
data
-
ingredientCount
private final int ingredientCount -
symmetrical
private final boolean symmetrical
-
-
Constructor Details
-
ShapedRecipePattern
public ShapedRecipePattern(int pWidth, int pHeight, List<Optional<Ingredient>> pIngredients, Optional<ShapedRecipePattern.Data> pData)
-
-
Method Details
-
getMaxWidth
public static int getMaxWidth() -
getMaxHeight
public static int getMaxHeight() -
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
-
createFromNetwork
private static ShapedRecipePattern createFromNetwork(Integer pWidth, Integer pHeight, List<Optional<Ingredient>> pIngredients) -
of
-
of
-
unpack
private static com.mojang.serialization.DataResult<ShapedRecipePattern> unpack(ShapedRecipePattern.Data pData) -
shrink
-
firstNonEmpty
-
lastNonEmpty
-
matches
-
matches
-
width
public int width() -
height
public int height() -
ingredients
-
getMaxWidth()andgetMaxHeight()