Package net.minecraft.world.inventory
Class StonecutterMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.StonecutterMenu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerLevelAccessfinal Containerprivate ItemStackThe ItemStack set in the input slot by the player.static final int(package private) final Slotprivate static final intprivate static final int(package private) longStores the game time of the last time the player took items from the the crafting result slot.private final Levelstatic final int(package private) final ResultContainerThe inventory that stores the output of the crafting recipe.(package private) final SlotThe inventory slot that stores the output of the crafting recipe.(package private) final DataSlotThe index of the selected recipe in the GUI.(package private) Runnableprivate 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, SLOT_SIZE, slots, SLOTS_PER_ROW -
Constructor Summary
ConstructorsConstructorDescriptionStonecutterMenu(int pContainerId, Inventory pPlayerInventory) StonecutterMenu(int pContainerId, Inventory pPlayerInventory, ContainerLevelAccess pAccess) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanTakeItemForPickAll(ItemStack pStack, Slot pSlot) Called to determine if the current slot is valid for the stack merging (double-click) code.booleanclickMenuButton(Player pPlayer, int pId) Handles the given Button-click on the server.intintMenuType<?> getType()booleanprivate booleanisValidRecipeIndex(int pRecipeIndex) quickMoveStack(Player pPlayer, int pIndex) Handle when the stack in slotindexis shift-clicked.voidregisterUpdateListener(Runnable pListener) voidCalled when the container is closed.private voidsetupRecipeList(ItemStack pStack) (package private) voidsetupResultSlot(int pId) 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.AbstractContainerMenu
addDataSlot, addDataSlots, addInventoryExtendedSlots, addInventoryHotbarSlots, addSlot, addSlotListener, addStandardInventorySlots, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, checkContainerDataCount, checkContainerSize, clearContainer, clicked, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, moveItemStackTo, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotUnsafe, setSelectedBundleItemIndex, setSynchronizer, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
INPUT_SLOT
public static final int INPUT_SLOT- See Also:
-
RESULT_SLOT
public static final int RESULT_SLOT- 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
-
selectedRecipeIndex
The index of the selected recipe in the GUI. -
level
-
recipesForInput
-
input
The ItemStack set in the input slot by the player. -
lastSoundTime
long lastSoundTimeStores the game time of the last time the player took items from the the crafting result slot. This is used to prevent the sound from being played multiple times on the same tick. -
inputSlot
-
resultSlot
The inventory slot that stores the output of the crafting recipe. -
slotUpdateListener
Runnable slotUpdateListener -
container
-
resultContainer
The inventory that stores the output of the crafting recipe.
-
-
Constructor Details
-
StonecutterMenu
-
StonecutterMenu
-
-
Method Details
-
getSelectedRecipeIndex
public int getSelectedRecipeIndex() -
getVisibleRecipes
-
getNumberOfVisibleRecipes
public int getNumberOfVisibleRecipes() -
hasInputItem
public boolean hasInputItem() -
stillValid
Determines whether supplied player can use this container- Specified by:
stillValidin classAbstractContainerMenu
-
clickMenuButton
Handles the given Button-click on the server.- Overrides:
clickMenuButtonin classAbstractContainerMenu
-
isValidRecipeIndex
private boolean isValidRecipeIndex(int pRecipeIndex) -
slotsChanged
Callback for when the crafting matrix is changed.- Overrides:
slotsChangedin classAbstractContainerMenu
-
setupRecipeList
-
setupResultSlot
void setupResultSlot(int pId) -
getType
- Overrides:
getTypein classAbstractContainerMenu
-
registerUpdateListener
-
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
-
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
-
removed
Called when the container is closed.- Overrides:
removedin classAbstractContainerMenu
-