Package xyz.xenondevs.invui.window
Class AbstractSplitWindow
java.lang.Object
xyz.xenondevs.invui.window.AbstractWindow
xyz.xenondevs.invui.window.AbstractDoubleWindow
xyz.xenondevs.invui.window.AbstractSplitWindow
A
Window where top and player Inventory are affected by different Guis.
Only in very rare circumstances should this class be used directly.
Instead, use Window.split() to create such a Window.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstractSplitWindow.AbstractBuilder<W extends Window,S extends Window.Builder.Double<W, S>> Builder forAbstractSplitWindow.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
ConstructorsConstructorDescriptionAbstractSplitWindow(org.bukkit.entity.Player player, xyz.xenondevs.inventoryaccess.component.ComponentWrapper title, AbstractGui upperGui, AbstractGui lowerGui, org.bukkit.inventory.Inventory upperInventory, boolean closeable) Creates a newAbstractSplitWindow. -
Method Summary
Modifier and TypeMethodDescriptionGets the contentinventoriesassociated with thisWindow.protected Pair<AbstractGui, Integer> getGuiAt(int index) Gets theAbstractGuiat the given index.getGuis()getSlotElement(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
-
AbstractSplitWindow
public AbstractSplitWindow(org.bukkit.entity.Player player, xyz.xenondevs.inventoryaccess.component.ComponentWrapper title, AbstractGui upperGui, AbstractGui lowerGui, org.bukkit.inventory.Inventory upperInventory, boolean closeable) Creates a newAbstractSplitWindow.- Parameters:
player- ThePlayerthat views the window.title- The title of the window.upperGui- TheGuiof the upper part of the window.lowerGui- TheGuiof the lower part of the window.upperInventory- TheInventoryof the upper part of 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.
-