Package net.minecraft.world.inventory
Class CraftingMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.RecipeBookMenu<CraftingInput,CraftingRecipe>
net.minecraft.world.inventory.CraftingMenu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerLevelAccessprivate static final intprivate static final intprivate final CraftingContainerprivate static final intprivate static final intprivate booleanprivate final Playerstatic final intprivate final ResultContainerprivate static final intprivate static final intFields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots -
Constructor Summary
ConstructorsConstructorDescriptionCraftingMenu(int pContainerId, Inventory pPlayerInventory) CraftingMenu(int pContainerId, Inventory pPlayerInventory, ContainerLevelAccess pAccess) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancanTakeItemForPickAll(ItemStack pStack, Slot pSlot) Called to determine if the current slot is valid for the stack merging (double-click) code.voidvoidfillCraftSlotsStackedContents(StackedContents pItemHelper) voidfinishPlacingRecipe(RecipeHolder<CraftingRecipe> pRecipe) intintintintgetSize()quickMoveStack(Player pPlayer, int pIndex) Handle when the stack in slotindexis shift-clicked.booleanrecipeMatches(RecipeHolder<CraftingRecipe> pRecipe) voidCalled when the container is closed.booleanshouldMoveToInventory(int pSlotIndex) protected static voidslotChangedCraftingGrid(AbstractContainerMenu pMenu, Level pLevel, Player pPlayer, CraftingContainer pCraftSlots, ResultContainer pResultSlots, RecipeHolder<CraftingRecipe> pRecipe) voidslotsChanged(Container pInventory) Callback for when the crafting matrix is changed.booleanstillValid(Player pPlayer) Determines whether supplied player can use this containerMethods inherited from class net.minecraft.world.inventory.RecipeBookMenu
getRecipeBookCategories, handlePlacementMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, checkContainerDataCount, checkContainerSize, clearContainer, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, moveItemStackTo, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
RESULT_SLOT
public static final int RESULT_SLOT- See Also:
-
CRAFT_SLOT_START
private static final int CRAFT_SLOT_START- See Also:
-
CRAFT_SLOT_END
private static final int CRAFT_SLOT_END- See Also:
-
INV_SLOT_START
private static final int INV_SLOT_START- See Also:
-
INV_SLOT_END
private static final int INV_SLOT_END- See Also:
-
USE_ROW_SLOT_START
private static final int USE_ROW_SLOT_START- See Also:
-
USE_ROW_SLOT_END
private static final int USE_ROW_SLOT_END- See Also:
-
craftSlots
-
resultSlots
-
access
-
player
-
placingRecipe
private boolean placingRecipe
-
-
Constructor Details
-
CraftingMenu
-
CraftingMenu
-
-
Method Details
-
slotChangedCraftingGrid
protected static void slotChangedCraftingGrid(AbstractContainerMenu pMenu, Level pLevel, Player pPlayer, CraftingContainer pCraftSlots, ResultContainer pResultSlots, @Nullable RecipeHolder<CraftingRecipe> pRecipe) -
slotsChanged
Callback for when the crafting matrix is changed.- Overrides:
slotsChangedin classAbstractContainerMenu
-
beginPlacingRecipe
public void beginPlacingRecipe()- Overrides:
beginPlacingRecipein classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
finishPlacingRecipe
- Overrides:
finishPlacingRecipein classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
fillCraftSlotsStackedContents
- Specified by:
fillCraftSlotsStackedContentsin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
clearCraftingContent
public void clearCraftingContent()- Specified by:
clearCraftingContentin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
recipeMatches
- Specified by:
recipeMatchesin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
removed
Called when the container is closed.- Overrides:
removedin classAbstractContainerMenu
-
stillValid
Determines whether supplied player can use this container- Specified by:
stillValidin classAbstractContainerMenu
-
quickMoveStack
Handle when the stack in slotindexis shift-clicked. Normally this moves the stack between the player inventory and the other inventory(s).- Specified by:
quickMoveStackin classAbstractContainerMenu
-
canTakeItemForPickAll
Called to determine if the current slot is valid for the stack merging (double-click) code. The stack passed in is null for the initial slot that was double-clicked.- Overrides:
canTakeItemForPickAllin classAbstractContainerMenu
-
getResultSlotIndex
public int getResultSlotIndex()- Specified by:
getResultSlotIndexin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
getGridWidth
public int getGridWidth()- Specified by:
getGridWidthin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
getGridHeight
public int getGridHeight()- Specified by:
getGridHeightin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
getSize
public int getSize()- Specified by:
getSizein classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
getRecipeBookType
- Specified by:
getRecipeBookTypein classRecipeBookMenu<CraftingInput,CraftingRecipe>
-
shouldMoveToInventory
public boolean shouldMoveToInventory(int pSlotIndex) - Specified by:
shouldMoveToInventoryin classRecipeBookMenu<CraftingInput,CraftingRecipe>
-