|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.event.Event org.bukkit.event.inventory.InventoryEvent org.bukkit.event.inventory.InventoryClickEvent
public class InventoryClickEvent
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.bukkit.event.Event |
---|
Event.Result |
Field Summary |
---|
Fields inherited from class org.bukkit.event.inventory.InventoryEvent |
---|
transaction |
Constructor Summary | |
---|---|
InventoryClickEvent(InventoryView what,
InventoryType.SlotType type,
int slot,
boolean right,
boolean shift)
|
Method Summary | |
---|---|
ItemStack |
getCurrentItem()
Get the current item in the clicked slot. |
ItemStack |
getCursor()
Get the current item on the cursor. |
static HandlerList |
getHandlerList()
|
HandlerList |
getHandlers()
|
int |
getRawSlot()
The raw slot number, which is unique for the view. |
Event.Result |
getResult()
|
int |
getSlot()
The slot number that was clicked, ready for passing to Inventory.getItem(int) . |
InventoryType.SlotType |
getSlotType()
Get the type of slot that was clicked. |
HumanEntity |
getWhoClicked()
Get the player who performed the click. |
boolean |
isCancelled()
Gets the cancellation state of this event. |
boolean |
isLeftClick()
|
boolean |
isRightClick()
|
boolean |
isShiftClick()
Shift can be combined with right-click or left-click as a modifier. |
void |
setCancelled(boolean toCancel)
Sets the cancellation state of this event. |
void |
setCurrentItem(ItemStack what)
Set the current item in the slot. |
void |
setCursor(ItemStack what)
Set the item on the cursor. |
void |
setResult(Event.Result newResult)
|
Methods inherited from class org.bukkit.event.inventory.InventoryEvent |
---|
getInventory, getView, getViewers |
Methods inherited from class org.bukkit.event.Event |
---|
getEventName, isAsynchronous |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InventoryClickEvent(InventoryView what, InventoryType.SlotType type, int slot, boolean right, boolean shift)
Method Detail |
---|
public InventoryType.SlotType getSlotType()
public ItemStack getCursor()
public ItemStack getCurrentItem()
public boolean isRightClick()
public boolean isLeftClick()
public boolean isShiftClick()
public void setResult(Event.Result newResult)
public Event.Result getResult()
public HumanEntity getWhoClicked()
public void setCursor(ItemStack what)
what
- The new cursor item.public void setCurrentItem(ItemStack what)
what
- The new slot item.public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean toCancel)
Cancellable
setCancelled
in interface Cancellable
toCancel
- true if you wish to cancel this eventpublic int getSlot()
Inventory.getItem(int)
. Note
that there may be two slots with the same slot number, since a view links two different inventories.
public int getRawSlot()
public HandlerList getHandlers()
getHandlers
in class InventoryEvent
public static HandlerList getHandlerList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |