@@ -5,17 +5,17 @@ import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle collides with a block.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
|
||||
private Block block;
|
||||
|
||||
|
||||
public VehicleBlockCollisionEvent(Vehicle vehicle, Block block) {
|
||||
super(Type.VEHICLE_COLLISION_BLOCK, vehicle);
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
|
||||
public Block getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle collides.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleCollisionEvent extends VehicleEvent {
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle is created.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleCreateEvent extends VehicleEvent {
|
||||
|
||||
@@ -6,31 +6,31 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle receives damage.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
||||
private Entity attacker;
|
||||
private int damage;
|
||||
private boolean cancelled;
|
||||
|
||||
|
||||
public VehicleDamageEvent(Vehicle vehicle, Entity attacker, int damage) {
|
||||
super(Type.VEHICLE_DAMAGE, vehicle);
|
||||
this.attacker = attacker;
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
|
||||
public Entity getAttacker() {
|
||||
return attacker;
|
||||
}
|
||||
|
||||
|
||||
public int getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change the damage.
|
||||
*
|
||||
*
|
||||
* @param damage
|
||||
*/
|
||||
public void setDamage(int damage) {
|
||||
@@ -44,5 +44,4 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,12 +12,12 @@ import org.bukkit.event.Cancellable;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
public Entity getAttacker() {
|
||||
return attacker;
|
||||
}
|
||||
@@ -29,5 +29,4 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when an entity enters a vehicle.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||
@@ -20,7 +20,7 @@ public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||
|
||||
/**
|
||||
* Get the entity that entered the vehicle.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Entity getEntered() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle collides with an entity.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable {
|
||||
@@ -14,12 +14,12 @@ public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implement
|
||||
private boolean cancelled = false;
|
||||
private boolean cancelledPickup = false;
|
||||
private boolean cancelledCollision = false;
|
||||
|
||||
|
||||
public VehicleEntityCollisionEvent(Vehicle vehicle, Entity entity) {
|
||||
super(Type.VEHICLE_COLLISION_ENTITY, vehicle);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
|
||||
public Entity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
@@ -31,19 +31,19 @@ public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implement
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
|
||||
public boolean isPickupCancelled() {
|
||||
return cancelledPickup;
|
||||
}
|
||||
|
||||
|
||||
public void setPickupCancelled(boolean cancel) {
|
||||
cancelledPickup = cancel;
|
||||
}
|
||||
|
||||
|
||||
public boolean isCollisionCancelled() {
|
||||
return cancelledCollision;
|
||||
}
|
||||
|
||||
|
||||
public void setCollisionCancelled(boolean cancel) {
|
||||
cancelledCollision = cancel;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.bukkit.event.Event;
|
||||
|
||||
/**
|
||||
* Represents a vehicle-related event.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEvent extends Event {
|
||||
@@ -18,7 +18,7 @@ public class VehicleEvent extends Event {
|
||||
|
||||
/**
|
||||
* Get the vehicle.
|
||||
*
|
||||
*
|
||||
* @return the vehicle
|
||||
*/
|
||||
public final Vehicle getVehicle() {
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a living entity exits a vehicle.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||
@@ -17,10 +17,10 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||
super(Type.VEHICLE_EXIT, vehicle);
|
||||
this.exited = exited;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the living entity that exited the vehicle.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public LivingEntity getExited() {
|
||||
|
||||
@@ -5,77 +5,68 @@ import org.bukkit.plugin.AuthorNagException;
|
||||
|
||||
/**
|
||||
* Listener for vehicle events.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleListener implements Listener {
|
||||
public VehicleListener() {
|
||||
}
|
||||
|
||||
public VehicleListener() {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is created by a player. This hook will be called
|
||||
* for all vehicles created.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleCreate(VehicleCreateEvent event) {
|
||||
}
|
||||
|
||||
public void onVehicleCreate(VehicleCreateEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is damaged by the player.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleDamage(VehicleDamageEvent event) {
|
||||
}
|
||||
|
||||
public void onVehicleDamage(VehicleDamageEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with a block.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) {
|
||||
}
|
||||
|
||||
public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with an entity.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
|
||||
}
|
||||
|
||||
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity enters a vehicle.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleEnter(VehicleEnterEvent event) {
|
||||
}
|
||||
|
||||
public void onVehicleEnter(VehicleEnterEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an entity exits a vehicle.
|
||||
*
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleExit(VehicleExitEvent event) {
|
||||
}
|
||||
public void onVehicleExit(VehicleExitEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when an vehicle moves.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleMove(VehicleMoveEvent event) {
|
||||
}
|
||||
public void onVehicleMove(VehicleMoveEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is destroyed.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleDestroy(VehicleDestroyEvent event) {
|
||||
}
|
||||
public void onVehicleDestroy(VehicleDestroyEvent event) {}
|
||||
|
||||
/**
|
||||
* Called when a vehicle goes through an update cycle
|
||||
@@ -83,7 +74,7 @@ public class VehicleListener implements Listener {
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleUpdate(VehicleUpdateEvent event) {
|
||||
onVehicleUpdate((VehicleEvent)event);
|
||||
onVehicleUpdate((VehicleEvent) event);
|
||||
throw new AuthorNagException("onVehicleUpdate has been replaced with a new signature, (VehicleUpdateEvent)");
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle moves.
|
||||
*
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleMoveEvent extends VehicleEvent {
|
||||
@@ -18,19 +18,19 @@ public class VehicleMoveEvent extends VehicleEvent {
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the previous position.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the next position.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Location getTo() {
|
||||
|
||||
Reference in New Issue
Block a user