Package ch.njol.skript.util.slot
Class CursorSlot
java.lang.Object
ch.njol.skript.util.slot.Slot
ch.njol.skript.util.slot.CursorSlot
- All Implemented Interfaces:
Debuggable
Item that represents a player's inventory cursor.
-
Constructor Summary
ConstructorDescriptionCursorSlot
(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 TypeMethodDescriptionint
@Nullable org.bukkit.inventory.ItemStack
getItem()
org.bukkit.entity.Player
boolean
boolean
isSameSlot
(Slot slot) 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)
-
Constructor Details
-
CursorSlot
public CursorSlot(org.bukkit.entity.Player player) -
CursorSlot
public CursorSlot(org.bukkit.entity.Player player, @Nullable @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 fromInventoryClickEvent.getCursor()
if event is an InventoryClickEvent.
-
-
Method Details
-
getPlayer
public org.bukkit.entity.Player getPlayer() -
getItem
@Nullable public @Nullable org.bukkit.inventory.ItemStack getItem() -
setItem
public void setItem(@Nullable @Nullable org.bukkit.inventory.ItemStack item) -
getAmount
public int getAmount() -
setAmount
public void setAmount(int amount) -
isInventoryClick
public boolean isInventoryClick() -
isSameSlot
Description copied from class:Slot
Checks if given slot is in same position with this. Ignores slot contents.- Specified by:
isSameSlot
in classSlot
- Parameters:
slot
- Another slot- Returns:
- True if positions equal, false otherwise.
-
toString
- 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
-