Class EnchantmentMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
net.minecraft.world.inventory.EnchantmentMenu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContainerLevelAccessfinal int[]private static final Identifierfinal int[]private final DataSlotprivate final Containerfinal int[]private final RandomSource -
Constructor Summary
ConstructorsConstructorDescriptionEnchantmentMenu(int containerId, Inventory inventory) EnchantmentMenu(int containerId, Inventory inventory, ContainerLevelAccess access) -
Method Summary
Modifier and TypeMethodDescriptionbooleanclickMenuButton(Player player, int buttonId) Handles the given Button-click on the server, currently only used by enchanting.private List<EnchantmentInstance> getEnchantmentList(RegistryAccess access, ItemStack itemStack, int slot, int enchantmentCost) intintquickMoveStack(Player player, int slotIndex) Handle when the stack in slotindexis shift-clicked.voidCalled when the container is closed.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 AbstractContainerMenu
addDataSlot, addDataSlots, addInventoryExtendedSlots, addInventoryHotbarSlots, addSlot, addSlotListener, addStandardInventorySlots, 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, setRemoteSlotUnsafe, setSelectedBundleItemIndex, 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:
slotsChangedin classAbstractContainerMenu
-
clickMenuButton
Handles the given Button-click on the server, currently only used by enchanting. Name is for legacy.- Overrides:
clickMenuButtonin classAbstractContainerMenu
-
getEnchantmentList
private List<EnchantmentInstance> getEnchantmentList(RegistryAccess access, ItemStack itemStack, int slot, int enchantmentCost) -
getGoldCount
public int getGoldCount() -
getEnchantmentSeed
public int getEnchantmentSeed() -
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
-