Package xyz.xenondevs.invui.item.impl
Class AutoCycleItem
java.lang.Object
xyz.xenondevs.invui.item.impl.AbstractItem
xyz.xenondevs.invui.item.impl.AutoCycleItem
- All Implemented Interfaces:
Item
An
Item
that automatically cycles through a predefined array of
ItemProvider
at a predefined speed.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addWindow
(AbstractWindow window) Adds anAbstractWindow
to the window set, telling theItem
that it is currently being displayed in thatAbstractWindow
.void
cancel()
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
removeWindow
(AbstractWindow window) Removes anAbstractWindow
from the window set, telling theItem
that it is no longer being displayed in thatAbstractWindow
.void
start()
Methods inherited from class xyz.xenondevs.invui.item.impl.AbstractItem
getWindows, notifyWindows
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface xyz.xenondevs.invui.item.Item
getItemProvider
-
Constructor Details
-
AutoCycleItem
-
-
Method Details
-
start
public void start() -
cancel
public void cancel() -
getItemProvider
Description copied from interface:Item
Gets theItemProvider
. This method gets called every time aWindow
is notified (Item.notifyWindows()
).- Returns:
- The
ItemProvider
-
addWindow
Description copied from interface:Item
Adds anAbstractWindow
to the window set, telling theItem
that it is currently being displayed in thatAbstractWindow
.- Specified by:
addWindow
in interfaceItem
- Overrides:
addWindow
in classAbstractItem
- Parameters:
window
- TheAbstractWindow
theItem
is currently displayed in.
-
removeWindow
Description copied from interface:Item
Removes anAbstractWindow
from the window set, telling theItem
that it is no longer being displayed in thatAbstractWindow
.- Specified by:
removeWindow
in interfaceItem
- Overrides:
removeWindow
in classAbstractItem
- Parameters:
window
- TheAbstractWindow
theItem
is no longer displayed in.
-
handleClick
public 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) Description copied from interface:Item
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.
-