Class ShapedRecipePattern
java.lang.Object
net.minecraft.world.item.crafting.ShapedRecipePattern
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Optional
<ShapedRecipePattern.Data> private final int
private final int
private final NonNullList
<Ingredient> static final com.mojang.serialization.MapCodec
<ShapedRecipePattern> private static final int
Deprecated.(package private) static int
(package private) static int
static final StreamCodec
<RegistryFriendlyByteBuf, ShapedRecipePattern> private final boolean
private final int
-
Constructor Summary
ConstructorDescriptionShapedRecipePattern
(int p_311959_, int p_312714_, NonNullList<Ingredient> p_312761_, Optional<ShapedRecipePattern.Data> p_312427_) -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
firstNonSpace
(String p_312343_) private static ShapedRecipePattern
fromNetwork
(RegistryFriendlyByteBuf p_319788_) static int
static int
int
height()
private static int
lastNonSpace
(String p_311944_) boolean
matches
(CraftingInput p_345063_) private boolean
matches
(CraftingInput p_345835_, boolean p_344990_) static ShapedRecipePattern
of
(Map<Character, Ingredient> p_312851_, String... p_312645_) static ShapedRecipePattern
static void
setCraftingSize
(int width, int height) Expand the max width and height allowed in the deserializer.(package private) static String[]
private void
toNetwork
(RegistryFriendlyByteBuf p_320098_) private static com.mojang.serialization.DataResult
<ShapedRecipePattern> unpack
(ShapedRecipePattern.Data p_312037_) int
width()
-
Field Details
-
MAX_SIZE
Deprecated.Neo: usegetMaxWidth()
andgetMaxHeight()
- 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 p_311959_, int p_312714_, NonNullList<Ingredient> p_312761_, Optional<ShapedRecipePattern.Data> p_312427_)
-
-
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
-
of
-
of
-
unpack
private static com.mojang.serialization.DataResult<ShapedRecipePattern> unpack(ShapedRecipePattern.Data p_312037_) -
shrink
-
firstNonSpace
-
lastNonSpace
-
matches
-
matches
-
toNetwork
-
fromNetwork
-
width
public int width() -
height
public int height() -
ingredients
-
getMaxWidth()
andgetMaxHeight()