50 lines
985 B
Java
50 lines
985 B
Java
package org.bukkit.event.vehicle;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.entity.Vehicle;
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
/**
|
|
* Raised when a vehicle moves.
|
|
*/
|
|
public class VehicleMoveEvent extends VehicleEvent {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
private final Location from;
|
|
private final Location to;
|
|
|
|
public VehicleMoveEvent(final Vehicle vehicle, final Location from, final Location to) {
|
|
super(vehicle);
|
|
|
|
this.from = from;
|
|
this.to = to;
|
|
}
|
|
|
|
/**
|
|
* Get the previous position.
|
|
*
|
|
* @return Old position.
|
|
*/
|
|
public Location getFrom() {
|
|
return from;
|
|
}
|
|
|
|
/**
|
|
* Get the next position.
|
|
*
|
|
* @return New position.
|
|
*/
|
|
public Location getTo() {
|
|
return to;
|
|
}
|
|
|
|
|
|
@Override
|
|
public HandlerList getHandlers() {
|
|
return handlers;
|
|
}
|
|
|
|
public static HandlerList getHandlerList() {
|
|
return handlers;
|
|
}
|
|
}
|