Package ch.njol.skript.util.slot
Class InventorySlot
java.lang.Object
ch.njol.skript.util.slot.Slot
ch.njol.skript.util.slot.SlotWithIndex
ch.njol.skript.util.slot.InventorySlot
- All Implemented Interfaces:
Debuggable
Represents a slot in some inventory.
-
Constructor Summary
ConstructorDescriptionInventorySlot
(org.bukkit.inventory.Inventory invi, int index) InventorySlot
(org.bukkit.inventory.Inventory invi, int index, int rawIndex) -
Method Summary
Modifier and TypeMethodDescriptionint
int
getIndex()
Gets an index of this slot.org.bukkit.inventory.Inventory
@Nullable org.bukkit.inventory.ItemStack
getItem()
int
Gets the raw index of this slot.void
setAmount
(int amount) void
setItem
(@Nullable org.bukkit.inventory.ItemStack item) toString
(@Nullable org.bukkit.event.Event e, boolean debug) Methods inherited from class ch.njol.skript.util.slot.SlotWithIndex
isSameSlot
-
Constructor Details
-
InventorySlot
public InventorySlot(org.bukkit.inventory.Inventory invi, int index, int rawIndex) -
InventorySlot
public InventorySlot(org.bukkit.inventory.Inventory invi, int index)
-
-
Method Details
-
getInventory
public org.bukkit.inventory.Inventory getInventory() -
getIndex
public int getIndex()Description copied from class:SlotWithIndex
Gets an index of this slot.- Specified by:
getIndex
in classSlotWithIndex
- Returns:
- Index of the slot.
-
getRawIndex
public int getRawIndex()Description copied from class:SlotWithIndex
Gets the raw index of this slot.- Overrides:
getRawIndex
in classSlotWithIndex
- Returns:
- Raw index of the slot.
-
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) -
toString
- Parameters:
e
- 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
-