Implemented vehicle hooks (some changes will still be made).

This commit is contained in:
sk89q
2011-01-03 16:52:44 +08:00
committed by Dinner Bone
parent 0a418f8fb9
commit 30f7da4d0b
12 changed files with 348 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
package org.bukkit.event.vehicle;
import org.bukkit.LivingEntity;
import org.bukkit.Vehicle;
import org.bukkit.event.Cancellable;
/**
* Raised when a living entity enters a vehicle.
*
* @author sk89q
*/
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
private boolean cancelled;
private LivingEntity entered;
public VehicleEnterEvent(Type type, Vehicle vehicle, LivingEntity entered) {
super(type, vehicle);
this.entered = entered;
}
/**
* Get the living entity that entered the vehicle.
*
* @return
*/
public LivingEntity getEntered() {
return entered;
}
public boolean isCancelled() {
return cancelled;
}
public void setCancelled(boolean cancel) {
this.cancelled = cancel;
}
}