Package net.minecraft.world.inventory
Class EnchantmentMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.EnchantmentMenu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerLevelAccess
final int[]
(package private) static final ResourceLocation
final int[]
private final DataSlot
private final Container
final int[]
private final RandomSource
Fields 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
ConstructorsConstructorDescriptionEnchantmentMenu
(int pContainerId, Inventory pPlayerInventory) EnchantmentMenu
(int pContainerId, Inventory pPlayerInventory, ContainerLevelAccess pAccess) -
Method Summary
Modifier and TypeMethodDescriptionboolean
clickMenuButton
(Player pPlayer, int pId) Handles the given Button-click on the server, currently only used by enchanting.private List
<EnchantmentInstance> getEnchantmentList
(RegistryAccess pRegistryAccess, ItemStack pStack, int pSlot, int pCost) int
int
quickMoveStack
(Player pPlayer, int pIndex) Handle when the stack in slotindex
is shift-clicked.void
Called when the container is closed.void
slotsChanged
(Container pInventory) Callback for when the crafting matrix is changed.boolean
stillValid
(Player pPlayer) Determines whether supplied player can use this containerMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clicked, 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
-
EMPTY_SLOT_LAPIS_LAZULI
-
enchantSlots
-
access
-
random
-
enchantmentSeed
-
costs
public final int[] costs -
enchantClue
public final int[] enchantClue -
levelClue
public final int[] levelClue
-
-
Constructor Details
-
EnchantmentMenu
-
EnchantmentMenu
-
-
Method Details
-
slotsChanged
Callback for when the crafting matrix is changed.- Overrides:
slotsChanged
in classAbstractContainerMenu
-
clickMenuButton
Handles the given Button-click on the server, currently only used by enchanting. Name is for legacy.- Overrides:
clickMenuButton
in classAbstractContainerMenu
-
getEnchantmentList
private List<EnchantmentInstance> getEnchantmentList(RegistryAccess pRegistryAccess, ItemStack pStack, int pSlot, int pCost) -
getGoldCount
public int getGoldCount() -
getEnchantmentSeed
public int getEnchantmentSeed() -
removed
Called when the container is closed.- Overrides:
removed
in classAbstractContainerMenu
-
stillValid
Determines whether supplied player can use this container- Specified by:
stillValid
in classAbstractContainerMenu
-
quickMoveStack
Handle when the stack in slotindex
is shift-clicked. Normally this moves the stack between the player inventory and the other inventory(s).- Specified by:
quickMoveStack
in classAbstractContainerMenu
-