Class PageClick

    • Constructor Summary

      Constructors 
      Constructor Description
      PageClick​(PagedInventory pagedInventory, Page page, org.bukkit.inventory.ItemStack clickedItem, org.bukkit.entity.Player clicker, org.bukkit.event.inventory.ClickType clickType, int slot, int rawSlot, int hotbarButton)  
    • Constructor Detail

      • PageClick

        public PageClick​(PagedInventory pagedInventory,
                         Page page,
                         org.bukkit.inventory.ItemStack clickedItem,
                         org.bukkit.entity.Player clicker,
                         org.bukkit.event.inventory.ClickType clickType,
                         int slot,
                         int rawSlot,
                         int hotbarButton)
    • Method Detail

      • getPagedInventory

        @NotNull
        public @NotNull PagedInventory getPagedInventory()
        Returns the PagedInventory instance from which the click came.
        Returns:
        paged inventory
      • getPage

        @NotNull
        public @NotNull Page getPage()
        Returns the clicked Page
        Returns:
        page
      • getClickedItem

        @Nullable
        public @Nullable org.bukkit.inventory.ItemStack getClickedItem()
        Returns the clicked ItemStack
        Returns:
        item
      • getClicker

        @NotNull
        public @NotNull org.bukkit.entity.Player getClicker()
        Returns the Player, whom have clicked on the item.
        Returns:
        player, clicker
      • getClickType

        @NotNull
        public @NotNull org.bukkit.event.inventory.ClickType getClickType()
        Returns the getClickedItem() 's triggered click type.
        Returns:
        click type
      • getSlot

        public int getSlot()
        Took from InventoryClickEvent: The slot number that was clicked, ready for passing to Inventory.getItem(int). Note that there may be two slots with the same slot number, since a view links two different inventories.
        Returns:
        The slot number.
      • getRawSlot

        public int getRawSlot()
        Took from InventoryClickEvent: The raw slot number clicked, ready for passing to #getItem(int) This slot number is unique for the view.
        Returns:
        the slot number
      • getHotbarButton

        public int getHotbarButton()
        Took from InventoryClickEvent: If the ClickType is NUMBER_KEY, this method will return the index of the pressed key (0-8).
        Returns:
        the number on the key minus 1 (range 0-8); or -1 if not a NUMBER_KEY action