001 package org.bukkit.event.vehicle; 002 003 import org.bukkit.Location; 004 import org.bukkit.entity.Vehicle; 005 import org.bukkit.event.HandlerList; 006 007 /** 008 * Raised when a vehicle moves. 009 */ 010 public class VehicleMoveEvent extends VehicleEvent { 011 private static final HandlerList handlers = new HandlerList(); 012 private final Location from; 013 private final Location to; 014 015 public VehicleMoveEvent(final Vehicle vehicle, final Location from, final Location to) { 016 super(vehicle); 017 018 this.from = from; 019 this.to = to; 020 } 021 022 /** 023 * Get the previous position. 024 * 025 * @return Old position. 026 */ 027 public Location getFrom() { 028 return from; 029 } 030 031 /** 032 * Get the next position. 033 * 034 * @return New position. 035 */ 036 public Location getTo() { 037 return to; 038 } 039 040 041 @Override 042 public HandlerList getHandlers() { 043 return handlers; 044 } 045 046 public static HandlerList getHandlerList() { 047 return handlers; 048 } 049 }