Package xyz.xenondevs.invui.item
Interface Item
- All Known Implementing Classes:
AbstractItem
,AsyncItem
,AutoCycleItem
,AutoUpdateItem
,CommandItem
,ControlItem
,CycleItem
,PageItem
,ScrollItem
,SimpleItem
,SuppliedItem
,TabItem
public interface Item
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWindow
(AbstractWindow window) Adds anAbstractWindow
to the window set, telling theItem
that it is currently being displayed in thatAbstractWindow
.Gets theItemProvider
.void
handleClick
(@NotNull org.bukkit.event.inventory.ClickType clickType, @NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.event.inventory.InventoryClickEvent event) A method called if theItemStack
associated to thisItem
has been clicked by a player.void
Calls a refresh method on everyWindow
in which thisItem
is displayed, notifying them that theItemProvider
has been updated, thus theItemStack
inside theWindow
'sInventory
should be replaced.void
removeWindow
(AbstractWindow window) Removes anAbstractWindow
from the window set, telling theItem
that it is no longer being displayed in thatAbstractWindow
.
-
Method Details
-
getItemProvider
ItemProvider getItemProvider()- Returns:
- The
ItemProvider
-
addWindow
Adds anAbstractWindow
to the window set, telling theItem
that it is currently being displayed in thatAbstractWindow
.- Parameters:
window
- TheAbstractWindow
theItem
is currently displayed in.
-
removeWindow
Removes anAbstractWindow
from the window set, telling theItem
that it is no longer being displayed in thatAbstractWindow
.- Parameters:
window
- TheAbstractWindow
theItem
is no longer displayed in.
-
getWindows
-
notifyWindows
void notifyWindows()Calls a refresh method on everyWindow
in which thisItem
is displayed, notifying them that theItemProvider
has been updated, thus theItemStack
inside theWindow
'sInventory
should be replaced. -
handleClick
void handleClick(@NotNull @NotNull org.bukkit.event.inventory.ClickType clickType, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent event) A method called if theItemStack
associated to thisItem
has been clicked by a player.- Parameters:
clickType
- TheClickType
thePlayer
performed.player
- ThePlayer
who clicked on theItemStack
.event
- TheInventoryClickEvent
associated with this click.
-