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
ConstructorDescriptionAbstractMergedWindow
(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 contentinventories
associated with thisWindow
.protected Pair
<AbstractGui, Integer> getGuiAt
(int index) Gets theAbstractGui
at the given index.getGuis()
protected SlotElement
getSlotElement
(int index) Gets theSlotElement
at the given index.protected Pair
<AbstractGui, Integer> getWhereClicked
(org.bukkit.event.inventory.InventoryClickEvent event) Gets theAbstractGui
and the slot where the player clicked, based on the givenInventoryClickEvent
.void
handleSlotElementUpdate
(Gui child, int slotIndex) Called by the childGui
to 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, setUpperInvItem
Methods 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
- ThePlayer
that views the window.title
- The title of the window.gui
- TheGui
of the window.upperInventory
- TheInventory
of the window.closeable
- Whether the window is closeable.
-
-
Method Details
-
handleSlotElementUpdate
Description copied from interface:GuiParent
Called by the childGui
to report an update of aSlotElement
.- Parameters:
child
- The childGui
whoseSlotElement
has changedslotIndex
- The slot index of the changedSlotElement
in the childGui
-
getSlotElement
Description copied from class:AbstractWindow
Gets theSlotElement
at the given index.- Specified by:
getSlotElement
in classAbstractWindow
- Parameters:
index
- The index of the slot.- Returns:
- The
SlotElement
at the given index.
-
getWhereClicked
protected Pair<AbstractGui,Integer> getWhereClicked(org.bukkit.event.inventory.InventoryClickEvent event) Description copied from class:AbstractDoubleWindow
Gets theAbstractGui
and the slot where the player clicked, based on the givenInventoryClickEvent
.- Specified by:
getWhereClicked
in classAbstractDoubleWindow
- Parameters:
event
- TheInventoryClickEvent
that was triggered.- Returns:
- The
AbstractGui
and the slot where the player clicked.
-
getGuiAt
Description copied from class:AbstractWindow
Gets theAbstractGui
at the given index.- Specified by:
getGuiAt
in classAbstractWindow
- Parameters:
index
- The index of the slot.- Returns:
- The
AbstractGui
it's slot at that slot.
-
getGuis
Description copied from class:AbstractWindow
- Specified by:
getGuis
in classAbstractWindow
- Returns:
- The guis displayed with this window.
-
getContentInventories
Description copied from class:AbstractWindow
Gets the contentinventories
associated with thisWindow
. These are not UI inventories, but actual inventories contained inside theGui
, such asVirtualInventory
- Specified by:
getContentInventories
in classAbstractWindow
- Returns:
- The content inventories associated with this window.
-