Package xyz.xenondevs.invui.window
Class AbstractMergedWindow
java.lang.Object
xyz.xenondevs.invui.window.AbstractWindow
xyz.xenondevs.invui.window.AbstractDoubleWindow
xyz.xenondevs.invui.window.AbstractMergedWindow
A
Window where top and player Inventory are affected by the same Gui.
Only in very rare circumstances should this class be used directly.
Instead, use Window.merged() to create such a Window.
-
Nested Class Summary
Nested classes/interfaces inherited from class xyz.xenondevs.invui.window.AbstractWindow
AbstractWindow.AbstractBuilder<W extends Window,S extends Window.Builder<W, S>> Nested classes/interfaces inherited from interface xyz.xenondevs.invui.window.Window
Window.Builder<W extends Window,S extends Window.Builder<W, S>> -
Field Summary
Fields inherited from class xyz.xenondevs.invui.window.AbstractDoubleWindow
upperInventory -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMergedWindow(org.bukkit.entity.Player player, xyz.xenondevs.inventoryaccess.component.ComponentWrapper title, AbstractGui gui, org.bukkit.inventory.Inventory upperInventory, boolean closeable) Creates a newAbstractMergedWindow. -
Method Summary
Modifier and TypeMethodDescriptionGets the contentinventoriesassociated with thisWindow.protected Pair<AbstractGui, Integer> getGuiAt(int index) Gets theAbstractGuiat the given index.getGuis()protected SlotElementgetSlotElement(int index) Gets theSlotElementat the given index.protected Pair<AbstractGui, Integer> getWhereClicked(org.bukkit.event.inventory.InventoryClickEvent event) Gets theAbstractGuiand the slot where the player clicked, based on the givenInventoryClickEvent.voidhandleSlotElementUpdate(Gui child, int slotIndex) Called by the childGuito report an update of aSlotElement.Methods inherited from class xyz.xenondevs.invui.window.AbstractDoubleWindow
getInventories, getPlayerInventory, getPlayerItems, getUpperInventory, handleClick, handleClosed, handleItemShift, handleOpened, handleViewerDeath, initItems, redrawItem, setInvItem, setPlayerInvItem, setUpperInvItemMethods inherited from class xyz.xenondevs.invui.window.AbstractWindow
addCloseHandler, addOpenHandler, addOutsideClickHandler, changeTitle, changeTitle, changeTitle, close, getCurrentViewer, getInvSlotElements, getItemSlotElements, getLang, getViewer, getViewerUUID, handleClickEvent, handleCloseEvent, handleCursorCollect, handleDragEvent, handleInventoryUpdate, handleItemProviderUpdate, handleOpenEvent, isCloseable, isOpen, open, openInventory, redrawItem, removeCloseHandler, removeOutsideClickHandler, setCloseable, setCloseHandlers, setOpenHandlers, setOutsideClickHandlers
-
Constructor Details
-
AbstractMergedWindow
public AbstractMergedWindow(org.bukkit.entity.Player player, xyz.xenondevs.inventoryaccess.component.ComponentWrapper title, AbstractGui gui, org.bukkit.inventory.Inventory upperInventory, boolean closeable) Creates a newAbstractMergedWindow.- Parameters:
player- ThePlayerthat views the window.title- The title of the window.gui- TheGuiof the window.upperInventory- TheInventoryof the window.closeable- Whether the window is closeable.
-
-
Method Details
-
handleSlotElementUpdate
Description copied from interface:GuiParentCalled by the childGuito report an update of aSlotElement.- Parameters:
child- The childGuiwhoseSlotElementhas changedslotIndex- The slot index of the changedSlotElementin the childGui
-
getSlotElement
Description copied from class:AbstractWindowGets theSlotElementat the given index.- Specified by:
getSlotElementin classAbstractWindow- Parameters:
index- The index of the slot.- Returns:
- The
SlotElementat the given index.
-
getWhereClicked
protected Pair<AbstractGui,Integer> getWhereClicked(org.bukkit.event.inventory.InventoryClickEvent event) Description copied from class:AbstractDoubleWindowGets theAbstractGuiand the slot where the player clicked, based on the givenInventoryClickEvent.- Specified by:
getWhereClickedin classAbstractDoubleWindow- Parameters:
event- TheInventoryClickEventthat was triggered.- Returns:
- The
AbstractGuiand the slot where the player clicked.
-
getGuiAt
Description copied from class:AbstractWindowGets theAbstractGuiat the given index.- Specified by:
getGuiAtin classAbstractWindow- Parameters:
index- The index of the slot.- Returns:
- The
AbstractGuiit's slot at that slot.
-
getGuis
Description copied from class:AbstractWindow- Specified by:
getGuisin classAbstractWindow- Returns:
- The guis displayed with this window.
-
getContentInventories
Description copied from class:AbstractWindowGets the contentinventoriesassociated with thisWindow. These are not UI inventories, but actual inventories contained inside theGui, such asVirtualInventory- Specified by:
getContentInventoriesin classAbstractWindow- Returns:
- The content inventories associated with this window.
-