Package org.moddingx.libx.menu
Class DefaultMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
org.moddingx.libx.menu.MenuBase
org.moddingx.libx.menu.DefaultMenu
- Direct Known Subclasses:
BlockMenu
,EntityMenu
A base class for menus that handles basic menu logic such as shift-clicks,
and laying out slots.
There are some things you need to pay attention to if you want to use this:
- Always add player inventory slots with
MenuBase.layoutPlayerInventorySlots(int, int)
- Add input slots, THEN output slots and THEN player inventory.
- firstOutputSlot = the number of input slot you have / the first output slot number
- firstInventorySlot = the number of input slots and output slots you have / the first player inventory slot number
-
Field Summary
Modifier and TypeFieldDescriptionfinal int
final int
protected final net.minecraft.world.level.Level
protected final net.minecraft.world.entity.player.Player
Fields inherited from class org.moddingx.libx.menu.MenuBase
playerInventory
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
ModifierConstructorDescriptionprotected
DefaultMenu
(net.minecraft.world.inventory.MenuType<?> type, int windowId, net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player, int firstOutputSlot, int firstInventorySlot) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.Level
getLevel()
net.minecraft.world.item.ItemStack
quickMoveStack
(net.minecraft.world.entity.player.Player player, int index) Methods inherited from class org.moddingx.libx.menu.MenuBase
addSlotBox, addSlotBox, addSlotRange, addSlotRange, layoutPlayerInventorySlots, moveItemStackTo
Methods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removed, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
player
protected final net.minecraft.world.entity.player.Player player -
level
protected final net.minecraft.world.level.Level level -
firstOutputSlot
public final int firstOutputSlot -
firstInventorySlot
public final int firstInventorySlot
-
-
Constructor Details
-
DefaultMenu
protected DefaultMenu(@Nullable net.minecraft.world.inventory.MenuType<?> type, int windowId, net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.world.entity.player.Player player, int firstOutputSlot, int firstInventorySlot)
-
-
Method Details