Line endings, consistency!

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-03-27 21:27:27 +01:00
parent 125a380385
commit 9418264170
25 changed files with 823 additions and 823 deletions

View File

@ -1,24 +1,24 @@
/** /**
* *
*/ */
package org.bukkit.entity; package org.bukkit.entity;
import org.bukkit.material.Colorable; import org.bukkit.material.Colorable;
/** /**
* Represents a Sheep. * Represents a Sheep.
* *
* @author Cogito * @author Cogito
* *
*/ */
public interface Sheep extends Animals, Colorable { public interface Sheep extends Animals, Colorable {
/** /**
* @author Celtic Minstrel * @author Celtic Minstrel
* @return Whether the sheep is sheared. * @return Whether the sheep is sheared.
*/ */
public boolean isSheared(); public boolean isSheared();
/** /**
* @author Celtic Minstrel * @author Celtic Minstrel
* @param flag Whether to shear the sheep * @param flag Whether to shear the sheep
*/ */
public void setSheared(boolean flag); public void setSheared(boolean flag);
} }

View File

@ -1,23 +1,23 @@
/** /**
* *
*/ */
package org.bukkit.entity; package org.bukkit.entity;
/** /**
* Represents a Slime. * Represents a Slime.
* *
* @author Cogito * @author Cogito
* *
*/ */
public interface Slime extends LivingEntity { public interface Slime extends LivingEntity {
/** /**
* @author Celtic Minstrel * @author Celtic Minstrel
* @return The size of the slime * @return The size of the slime
*/ */
public int getSize(); public int getSize();
/** /**
* @author Celtic Minstrel * @author Celtic Minstrel
* @param sz The new size of the slime. * @param sz The new size of the slime.
*/ */
public void setSize(int sz); public void setSize(int sz);
} }

View File

@ -1,49 +1,49 @@
package org.bukkit.event.block; package org.bukkit.event.block;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
/** /**
* Holds information for events with a source block and a destination block * Holds information for events with a source block and a destination block
*/ */
public class BlockFromToEvent extends BlockEvent implements Cancellable { public class BlockFromToEvent extends BlockEvent implements Cancellable {
protected Block to; protected Block to;
protected BlockFace face; protected BlockFace face;
protected boolean cancel; protected boolean cancel;
public BlockFromToEvent(final Block block, final BlockFace face) { public BlockFromToEvent(final Block block, final BlockFace face) {
super(Type.BLOCK_FROMTO, block); super(Type.BLOCK_FROMTO, block);
this.face = face; this.face = face;
this.cancel = false; this.cancel = false;
} }
/** /**
* Gets the location this player moved to * Gets the location this player moved to
* *
* @return Block the block is event originated from * @return Block the block is event originated from
*/ */
public BlockFace getFace() { public BlockFace getFace() {
return face; return face;
} }
/** /**
* Convenience method for getting the faced block * Convenience method for getting the faced block
* *
* @return Block the faced block * @return Block the faced block
*/ */
public Block getToBlock() { public Block getToBlock() {
if (to == null) { if (to == null) {
to = block.getRelative(face.getModX(), face.getModY(), face.getModZ()); to = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
} }
return to; return to;
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }
} }

View File

@ -1,35 +1,35 @@
package org.bukkit.event.entity; package org.bukkit.event.entity;
import java.util.Random; import java.util.Random;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent { public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
private Entity projectile; private Entity projectile;
private boolean bounce; private boolean bounce;
public EntityDamageByProjectileEvent(Entity damager, Entity damagee, Entity projectile, DamageCause cause, int damage) { public EntityDamageByProjectileEvent(Entity damager, Entity damagee, Entity projectile, DamageCause cause, int damage) {
super(damager, damagee, cause, damage); super(damager, damagee, cause, damage);
this.projectile = projectile; this.projectile = projectile;
Random random = new Random(); Random random = new Random();
this.bounce = random.nextBoolean(); this.bounce = random.nextBoolean();
} }
/** /**
* The projectile used to cause the event * The projectile used to cause the event
* @return the projectile * @return the projectile
*/ */
public Entity getProjectile() { public Entity getProjectile() {
return projectile; return projectile;
} }
public void setBounce(boolean bounce){ public void setBounce(boolean bounce){
this.bounce = bounce; this.bounce = bounce;
} }
public boolean getBounce(){ public boolean getBounce(){
return bounce; return bounce;
} }
} }

