Class ItemClick

java.lang.Object
dev.aurelium.slate.item.ItemClick
Direct Known Subclasses:
TemplateClick

public class ItemClick extends Object
Stores contextual data for when a player clicks an item.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemClick(Slate slate, org.bukkit.entity.Player player, org.bukkit.event.inventory.InventoryClickEvent event, org.bukkit.inventory.ItemStack item, SlotPos pos, ActiveMenu menu)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.event.inventory.InventoryClickEvent
    Gets the original Bukkit event for the inventory click.
    org.bukkit.inventory.ItemStack
    Gets the ItemStack that was clicked.
    Gets the locale of the player as defined by the GlobalBehavior.localeProvider().
    Gets the active menu the player is viewing.
    org.bukkit.entity.Player
    Gets the player that clicked the item.
    pos()
    Gets the slot position that was clicked.

    Methods inherited from class java.lang.Object

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

    • ItemClick

      public ItemClick(Slate slate, org.bukkit.entity.Player player, org.bukkit.event.inventory.InventoryClickEvent event, org.bukkit.inventory.ItemStack item, SlotPos pos, ActiveMenu menu)
  • Method Details

    • player

      public org.bukkit.entity.Player player()
      Gets the player that clicked the item.
      Returns:
      the player
    • locale

      public Locale locale()
      Gets the locale of the player as defined by the GlobalBehavior.localeProvider(). If the locale provider is not set, this will always return Locale.ENGLISH. This is useful if you have player-dependent locales.
      Returns:
      the locale of the player
    • event

      public org.bukkit.event.inventory.InventoryClickEvent event()
      Gets the original Bukkit event for the inventory click.
      Returns:
      the InventoryClickEvent
    • item

      public org.bukkit.inventory.ItemStack item()
      Gets the ItemStack that was clicked.
      Returns:
      the clicked ItemStack
    • pos

      public SlotPos pos()
      Gets the slot position that was clicked.
      Returns:
      the clicked slot