类 ShapedRecipe
java.lang.Object
net.minecraft.world.item.crafting.ShapedRecipe
- 所有已实现的接口:
CraftingRecipe
,Recipe<CraftingContainer>
,IShapedRecipe<CraftingContainer>
- 直接已知子类:
MapExtendingRecipe
public class ShapedRecipe
extends Object
implements CraftingRecipe, IShapedRecipe<CraftingContainer>
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明(专用程序包) final CraftingBookCategory
(专用程序包) final String
(专用程序包) final int
private final ResourceLocation
(专用程序包) static int
(专用程序包) static int
(专用程序包) final NonNullList<Ingredient>
(专用程序包) final ItemStack
(专用程序包) final boolean
(专用程序包) final int
-
构造器概要
构造器构造器说明ShapedRecipe
(ResourceLocation pId, String pGroup, CraftingBookCategory pCategory, int pWidth, int pHeight, NonNullList<Ingredient> pRecipeItems, ItemStack pResult) ShapedRecipe
(ResourceLocation pId, String pGroup, CraftingBookCategory pCategory, int pWidth, int pHeight, NonNullList<Ingredient> pRecipeItems, ItemStack pResult, boolean pShowNotification) -
方法概要
修饰符和类型方法说明assemble
(CraftingContainer pContainer, RegistryAccess pRegistryAccess) boolean
canCraftInDimensions
(int pWidth, int pHeight) category()
(专用程序包) static NonNullList<Ingredient>
dissolvePattern
(String[] pPattern, Map<String, Ingredient> pKeys, int pPatternWidth, int pPatternHeight) private static int
firstNonSpace
(String pEntry) getGroup()
int
getId()
int
int
getResultItem
(RegistryAccess pRegistryAccess) int
getWidth()
boolean
static Item
itemFromJson
(com.google.gson.JsonObject pItemObject) static ItemStack
itemStackFromJson
(com.google.gson.JsonObject pStackObject) (专用程序包) static Map<String,
Ingredient> keyFromJson
(com.google.gson.JsonObject pKeyEntry) private static int
lastNonSpace
(String pEntry) private boolean
matches
(CraftingContainer pCraftingInventory, int pWidth, int pHeight, boolean pMirrored) boolean
matches
(CraftingContainer pInv, Level pLevel) (专用程序包) static String[]
patternFromJson
(com.google.gson.JsonArray pPatternArray) static void
setCraftingSize
(int width, int height) Expand the max width and height allowed in the deserializer.boolean
(专用程序包) static String[]
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.minecraft.world.item.crafting.CraftingRecipe
getType
从接口继承的方法 net.minecraft.world.item.crafting.Recipe
getRemainingItems, getToastSymbol, isSpecial
-
字段详细资料
-
MAX_WIDTH
static int MAX_WIDTH -
MAX_HEIGHT
static int MAX_HEIGHT -
width
final int width -
height
final int height -
recipeItems
-
result
-
id
-
group
-
category
-
showNotification
final boolean showNotification
-
-
构造器详细资料
-
ShapedRecipe
public ShapedRecipe(ResourceLocation pId, String pGroup, CraftingBookCategory pCategory, int pWidth, int pHeight, NonNullList<Ingredient> pRecipeItems, ItemStack pResult, boolean pShowNotification) -
ShapedRecipe
public ShapedRecipe(ResourceLocation pId, String pGroup, CraftingBookCategory pCategory, int pWidth, int pHeight, NonNullList<Ingredient> pRecipeItems, ItemStack pResult)
-
-
方法详细资料
-
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.- 参数:
width
- your max recipe widthheight
- your max recipe height
-
getId
- 指定者:
getId
在接口中Recipe<CraftingContainer>
-
getSerializer
- 指定者:
getSerializer
在接口中Recipe<CraftingContainer>
-
getGroup
- 指定者:
getGroup
在接口中Recipe<CraftingContainer>
-
category
- 指定者:
category
在接口中CraftingRecipe
-
getResultItem
- 指定者:
getResultItem
在接口中Recipe<CraftingContainer>
-
getIngredients
- 指定者:
getIngredients
在接口中Recipe<CraftingContainer>
-
showNotification
public boolean showNotification()- 指定者:
showNotification
在接口中Recipe<CraftingContainer>
-
canCraftInDimensions
public boolean canCraftInDimensions(int pWidth, int pHeight) - 指定者:
canCraftInDimensions
在接口中Recipe<CraftingContainer>
-
matches
- 指定者:
matches
在接口中Recipe<CraftingContainer>
-
matches
private boolean matches(CraftingContainer pCraftingInventory, int pWidth, int pHeight, boolean pMirrored) -
assemble
- 指定者:
assemble
在接口中Recipe<CraftingContainer>
-
getWidth
public int getWidth() -
getRecipeWidth
public int getRecipeWidth()- 指定者:
getRecipeWidth
在接口中IShapedRecipe<CraftingContainer>
-
getHeight
public int getHeight() -
getRecipeHeight
public int getRecipeHeight()- 指定者:
getRecipeHeight
在接口中IShapedRecipe<CraftingContainer>
-
dissolvePattern
static NonNullList<Ingredient> dissolvePattern(String[] pPattern, Map<String, Ingredient> pKeys, int pPatternWidth, int pPatternHeight) -
shrink
-
isIncomplete
public boolean isIncomplete()- 指定者:
isIncomplete
在接口中Recipe<CraftingContainer>
-
firstNonSpace
-
lastNonSpace
-
patternFromJson
-
keyFromJson
-
itemStackFromJson
-
itemFromJson
-