View File

@ -1,42 +1,42 @@
package org.bukkit.event.entity; package org.bukkit.event.entity;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable { public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
private boolean cancel; private boolean cancel;
private float radius; private float radius;
private boolean fire; private boolean fire;
public ExplosionPrimeEvent(Entity what, float radius, boolean fire) { public ExplosionPrimeEvent(Entity what, float radius, boolean fire) {
super(Type.EXPLOSION_PRIME, what); super(Type.EXPLOSION_PRIME, what);
this.cancel = false; this.cancel = false;
this.radius = radius; this.radius = radius;
this.fire = fire; this.fire = fire;
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }
public float getRadius() { public float getRadius() {
return radius; return radius;
} }
public void setRadius(float radius) { public void setRadius(float radius) {
this.radius = radius; this.radius = radius;
} }
public boolean getFire() { public boolean getFire() {
return fire; return fire;
} }
public void setFire(boolean fire) { public void setFire(boolean fire) {
this.fire = fire; this.fire = fire;
} }
} }

View File

@ -1,52 +1,52 @@
package org.bukkit.event.player; package org.bukkit.event.player;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public class PlayerBucketEmptyEvent extends PlayerEvent implements Cancellable { public class PlayerBucketEmptyEvent extends PlayerEvent implements Cancellable {
ItemStack itemStack; ItemStack itemStack;
boolean cancelled = false; boolean cancelled = false;
Block blockClicked; Block blockClicked;
BlockFace blockFace; BlockFace blockFace;
Material bucket; Material bucket;
public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) { public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
super(Type.PLAYER_BUCKET_EMPTY, who); super(Type.PLAYER_BUCKET_EMPTY, who);
this.blockClicked = blockClicked; this.blockClicked = blockClicked;
this.blockFace = blockFace; this.blockFace = blockFace;
this.itemStack = itemInHand; this.itemStack = itemInHand;
this.bucket = bucket; this.bucket = bucket;
} }
public Material getBucket() { public Material getBucket() {
return bucket; return bucket;
} }
public ItemStack getItemStack() { public ItemStack getItemStack() {
return itemStack; return itemStack;
} }
public Block getBlockClicked() { public Block getBlockClicked() {
return blockClicked; return blockClicked;
} }
public BlockFace getBlockFace() { public BlockFace getBlockFace() {
return blockFace; return blockFace;
} }
public void setItemStack(ItemStack itemStack) { public void setItemStack(ItemStack itemStack) {
this.itemStack = itemStack; this.itemStack = itemStack;
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.player; package org.bukkit.event.player;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class PlayerCommandPreprocessEvent extends PlayerChatEvent { public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
public PlayerCommandPreprocessEvent(Player player, String message) { public PlayerCommandPreprocessEvent(Player player, String message) {
super(player, message); super(player, message);
} }
} }

View File

@ -1,104 +1,104 @@
package org.bukkit.event.player; package org.bukkit.event.player;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
/** /**
* Stores details for players attempting to log in * Stores details for players attempting to log in
*/ */
public class PlayerLoginEvent extends PlayerEvent { public class PlayerLoginEvent extends PlayerEvent {
private Result result; private Result result;
private String message; private String message;
public PlayerLoginEvent(final Player player) { public PlayerLoginEvent(final Player player) {
super(Type.PLAYER_LOGIN, player); super(Type.PLAYER_LOGIN, player);
this.result = Result.ALLOWED; this.result = Result.ALLOWED;
this.message = ""; this.message = "";
} }
public PlayerLoginEvent(final Type type, final Player player, final Result result, final String message) { public PlayerLoginEvent(final Type type, final Player player, final Result result, final String message) {
super(type, player); super(type, player);
this.result = result; this.result = result;
this.message = message; this.message = message;
} }
/** /**
* Gets the current result of the login, as an enum * Gets the current result of the login, as an enum
* *
* @return Current Result of the login * @return Current Result of the login
*/ */
public Result getResult() { public Result getResult() {
return result; return result;
} }
/** /**
* Sets the new result of the login, as an enum * Sets the new result of the login, as an enum
* *
* @param result New result to set * @param result New result to set
*/ */
public void setResult(final Result result) { public void setResult(final Result result) {
this.result = result; this.result = result;
} }
/** /**
* Gets the current kick message that will be used if getResult() != Result.ALLOWED * Gets the current kick message that will be used if getResult() != Result.ALLOWED
* *
* @return Current kick message * @return Current kick message
*/ */
public String getKickMessage() { public String getKickMessage() {
return message; return message;
} }
/** /**
* Sets the kick message to display if getResult() != Result.ALLOWED * Sets the kick message to display if getResult() != Result.ALLOWED
* *
* @param message New kick message * @param message New kick message
*/ */
public void setKickMessage(final String message) { public void setKickMessage(final String message) {
this.message = message; this.message = message;
} }
/** /**
* Allows the player to log in * Allows the player to log in
*/ */
public void allow() { public void allow() {
result = Result.ALLOWED; result = Result.ALLOWED;
message = ""; message = "";
} }
/** /**
* Disallows the player from logging in, with the given reason * Disallows the player from logging in, with the given reason
* *
* @param result New result for disallowing the player * @param result New result for disallowing the player
* @param message Kick message to display to the user * @param message Kick message to display to the user
*/ */
public void disallow(final Result result, final String message) { public void disallow(final Result result, final String message) {
this.result = result; this.result = result;
this.message = message; this.message = message;
} }
/** /**
* Basic kick reasons for communicating to plugins * Basic kick reasons for communicating to plugins
*/ */
public enum Result { public enum Result {
/** /**
* The player is allowed to log in * The player is allowed to log in
*/ */
ALLOWED, ALLOWED,
/** /**
* The player is not allowed to log in, due to the server being full * The player is not allowed to log in, due to the server being full
*/ */
KICK_FULL, KICK_FULL,
/** /**
* The player is not allowed to log in, due to them being banned * The player is not allowed to log in, due to them being banned
*/ */
KICK_BANNED, KICK_BANNED,
/** /**
* The player is not allowed to log in, for reasons undefined * The player is not allowed to log in, for reasons undefined
*/ */
KICK_OTHER KICK_OTHER
} }
} }

View File

@ -1,85 +1,85 @@
package org.bukkit.event.player; package org.bukkit.event.player;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
/** /**
* Holds information for player movement and teleportation events * Holds information for player movement and teleportation events
*/ */
public class PlayerMoveEvent extends PlayerEvent implements Cancellable { public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false; private boolean cancel = false;
private Location from; private Location from;
private Location to; private Location to;
public PlayerMoveEvent(final Player player, final Location from, final Location to) { public PlayerMoveEvent(final Player player, final Location from, final Location to) {
super(Type.PLAYER_MOVE, player); super(Type.PLAYER_MOVE, player);
this.from = from; this.from = from;
this.to = to; this.to = to;
} }
/** /**
* Gets the cancellation state of this event. A cancelled event will not * Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins * be executed in the server, but will still pass to other plugins
* *
* If a move or teleport event is cancelled, the player will be moved or * If a move or teleport event is cancelled, the player will be moved or
* teleported back to the Location as defined by getFrom(). This will not * teleported back to the Location as defined by getFrom(). This will not
* fire an event * fire an event
* *
* @return true if this event is cancelled * @return true if this event is cancelled
*/ */
public boolean isCancelled() { public boolean isCancelled() {
return cancel; return cancel;
} }
/** /**
* Sets the cancellation state of this event. A cancelled event will not * Sets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins * be executed in the server, but will still pass to other plugins
* *
* If a move or teleport event is cancelled, the player will be moved or * If a move or teleport event is cancelled, the player will be moved or
* teleported back to the Location as defined by getFrom(). This will not * teleported back to the Location as defined by getFrom(). This will not
* fire an event * fire an event
* *
* @param cancel true if you wish to cancel this event * @param cancel true if you wish to cancel this event
*/ */
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancel = cancel; this.cancel = cancel;
} }
/** /**
* Gets the location this player moved from * Gets the location this player moved from
* *
* @return Location the player moved from * @return Location the player moved from
*/ */
public Location getFrom() { public Location getFrom() {
return from; return from;
} }
/** /**
* Sets the location to mark as where the player moved from * Sets the location to mark as where the player moved from
* *
* @param from New location to mark as the players previous location * @param from New location to mark as the players previous location
*/ */
public void setFrom(Location from) { public void setFrom(Location from) {
this.from = from; this.from = from;
} }
/** /**
* Gets the location this player moved to * Gets the location this player moved to
* *
* @return Location the player moved to * @return Location the player moved to
*/ */
public Location getTo() { public Location getTo() {
return to; return to;
} }
/** /**
* Sets the location that this player will move to * Sets the location that this player will move to
* *
* @param to New Location this player will move to * @param to New Location this player will move to
*/ */
public void setTo(Location to) { public void setTo(Location to) {
this.to = to; this.to = to;
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.player; package org.bukkit.event.player;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class PlayerQuitEvent extends PlayerEvent { public class PlayerQuitEvent extends PlayerEvent {
public PlayerQuitEvent(Player who) { public PlayerQuitEvent(Player who) {
super(Type.PLAYER_QUIT, who); super(Type.PLAYER_QUIT, who);
} }
} }

View File

@ -1,10 +1,10 @@
package org.bukkit.event.player; package org.bukkit.event.player;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class PlayerTeleportEvent extends PlayerMoveEvent { public class PlayerTeleportEvent extends PlayerMoveEvent {
public PlayerTeleportEvent(Player player, Location from, Location to) { public PlayerTeleportEvent(Player player, Location from, Location to) {
super(player, from, to); super(player, from, to);
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.server; package org.bukkit.event.server;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
public class PluginDisableEvent extends PluginEvent { public class PluginDisableEvent extends PluginEvent {
public PluginDisableEvent(Plugin plugin) { public PluginDisableEvent(Plugin plugin) {
super(Type.PLUGIN_DISABLE, plugin); super(Type.PLUGIN_DISABLE, plugin);
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.server; package org.bukkit.event.server;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
public class PluginEnableEvent extends PluginEvent { public class PluginEnableEvent extends PluginEvent {
public PluginEnableEvent(Plugin plugin) { public PluginEnableEvent(Plugin plugin) {
super(Type.PLUGIN_ENABLE, plugin); super(Type.PLUGIN_ENABLE, plugin);
} }
} }

View File

@ -1,22 +1,22 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
/** /**
* Raised when a vehicle collides with a block. * Raised when a vehicle collides with a block.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent { public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
private Block block; private Block block;
public VehicleBlockCollisionEvent(Vehicle vehicle, Block block) { public VehicleBlockCollisionEvent(Vehicle vehicle, Block block) {
super(Type.VEHICLE_COLLISION_BLOCK, vehicle); super(Type.VEHICLE_COLLISION_BLOCK, vehicle);
this.block = block; this.block = block;
} }
public Block getBlock() { public Block getBlock() {
return block; return block;
} }
} }

View File

@ -1,14 +1,14 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
/** /**
* Raised when a vehicle is created. * Raised when a vehicle is created.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleCreateEvent extends VehicleEvent { public class VehicleCreateEvent extends VehicleEvent {
public VehicleCreateEvent(Vehicle vehicle) { public VehicleCreateEvent(Vehicle vehicle) {
super(Type.VEHICLE_CREATE, vehicle); super(Type.VEHICLE_CREATE, vehicle);
} }
} }

View File

@ -1,48 +1,48 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
/** /**
* Raised when a vehicle receives damage. * Raised when a vehicle receives damage.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleDamageEvent extends VehicleEvent implements Cancellable { public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
private Entity attacker; private Entity attacker;
private int damage; private int damage;
private boolean cancelled; private boolean cancelled;
public VehicleDamageEvent(Vehicle vehicle, Entity attacker, int damage) { public VehicleDamageEvent(Vehicle vehicle, Entity attacker, int damage) {
super(Type.VEHICLE_DAMAGE, vehicle); super(Type.VEHICLE_DAMAGE, vehicle);
this.attacker = attacker; this.attacker = attacker;
this.damage = damage; this.damage = damage;
} }
public Entity getAttacker() { public Entity getAttacker() {
return attacker; return attacker;
} }
public int getDamage() { public int getDamage() {
return damage; return damage;
} }
/** /**
* Change the damage. * Change the damage.
* *
* @param damage * @param damage
*/ */
public void setDamage(int damage) { public void setDamage(int damage) {
this.damage = damage; this.damage = damage;
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }
} }

View File

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

View File

@ -1,50 +1,50 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
/** /**
* Raised when a vehicle collides with an entity. * Raised when a vehicle collides with an entity.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable { public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable {
private Entity entity; private Entity entity;
private boolean cancelled = false; private boolean cancelled = false;
private boolean cancelledPickup = false; private boolean cancelledPickup = false;
private boolean cancelledCollision = false; private boolean cancelledCollision = false;
public VehicleEntityCollisionEvent(Vehicle vehicle, Entity entity) { public VehicleEntityCollisionEvent(Vehicle vehicle, Entity entity) {
super(Type.VEHICLE_COLLISION_ENTITY, vehicle); super(Type.VEHICLE_COLLISION_ENTITY, vehicle);
this.entity = entity; this.entity = entity;
} }
public Entity getEntity() { public Entity getEntity() {
return entity; return entity;
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }
public boolean isPickupCancelled() { public boolean isPickupCancelled() {
return cancelledPickup; return cancelledPickup;
} }
public void setPickupCancelled(boolean cancel) { public void setPickupCancelled(boolean cancel) {
cancelledPickup = cancel; cancelledPickup = cancel;
} }
public boolean isCollisionCancelled() { public boolean isCollisionCancelled() {
return cancelledCollision; return cancelledCollision;
} }
public void setCollisionCancelled(boolean cancel) { public void setCollisionCancelled(boolean cancel) {
cancelledCollision = cancel; cancelledCollision = cancel;
} }
} }

View File

@ -1,37 +1,37 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
import org.bukkit.event.Cancellable; import org.bukkit.event.Cancellable;
/** /**
* Raised when a living entity exits a vehicle. * Raised when a living entity exits a vehicle.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleExitEvent extends VehicleEvent implements Cancellable { public class VehicleExitEvent extends VehicleEvent implements Cancellable {
private boolean cancelled; private boolean cancelled;
private LivingEntity exited; private LivingEntity exited;
public VehicleExitEvent(Vehicle vehicle, LivingEntity exited) { public VehicleExitEvent(Vehicle vehicle, LivingEntity exited) {
super(Type.VEHICLE_EXIT, vehicle); super(Type.VEHICLE_EXIT, vehicle);
this.exited = exited; this.exited = exited;
} }
/** /**
* Get the living entity that exited the vehicle. * Get the living entity that exited the vehicle.
* *
* @return * @return
*/ */
public LivingEntity getExited() { public LivingEntity getExited() {
return exited; return exited;
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancelled; return cancelled;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {
this.cancelled = cancel; this.cancelled = cancel;
} }
} }

View File

@ -1,78 +1,78 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
/** /**
* Listener for vehicle events. * Listener for vehicle events.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleListener implements Listener { public class VehicleListener implements Listener {
public VehicleListener() { public VehicleListener() {
} }
/** /**
* Called when a vehicle is created by a player. This hook will be called * Called when a vehicle is created by a player. This hook will be called
* for all vehicles created. * for all vehicles created.
* *
* @param event * @param event
*/ */
public void onVehicleCreate(VehicleCreateEvent event) { public void onVehicleCreate(VehicleCreateEvent event) {
} }
/** /**
* Called when a vehicle is damaged by the player. * Called when a vehicle is damaged by the player.
* *
* @param event * @param event
*/ */
public void onVehicleDamage(VehicleDamageEvent event) { public void onVehicleDamage(VehicleDamageEvent event) {
} }
/** /**
* Called when a vehicle collides with a block. * Called when a vehicle collides with a block.
* *
* @param event * @param event
*/ */
public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) { public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) {
} }
/** /**
* Called when a vehicle collides with an entity. * Called when a vehicle collides with an entity.
* *
* @param event * @param event
*/ */
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) { public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
} }
/** /**
* Called when an entity enters a vehicle. * Called when an entity enters a vehicle.
* *
* @param event * @param event
*/ */
public void onVehicleEnter(VehicleEnterEvent event) { public void onVehicleEnter(VehicleEnterEvent event) {
} }
/** /**
* Called when an entity exits a vehicle. * Called when an entity exits a vehicle.
* *
* @param event * @param event
*/ */
public void onVehicleExit(VehicleExitEvent event) { public void onVehicleExit(VehicleExitEvent event) {
} }
/** /**
* Called when an vehicle moves. * Called when an vehicle moves.
* *
* @param event * @param event
*/ */
public void onVehicleMove(VehicleMoveEvent event) { public void onVehicleMove(VehicleMoveEvent event) {
} }
/** /**
* Called when a vehicle goes through an update cycle * Called when a vehicle goes through an update cycle
* *
* @param event * @param event
*/ */
public void onVehicleUpdate(VehicleUpdateEvent event) { public void onVehicleUpdate(VehicleUpdateEvent event) {
} }
} }

View File

@ -1,39 +1,39 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
/** /**
* Raised when a vehicle moves. * Raised when a vehicle moves.
* *
* @author sk89q * @author sk89q
*/ */
public class VehicleMoveEvent extends VehicleEvent { public class VehicleMoveEvent extends VehicleEvent {
private Location from; private Location from;
private Location to; private Location to;
public VehicleMoveEvent(Vehicle vehicle, Location from, Location to) { public VehicleMoveEvent(Vehicle vehicle, Location from, Location to) {
super(Type.VEHICLE_MOVE, vehicle); super(Type.VEHICLE_MOVE, vehicle);
this.from = from; this.from = from;
this.to = to; this.to = to;
} }
/** /**
* Get the previous position. * Get the previous position.
* *
* @return * @return
*/ */
public Location getFrom() { public Location getFrom() {
return from; return from;
} }
/** /**
* Get the next position. * Get the next position.
* *
* @return * @return
*/ */
public Location getTo() { public Location getTo() {
return to; return to;
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.vehicle; package org.bukkit.event.vehicle;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
public class VehicleUpdateEvent extends VehicleEvent { public class VehicleUpdateEvent extends VehicleEvent {
public VehicleUpdateEvent(Vehicle vehicle) { public VehicleUpdateEvent(Vehicle vehicle) {
super(Type.VEHICLE_UPDATE, vehicle); super(Type.VEHICLE_UPDATE, vehicle);
} }
} }

View File

@ -1,15 +1,15 @@
package org.bukkit.event.world; package org.bukkit.event.world;
import org.bukkit.Chunk; import org.bukkit.Chunk;
public class ChunkEvent extends WorldEvent { public class ChunkEvent extends WorldEvent {
protected Chunk chunk; protected Chunk chunk;
protected ChunkEvent(Type type, Chunk chunk) { protected ChunkEvent(Type type, Chunk chunk) {
super(type, chunk.getWorld()); super(type, chunk.getWorld());
this.chunk = chunk; this.chunk = chunk;
} }
/** /**
* Gets the chunk being loaded/unloaded * Gets the chunk being loaded/unloaded
* *
@ -18,4 +18,4 @@ public class ChunkEvent extends WorldEvent {
public Chunk getChunk() { public Chunk getChunk() {
return chunk; return chunk;
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.world; package org.bukkit.event.world;
import org.bukkit.World; import org.bukkit.World;
public class WorldLoadEvent extends WorldEvent { public class WorldLoadEvent extends WorldEvent {
public WorldLoadEvent(World world) { public WorldLoadEvent(World world) {
super(Type.WORLD_LOAD, world); super(Type.WORLD_LOAD, world);
} }
} }

View File

@ -1,9 +1,9 @@
package org.bukkit.event.world; package org.bukkit.event.world;
import org.bukkit.World; import org.bukkit.World;
public class WorldSaveEvent extends WorldEvent { public class WorldSaveEvent extends WorldEvent {
public WorldSaveEvent(World world) { public WorldSaveEvent(World world) {
super(Type.WORLD_SAVE, world); super(Type.WORLD_SAVE, world);
} }
} }