Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.event.inventory.InventoryClickEvent Class Reference
+ Inheritance diagram for org.bukkit.event.inventory.InventoryClickEvent:
+ Collaboration diagram for org.bukkit.event.inventory.InventoryClickEvent:

Public Member Functions

 InventoryClickEvent (InventoryView what, SlotType type, int slot, boolean right, boolean shift)
 
SlotType getSlotType ()
 Get the type of slot that was clicked.
 
ItemStack getCursor ()
 Get the current item on the cursor.
 
ItemStack getCurrentItem ()
 Get the current item in the clicked slot.
 
boolean isRightClick ()
 
boolean isLeftClick ()
 
boolean isShiftClick ()
 Shift can be combined with right-click or left-click as a modifier.
 
void setResult (Result newResult)
 
Result getResult ()
 
HumanEntity getWhoClicked ()
 Get the player who performed the click.
 
void setCursor (ItemStack what)
 Set the item on the cursor.
 
void setCurrentItem (ItemStack what)
 Set the current item in the slot.
 
boolean isCancelled ()
 
void setCancelled (boolean toCancel)
 
int getSlot ()
 The slot number that was clicked, ready for passing to Inventory#getItem(int).
 
int getRawSlot ()
 The raw slot number, which is unique for the view.
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.inventory.InventoryEvent
 InventoryEvent (InventoryView transaction)
 
Inventory getInventory ()
 Gets the primary Inventory involved in this transaction.
 
List< HumanEntitygetViewers ()
 Gets the list of players viewing the primary (upper) inventory involved in this event.
 
InventoryView getView ()
 Gets the view object itself.
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 The default constructor is defined for cleaner code.
 
 Event (boolean isAsync)
 This constructor is used to explicitly declare an event as synchronous or asynchronous.
 
String getEventName ()
 
final boolean isAsynchronous ()
 Any custom event that should not by synchronized with other events must use the specific constructor.
 
- Public Member Functions inherited from org.bukkit.event.Cancellable
boolean isCancelled ()
 Gets the cancellation state of this event.
 
void setCancelled (boolean cancel)
 Sets the cancellation state of this event.
 

Static Public Member Functions

static HandlerList getHandlerList ()
 
- Static Public Member Functions inherited from org.bukkit.event.inventory.InventoryEvent
static HandlerList getHandlerList ()
 

Additional Inherited Members

- Protected Attributes inherited from org.bukkit.event.inventory.InventoryEvent
InventoryView transaction
 

Detailed Description

Definition at line 11 of file InventoryClickEvent.java.

Constructor & Destructor Documentation

org.bukkit.event.inventory.InventoryClickEvent.InventoryClickEvent ( InventoryView  what,
SlotType  type,
int  slot,
boolean  right,
boolean  shift 
)

Member Function Documentation

ItemStack org.bukkit.event.inventory.InventoryClickEvent.getCurrentItem ( )
ItemStack org.bukkit.event.inventory.InventoryClickEvent.getCursor ( )

Get the current item on the cursor.

Returns
The cursor item

Definition at line 42 of file InventoryClickEvent.java.

References org.bukkit.inventory.InventoryView.getCursor(), and org.bukkit.event.inventory.InventoryEvent.getView().

static HandlerList org.bukkit.event.inventory.InventoryClickEvent.getHandlerList ( )
static

Definition at line 140 of file InventoryClickEvent.java.

HandlerList org.bukkit.event.inventory.InventoryClickEvent.getHandlers ( )
virtual

Implements org.bukkit.event.Event.

Definition at line 136 of file InventoryClickEvent.java.

int org.bukkit.event.inventory.InventoryClickEvent.getRawSlot ( )

The raw slot number, which is unique for the view.

Returns
The slot number.

Definition at line 131 of file InventoryClickEvent.java.

Result org.bukkit.event.inventory.InventoryClickEvent.getResult ( )

Definition at line 81 of file InventoryClickEvent.java.

int org.bukkit.event.inventory.InventoryClickEvent.getSlot ( )

The slot number that was clicked, ready for passing to Inventory#getItem(int).

Note that there may be two slots with the same slot number, since a view links two different inventories.

Returns
The slot number.

Definition at line 123 of file InventoryClickEvent.java.

SlotType org.bukkit.event.inventory.InventoryClickEvent.getSlotType ( )

Get the type of slot that was clicked.

Returns
The slot type.

Definition at line 34 of file InventoryClickEvent.java.

HumanEntity org.bukkit.event.inventory.InventoryClickEvent.getWhoClicked ( )

Get the player who performed the click.

Returns
The clicking player.

Definition at line 89 of file InventoryClickEvent.java.

References org.bukkit.inventory.InventoryView.getPlayer(), and org.bukkit.event.inventory.InventoryEvent.getView().

boolean org.bukkit.event.inventory.InventoryClickEvent.isCancelled ( )

Definition at line 110 of file InventoryClickEvent.java.

References org.bukkit.event.Event.Result.DENY.

boolean org.bukkit.event.inventory.InventoryClickEvent.isLeftClick ( )
Returns
True if the click is a left-click.

Definition at line 65 of file InventoryClickEvent.java.

boolean org.bukkit.event.inventory.InventoryClickEvent.isRightClick ( )
Returns
True if the click is a right-click.

Definition at line 58 of file InventoryClickEvent.java.

boolean org.bukkit.event.inventory.InventoryClickEvent.isShiftClick ( )

Shift can be combined with right-click or left-click as a modifier.

Returns
True if the click is a shift-click.

Definition at line 73 of file InventoryClickEvent.java.

void org.bukkit.event.inventory.InventoryClickEvent.setCancelled ( boolean  toCancel)
void org.bukkit.event.inventory.InventoryClickEvent.setCurrentItem ( ItemStack  what)

Set the current item in the slot.

Parameters
whatThe new slot item.

Definition at line 105 of file InventoryClickEvent.java.

References org.bukkit.event.inventory.InventoryEvent.getView(), org.bukkit.event.inventory.InventoryType.SlotType.OUTSIDE, and org.bukkit.inventory.InventoryView.setItem().

void org.bukkit.event.inventory.InventoryClickEvent.setCursor ( ItemStack  what)

Set the item on the cursor.

Parameters
whatThe new cursor item.

Definition at line 97 of file InventoryClickEvent.java.

References org.bukkit.event.inventory.InventoryEvent.getView(), and org.bukkit.inventory.InventoryView.setCursor().

void org.bukkit.event.inventory.InventoryClickEvent.setResult ( Result  newResult)

Definition at line 77 of file InventoryClickEvent.java.


The documentation for this class was generated from the following file: