Package xyz.xenondevs.invui.item.impl
Class SimpleItem
java.lang.Object
xyz.xenondevs.invui.item.impl.AbstractItem
xyz.xenondevs.invui.item.impl.SimpleItem
- All Implemented Interfaces:
Item
- Direct Known Subclasses:
CommandItem
A simple
Item
that does nothing.-
Constructor Summary
ConstructorDescriptionSimpleItem
(@NotNull org.bukkit.inventory.ItemStack itemStack) SimpleItem
(@NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable Consumer<@NotNull Click> clickHandler) SimpleItem
(@NotNull ItemProvider itemProvider) SimpleItem
(@NotNull ItemProvider itemProvider, @Nullable Consumer<@NotNull Click> clickHandler) -
Method Summary
Modifier and TypeMethodDescriptionGets 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.Methods inherited from class xyz.xenondevs.invui.item.impl.AbstractItem
addWindow, getWindows, notifyWindows, removeWindow
-
Constructor Details
-
SimpleItem
-
SimpleItem
public SimpleItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) -
SimpleItem
public SimpleItem(@NotNull @NotNull ItemProvider itemProvider, @Nullable @Nullable Consumer<@NotNull Click> clickHandler) -
SimpleItem
-
-
Method Details
-
getItemProvider
Description copied from interface:Item
Gets theItemProvider
. This method gets called every time aWindow
is notified (Item.notifyWindows()
).- Returns:
- The
ItemProvider
-
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.
-