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 an entity enters a vehicle. 010 */ 011 public class VehicleEnterEvent extends VehicleEvent implements Cancellable { 012 private static final HandlerList handlers = new HandlerList(); 013 private boolean cancelled; 014 private final Entity entered; 015 016 public VehicleEnterEvent(final Vehicle vehicle, final Entity entered) { 017 super(vehicle); 018 this.entered = entered; 019 } 020 021 /** 022 * Gets the Entity that entered the vehicle. 023 * 024 * @return the Entity that entered the vehicle 025 */ 026 public Entity getEntered() { 027 return entered; 028 } 029 030 public boolean isCancelled() { 031 return cancelled; 032 } 033 034 public void setCancelled(boolean cancel) { 035 this.cancelled = cancel; 036 } 037 038 @Override 039 public HandlerList getHandlers() { 040 return handlers; 041 } 042 043 public static HandlerList getHandlerList() { 044 return handlers; 045 } 046 }