Package xyz.xenondevs.invui.item.impl
Class AsyncItem
java.lang.Object
xyz.xenondevs.invui.item.impl.AbstractItem
xyz.xenondevs.invui.item.impl.AsyncItem
- All Implemented Interfaces:
Item
An
Item that creates it's ItemProvider asynchronously and displays
a placeholder ItemProvider until the actual ItemProvider has been created.-
Constructor Summary
ConstructorsConstructorDescriptionAsyncItem(@NotNull Supplier<? extends ItemProvider> providerSupplier) AsyncItem(@Nullable ItemProvider itemProvider, @NotNull Supplier<? extends ItemProvider> providerSupplier) -
Method Summary
Modifier and TypeMethodDescriptionGets theItemProvider.voidhandleClick(@NotNull org.bukkit.event.inventory.ClickType clickType, @NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.event.inventory.InventoryClickEvent event) A method called if theItemStackassociated to thisItemhas been clicked by a player.Methods inherited from class xyz.xenondevs.invui.item.impl.AbstractItem
addWindow, getWindows, notifyWindows, removeWindowMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface xyz.xenondevs.invui.item.Item
getItemProvider
-
Constructor Details
-
AsyncItem
public AsyncItem(@Nullable @Nullable ItemProvider itemProvider, @NotNull @NotNull Supplier<? extends ItemProvider> providerSupplier) -
AsyncItem
-
-
Method Details
-
getItemProvider
Description copied from interface:ItemGets theItemProvider. This method gets called every time aWindowis 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:ItemA method called if theItemStackassociated to thisItemhas been clicked by a player.- Parameters:
clickType- TheClickTypethePlayerperformed.player- ThePlayerwho clicked on theItemStack.event- TheInventoryClickEventassociated with this click.
-