Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
VehicleEntityCollisionEvent.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 collides with an entity.
10  */
12  private static final HandlerList handlers = new HandlerList();
13  private final Entity entity;
14  private boolean cancelled = false;
15  private boolean cancelledPickup = false;
16  private boolean cancelledCollision = false;
17 
18  public VehicleEntityCollisionEvent(final Vehicle vehicle, final Entity entity) {
19  super(vehicle);
20  this.entity = entity;
21  }
22 
23  public Entity getEntity() {
24  return entity;
25  }
26 
27  public boolean isCancelled() {
28  return cancelled;
29  }
30 
31  public void setCancelled(boolean cancel) {
32  this.cancelled = cancel;
33  }
34 
35  public boolean isPickupCancelled() {
36  return cancelledPickup;
37  }
38 
39  public void setPickupCancelled(boolean cancel) {
40  cancelledPickup = cancel;
41  }
42 
43  public boolean isCollisionCancelled() {
44  return cancelledCollision;
45  }
46 
47  public void setCollisionCancelled(boolean cancel) {
48  cancelledCollision = cancel;
49  }
50 
51  @Override
52  public HandlerList getHandlers() {
53  return handlers;
54  }
55 
56  public static HandlerList getHandlerList() {
57  return handlers;
58  }
59 }