Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
VehicleDestroyEvent.java
1 package org.bukkit.event.vehicle;
2 
3 import org.bukkit.entity.Entity;
4 import org.bukkit.entity.Vehicle;
7 
8 /**
9  * Raised when a vehicle is destroyed, which could be caused by either a
10  * player or the environment. This is not raised if the boat is simply
11  * 'removed' due to other means.
12  */
13 public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
14  private static final HandlerList handlers = new HandlerList();
15  private final Entity attacker;
16  private boolean cancelled;
17 
18  public VehicleDestroyEvent(final Vehicle vehicle, final Entity attacker) {
19  super(vehicle);
20  this.attacker = attacker;
21  }
22 
23  /**
24  * Gets the Entity that has destroyed the vehicle, potentially null
25  *
26  * @return the Entity that has destroyed the vehicle, potentially null
27  */
28  public Entity getAttacker() {
29  return attacker;
30  }
31 
32  public boolean isCancelled() {
33  return cancelled;
34  }
35 
36  public void setCancelled(boolean cancel) {
37  this.cancelled = cancel;
38  }
39 
40  @Override
41  public HandlerList getHandlers() {
42  return handlers;
43  }
44 
45  public static HandlerList getHandlerList() {
46  return handlers;
47  }
48 }