Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
InventoryEvent.java
1 
2 package org.bukkit.event.inventory;
3 
4 import java.util.List;
5 
8 import org.bukkit.event.Event;
11 
12 /**
13  * Represents a player related inventory event
14  */
15 public class InventoryEvent extends Event {
16  private static final HandlerList handlers = new HandlerList();
17  protected InventoryView transaction;
18 
19  public InventoryEvent(InventoryView transaction) {
20  this.transaction = transaction;
21  }
22 
23  /**
24  * Gets the primary Inventory involved in this transaction
25  *
26  * @return The upper inventory.
27  */
29  return transaction.getTopInventory();
30  }
31 
32  /**
33  * Gets the list of players viewing the primary (upper) inventory involved
34  * in this event
35  *
36  * @return A list of people viewing.
37  */
38  public List<HumanEntity> getViewers() {
39  return transaction.getTopInventory().getViewers();
40  }
41 
42  /**
43  * Gets the view object itself
44  *
45  * @return InventoryView
46  */
48  return transaction;
49  }
50 
51  @Override
52  public HandlerList getHandlers() {
53  return handlers;
54  }
55 
56  public static HandlerList getHandlerList() {
57  return handlers;
58  }
59 }
List< HumanEntity > getViewers()
abstract Inventory getTopInventory()