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,AnyAmount,AnyNamed,AnyProvider
Represents a slot in some inventory.
-
Constructor Summary
ConstructorsConstructorDescriptionInventorySlot(org.bukkit.inventory.Inventory inventory, int index) InventorySlot(org.bukkit.inventory.Inventory inventory, int index, int rawIndex) -
Method Summary
Modifier and TypeMethodDescriptionintintgetIndex()Gets an index of this slot.org.bukkit.inventory.Inventory@Nullable org.bukkit.inventory.ItemStackgetItem()intGets the raw index of this slot.booleanisSameSlot(Slot slot) Checks if given slot is in same position with this.voidsetAmount(int amount) voidsetItem(@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
amount, name, setAmount, setName, supportsAmountChange, supportsNameChange, toString
-
Constructor Details
-
InventorySlot
public InventorySlot(org.bukkit.inventory.Inventory inventory, int index, int rawIndex) -
InventorySlot
public InventorySlot(org.bukkit.inventory.Inventory inventory, int index)
-
-
Method Details
-
getInventory
public org.bukkit.inventory.Inventory getInventory() -
getIndex
public int getIndex()Description copied from class:SlotWithIndexGets an index of this slot.- Specified by:
getIndexin classSlotWithIndex- Returns:
- Index of the slot.
-
getRawIndex
public int getRawIndex()Description copied from class:SlotWithIndexGets the raw index of this slot.- Overrides:
getRawIndexin 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) -
isSameSlot
Description copied from class:SlotChecks if given slot is in same position with this. Ignores slot contents.- Overrides:
isSameSlotin classSlotWithIndex- 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
-