Class CursorSlot

java.lang.Object
ch.njol.skript.util.slot.Slot
ch.njol.skript.util.slot.CursorSlot
All Implemented Interfaces:
Debuggable

public class CursorSlot extends Slot
Item that represents a player's inventory cursor.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CursorSlot(org.bukkit.entity.Player player)
     
    CursorSlot(org.bukkit.entity.Player player, @Nullable org.bukkit.inventory.ItemStack eventItemStack)
    Represents the cursor as it was used in an InventoryClickEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    @Nullable org.bukkit.inventory.ItemStack
     
    org.bukkit.entity.Player
     
    boolean
     
    boolean
    Checks if given slot is in same position with this.
    void
    setAmount(int amount)
     
    void
    setItem(@Nullable org.bukkit.inventory.ItemStack item)
     
    toString(@Nullable org.bukkit.event.Event event, boolean debug)
     

    Methods inherited from class ch.njol.skript.util.slot.Slot

    toString

    Methods inherited from class java.lang.Object

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

    • CursorSlot

      public CursorSlot(org.bukkit.entity.Player player)
    • CursorSlot

      public CursorSlot(org.bukkit.entity.Player player, @Nullable org.bukkit.inventory.ItemStack eventItemStack)
      Represents the cursor as it was used in an InventoryClickEvent. Should use this constructor if the event was an InventoryClickEvent.
      Parameters:
      player - The player that this cursor slot belongs to.
      eventItemStack - The ItemStack from InventoryClickEvent.getCursor() if event is an InventoryClickEvent.
  • Method Details

    • getPlayer

      public org.bukkit.entity.Player getPlayer()
    • getItem

      public @Nullable org.bukkit.inventory.ItemStack getItem()
      Specified by:
      getItem in class Slot
    • setItem

      public void setItem(@Nullable org.bukkit.inventory.ItemStack item)
      Specified by:
      setItem in class Slot
    • getAmount

      public int getAmount()
      Specified by:
      getAmount in class Slot
    • setAmount

      public void setAmount(int amount)
      Specified by:
      setAmount in class Slot
    • isInventoryClick

      public boolean isInventoryClick()
    • isSameSlot

      public boolean isSameSlot(Slot slot)
      Description copied from class: Slot
      Checks if given slot is in same position with this. Ignores slot contents.
      Specified by:
      isSameSlot in class Slot
      Parameters:
      slot - Another slot
      Returns:
      True if positions equal, false otherwise.
    • toString

      public String toString(@Nullable org.bukkit.event.Event event, boolean debug)
      Parameters:
      event - The event to get information from. This is always null if debug == false.
      debug - If true this should print more information, if false this should print what is shown to the end user
      Returns:
      String representation of this object