Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerDropItemEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Item;
4 import org.bukkit.entity.Player;
7 
8 /**
9  * Thrown when a player drops an item from their inventory
10  */
11 public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private final Item drop;
14  private boolean cancel = false;
15 
16  public PlayerDropItemEvent(final Player player, final Item drop) {
17  super(player);
18  this.drop = drop;
19  }
20 
21  /**
22  * Gets the ItemDrop created by the player
23  *
24  * @return ItemDrop created by the player
25  */
26  public Item getItemDrop() {
27  return drop;
28  }
29 
30  public boolean isCancelled() {
31  return cancel;
32  }
33 
34  public void setCancelled(boolean cancel) {
35  this.cancel = cancel;
36  }
37 
38  @Override
39  public HandlerList getHandlers() {
40  return handlers;
41  }
42 
43  public static HandlerList getHandlerList() {
44  return handlers;
45  }
46 }