Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
InventoryPickupItemEvent.java
1 package org.bukkit.event.inventory;
2 
3 import org.bukkit.entity.Item;
5 import org.bukkit.event.Event;
8 
9 /**
10  * Called when a hopper or hopper minecart picks up a dropped item.
11  */
12 public class InventoryPickupItemEvent extends Event implements Cancellable {
13  private static final HandlerList handlers = new HandlerList();
14  private boolean cancelled;
15  private final Inventory inventory;
16  private final Item item;
17 
18  public InventoryPickupItemEvent(final Inventory inventory, final Item item) {
19  super();
20  this.inventory = inventory;
21  this.item = item;
22  }
23 
24  /**
25  * Gets the Inventory that picked up the item
26  *
27  * @return Inventory
28  */
30  return inventory;
31  }
32 
33  /**
34  * Gets the Item entity that was picked up
35  *
36  * @return Item
37  */
38  public Item getItem() {
39  return item;
40  }
41 
42  public boolean isCancelled() {
43  return cancelled;
44  }
45 
46  public void setCancelled(boolean cancel) {
47  this.cancelled = cancel;
48  }
49 
50  @Override
51  public HandlerList getHandlers() {
52  return handlers;
53  }
54 
55  public static HandlerList getHandlerList() {
56  return handlers;
57  }
58 }