001 package org.bukkit.event.vehicle;
002
003 import org.bukkit.entity.Entity;
004 import org.bukkit.entity.Vehicle;
005 import org.bukkit.event.Cancellable;
006 import org.bukkit.event.HandlerList;
007
008 /**
009 * Raised when a vehicle collides with an entity.
010 */
011 public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable {
012 private static final HandlerList handlers = new HandlerList();
013 private final Entity entity;
014 private boolean cancelled = false;
015 private boolean cancelledPickup = false;
016 private boolean cancelledCollision = false;
017
018 public VehicleEntityCollisionEvent(final Vehicle vehicle, final Entity entity) {
019 super(vehicle);
020 this.entity = entity;
021 }
022
023 public Entity getEntity() {
024 return entity;
025 }
026
027 public boolean isCancelled() {
028 return cancelled;
029 }
030
031 public void setCancelled(boolean cancel) {
032 this.cancelled = cancel;
033 }
034
035 public boolean isPickupCancelled() {
036 return cancelledPickup;
037 }
038
039 public void setPickupCancelled(boolean cancel) {
040 cancelledPickup = cancel;
041 }
042
043 public boolean isCollisionCancelled() {
044 return cancelledCollision;
045 }
046
047 public void setCollisionCancelled(boolean cancel) {
048 cancelledCollision = cancel;
049 }
050
051 @Override
052 public HandlerList getHandlers() {
053 return handlers;
054 }
055
056 public static HandlerList getHandlerList() {
057 return handlers;
058 }
059 }