@@ -10,10 +10,10 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Block block;
|
||||
private final Block block;
|
||||
|
||||
public VehicleBlockCollisionEvent(Vehicle vehicle, Block block) {
|
||||
super(Type.VEHICLE_COLLISION_BLOCK, vehicle);
|
||||
public VehicleBlockCollisionEvent(final Vehicle vehicle, final Block block) {
|
||||
super(vehicle);
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.bukkit.entity.Vehicle;
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class VehicleCollisionEvent extends VehicleEvent {
|
||||
public VehicleCollisionEvent(Type type, Vehicle vehicle) {
|
||||
super(type, vehicle);
|
||||
public VehicleCollisionEvent(final Vehicle vehicle) {
|
||||
super(vehicle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleCreateEvent extends VehicleEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
public VehicleCreateEvent(Vehicle vehicle) {
|
||||
super(Type.VEHICLE_CREATE, vehicle);
|
||||
public VehicleCreateEvent(final Vehicle vehicle) {
|
||||
super(vehicle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,12 +11,12 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Entity attacker;
|
||||
private final Entity attacker;
|
||||
private int damage;
|
||||
private boolean cancelled;
|
||||
|
||||
public VehicleDamageEvent(Vehicle vehicle, Entity attacker, int damage) {
|
||||
super(Type.VEHICLE_DAMAGE, vehicle);
|
||||
public VehicleDamageEvent(final Vehicle vehicle, final Entity attacker, final int damage) {
|
||||
super(vehicle);
|
||||
this.attacker = attacker;
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Entity attacker;
|
||||
private final Entity attacker;
|
||||
private boolean cancelled;
|
||||
|
||||
public VehicleDestroyEvent(Vehicle vehicle, Entity attacker) {
|
||||
super(Type.VEHICLE_DESTROY, vehicle);
|
||||
public VehicleDestroyEvent(final Vehicle vehicle, final Entity attacker) {
|
||||
super(vehicle);
|
||||
this.attacker = attacker;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ import org.bukkit.event.HandlerList;
|
||||
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
private Entity entered;
|
||||
private final Entity entered;
|
||||
|
||||
public VehicleEnterEvent(Vehicle vehicle, Entity entered) {
|
||||
super(Type.VEHICLE_ENTER, vehicle);
|
||||
public VehicleEnterEvent(final Vehicle vehicle, final Entity entered) {
|
||||
super(vehicle);
|
||||
this.entered = entered;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Entity entity;
|
||||
private final Entity entity;
|
||||
private boolean cancelled = false;
|
||||
private boolean cancelledPickup = false;
|
||||
private boolean cancelledCollision = false;
|
||||
|
||||
public VehicleEntityCollisionEvent(Vehicle vehicle, Entity entity) {
|
||||
super(Type.VEHICLE_COLLISION_ENTITY, vehicle);
|
||||
public VehicleEntityCollisionEvent(final Vehicle vehicle, final Entity entity) {
|
||||
super(vehicle);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,7 @@ import org.bukkit.event.Event;
|
||||
public abstract class VehicleEvent extends Event {
|
||||
protected Vehicle vehicle;
|
||||
|
||||
public VehicleEvent(final Event.Type type, final Vehicle vehicle) {
|
||||
super(type);
|
||||
public VehicleEvent(final Vehicle vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ import org.bukkit.event.HandlerList;
|
||||
public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private boolean cancelled;
|
||||
private LivingEntity exited;
|
||||
private final LivingEntity exited;
|
||||
|
||||
public VehicleExitEvent(Vehicle vehicle, LivingEntity exited) {
|
||||
super(Type.VEHICLE_EXIT, vehicle);
|
||||
public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) {
|
||||
super(vehicle);
|
||||
this.exited = exited;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Listener for vehicle events.
|
||||
*/
|
||||
@Deprecated
|
||||
public class VehicleListener implements Listener {
|
||||
public VehicleListener() {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is created by a player. This hook will be called
|
||||
* for all vehicles created.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleCreate(VehicleCreateEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is damaged by the player.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleDamage(VehicleDamageEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with a block.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with an entity.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity enters a vehicle.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleEnter(VehicleEnterEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity exits a vehicle.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleExit(VehicleExitEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an vehicle moves.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleMove(VehicleMoveEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is destroyed.
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleDestroy(VehicleDestroyEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle goes through an update cycle
|
||||
*
|
||||
* @param event The event
|
||||
*/
|
||||
public void onVehicleUpdate(VehicleUpdateEvent event) {}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleMoveEvent extends VehicleEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private Location from;
|
||||
private Location to;
|
||||
private final Location from;
|
||||
private final Location to;
|
||||
|
||||
public VehicleMoveEvent(Vehicle vehicle, Location from, Location to) {
|
||||
super(Type.VEHICLE_MOVE, vehicle);
|
||||
public VehicleMoveEvent(final Vehicle vehicle, final Location from, final Location to) {
|
||||
super(vehicle);
|
||||
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
|
||||
@@ -6,8 +6,9 @@ import org.bukkit.event.HandlerList;
|
||||
@SuppressWarnings("serial")
|
||||
public class VehicleUpdateEvent extends VehicleEvent {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
public VehicleUpdateEvent(Vehicle vehicle) {
|
||||
super(Type.VEHICLE_UPDATE, vehicle);
|
||||
|
||||
public VehicleUpdateEvent(final Vehicle vehicle) {
|
||||
super(vehicle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user