Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ItemSpawnEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.entity.Item;
4 import org.bukkit.Location;
7 
8 /**
9  * Called when an item is spawned into a world
10  */
11 public class ItemSpawnEvent extends EntityEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private final Location location;
14  private boolean canceled;
15 
16  public ItemSpawnEvent(final Item spawnee, final Location loc) {
17  super(spawnee);
18  this.location = loc;
19  }
20 
21  public boolean isCancelled() {
22  return canceled;
23  }
24 
25  public void setCancelled(boolean cancel) {
26  canceled = cancel;
27  }
28 
29  @Override
30  public Item getEntity() {
31  return (Item) entity;
32  }
33 
34  /**
35  * Gets the location at which the item is spawning.
36  *
37  * @return The location at which the item is spawning
38  */
39  public Location getLocation() {
40  return location;
41  }
42 
43  @Override
44  public HandlerList getHandlers() {
45  return handlers;
46  }
47 
48  public static HandlerList getHandlerList() {
49  return handlers;
50  }
51 }