Class ModalItem

java.lang.Object
io.rhythmknights.coreapi.component.modal.ModalItem

public class ModalItem extends Object
ModalItem represents the ItemStack on the Inventory
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModalItem(@NotNull org.bukkit.Material material)
    Alternate constructor that takes Material instead of an ItemStack but without a ModalAction
    ModalItem(@NotNull org.bukkit.Material material, @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
    Alternate constructor that takes Material instead of an ItemStack
    ModalItem(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Secondary constructor with no action
    ModalItem(@NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
    Main constructor of the ModalItem
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable ModalAction<org.bukkit.event.inventory.InventoryClickEvent>
    Gets the ModalAction to do when the player clicks on it
    @NotNull org.bukkit.inventory.ItemStack
    Gets the ModalItem's ItemStack
    void
    setAction(@Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
    Replaces the ModalAction of the current Modal Item
    void
    setItemStack(@NotNull org.bukkit.inventory.ItemStack itemStack)
    Replaces the ItemStack of the Modal Item

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModalItem

      public ModalItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @Nullable @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
      Main constructor of the ModalItem
      Parameters:
      itemStack - The ItemStack to be used
      action - The ModalAction to run when clicking on the Item
    • ModalItem

      public ModalItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Secondary constructor with no action
      Parameters:
      itemStack - The ItemStack to be used
    • ModalItem

      public ModalItem(@NotNull @NotNull org.bukkit.Material material)
      Alternate constructor that takes Material instead of an ItemStack but without a ModalAction
      Parameters:
      material - The Material to be used when invoking class
    • ModalItem

      public ModalItem(@NotNull @NotNull org.bukkit.Material material, @Nullable @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
      Alternate constructor that takes Material instead of an ItemStack
      Parameters:
      material - The Material to be used when invoking class
      action - The ModalAction should be passed on InventoryClickEvent
  • Method Details

    • getItemStack

      @NotNull public @NotNull org.bukkit.inventory.ItemStack getItemStack()
      Gets the ModalItem's ItemStack
      Returns:
      The ItemStack
    • setItemStack

      public void setItemStack(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Replaces the ItemStack of the Modal Item
      Parameters:
      itemStack - The new ItemStack
    • getAction

      @Nullable public @Nullable ModalAction<org.bukkit.event.inventory.InventoryClickEvent> getAction()
      Gets the ModalAction to do when the player clicks on it
    • setAction

      public void setAction(@Nullable @Nullable ModalAction<@NotNull org.bukkit.event.inventory.InventoryClickEvent> action)
      Replaces the ModalAction of the current Modal Item
      Parameters:
      action - The new ModalAction to set