Class CraftingMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.RecipeBookMenu
net.minecraft.world.inventory.AbstractCraftingMenu
net.minecraft.world.inventory.CraftingMenu
-
Nested Class Summary
Nested classes/interfaces inherited from class RecipeBookMenu
RecipeBookMenu.PostPlaceAction -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerLevelAccessprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate booleanprivate final Playerstatic final intprivate static final intprivate static final intFields inherited from class AbstractCraftingMenu
craftSlots, resultSlots -
Constructor Summary
ConstructorsConstructorDescriptionCraftingMenu(int containerId, Inventory inventory) CraftingMenu(int containerId, Inventory inventory, ContainerLevelAccess access) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancanTakeItemForPickAll(ItemStack carried, Slot target) Called to determine if the current slot is valid for the stack merging (double-click) code.voidfinishPlacingRecipe(ServerLevel level, RecipeHolder<CraftingRecipe> recipe) protected Playerowner()quickMoveStack(Player player, int slotIndex) Handle when the stack in slotindexis shift-clicked.voidCalled when the container is closed.protected static voidslotChangedCraftingGrid(AbstractContainerMenu menu, ServerLevel level, Player player, CraftingContainer container, ResultContainer resultSlots, @Nullable RecipeHolder<CraftingRecipe> recipeHint) voidslotsChanged(Container container) Callback for when the crafting matrix is changed.booleanstillValid(Player player) Determines whether supplied player can use this containerMethods inherited from class AbstractCraftingMenu
addCraftingGridSlots, addResultSlot, fillCraftSlotsStackedContents, getGridHeight, getGridWidth, handlePlacementMethods inherited from class AbstractContainerMenu
addDataSlot, addDataSlots, addInventoryExtendedSlots, addInventoryHotbarSlots, addSlot, addSlotListener, addStandardInventorySlots, 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, setRemoteSlotUnsafe, setSelectedBundleItemIndex, setSynchronizer, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
CRAFTING_GRID_WIDTH
private static final int CRAFTING_GRID_WIDTH- See Also:
-
CRAFTING_GRID_HEIGHT
private static final int CRAFTING_GRID_HEIGHT- See Also:
-
RESULT_SLOT
public static final int RESULT_SLOT- See Also:
-
CRAFT_SLOT_START
private static final int CRAFT_SLOT_START- See Also:
-
CRAFT_SLOT_COUNT
private static final int CRAFT_SLOT_COUNT- 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:
-
access
-
player
-
placingRecipe
private boolean placingRecipe
-
-
Constructor Details
-
CraftingMenu
-
CraftingMenu
-
-
Method Details
-
slotChangedCraftingGrid
protected static void slotChangedCraftingGrid(AbstractContainerMenu menu, ServerLevel level, Player player, CraftingContainer container, ResultContainer resultSlots, @Nullable RecipeHolder<CraftingRecipe> recipeHint) -
slotsChanged
Callback for when the crafting matrix is changed.- Overrides:
slotsChangedin classAbstractContainerMenu
-
beginPlacingRecipe
public void beginPlacingRecipe()- Overrides:
beginPlacingRecipein classAbstractCraftingMenu
-
finishPlacingRecipe
- Overrides:
finishPlacingRecipein classAbstractCraftingMenu
-
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
-
getResultSlot
- Specified by:
getResultSlotin classAbstractCraftingMenu
-
getInputGridSlots
- Specified by:
getInputGridSlotsin classAbstractCraftingMenu
-
getRecipeBookType
- Specified by:
getRecipeBookTypein classRecipeBookMenu
-
owner
- Specified by:
ownerin classAbstractCraftingMenu
-