38 lines
1011 B
Java
38 lines
1011 B
Java
package org.bukkit.event.vehicle;
|
|
|
|
import org.bukkit.entity.Entity;
|
|
import org.bukkit.entity.Vehicle;
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
/**
|
|
* Raised when a vehicle is destroyed, which could be caused by either a player
|
|
* or the environment. This is not raised if the boat is simply 'removed'
|
|
* due to other means.
|
|
*/
|
|
public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
|
private Entity attacker;
|
|
private boolean cancelled;
|
|
|
|
public VehicleDestroyEvent(Vehicle vehicle, Entity attacker) {
|
|
super(Type.VEHICLE_DESTROY, vehicle);
|
|
this.attacker = attacker;
|
|
}
|
|
|
|
/**
|
|
* Gets the Entity that has destroyed the vehicle, potentially null
|
|
*
|
|
* @return the Entity that has destroyed the vehicle, potentially null
|
|
*/
|
|
public Entity getAttacker() {
|
|
return attacker;
|
|
}
|
|
|
|
public boolean isCancelled() {
|
|
return cancelled;
|
|
}
|
|
|
|
public void setCancelled(boolean cancel) {
|
|
this.cancelled = cancel;
|
|
}
|
|
}
|