mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
Line endings, consistency!
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
125a380385
commit
9418264170
25 changed files with 823 additions and 823 deletions
|
@ -1,24 +1,24 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.bukkit.entity;
|
||||
import org.bukkit.material.Colorable;
|
||||
|
||||
/**
|
||||
* Represents a Sheep.
|
||||
*
|
||||
* @author Cogito
|
||||
*
|
||||
*/
|
||||
public interface Sheep extends Animals, Colorable {
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @return Whether the sheep is sheared.
|
||||
*/
|
||||
public boolean isSheared();
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @param flag Whether to shear the sheep
|
||||
*/
|
||||
public void setSheared(boolean flag);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.bukkit.entity;
|
||||
import org.bukkit.material.Colorable;
|
||||
|
||||
/**
|
||||
* Represents a Sheep.
|
||||
*
|
||||
* @author Cogito
|
||||
*
|
||||
*/
|
||||
public interface Sheep extends Animals, Colorable {
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @return Whether the sheep is sheared.
|
||||
*/
|
||||
public boolean isSheared();
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @param flag Whether to shear the sheep
|
||||
*/
|
||||
public void setSheared(boolean flag);
|
||||
}
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a Slime.
|
||||
*
|
||||
* @author Cogito
|
||||
*
|
||||
*/
|
||||
public interface Slime extends LivingEntity {
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @return The size of the slime
|
||||
*/
|
||||
public int getSize();
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @param sz The new size of the slime.
|
||||
*/
|
||||
public void setSize(int sz);
|
||||
}
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.bukkit.entity;
|
||||
|
||||
/**
|
||||
* Represents a Slime.
|
||||
*
|
||||
* @author Cogito
|
||||
*
|
||||
*/
|
||||
public interface Slime extends LivingEntity {
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @return The size of the slime
|
||||
*/
|
||||
public int getSize();
|
||||
/**
|
||||
* @author Celtic Minstrel
|
||||
* @param sz The new size of the slime.
|
||||
*/
|
||||
public void setSize(int sz);
|
||||
}
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Holds information for events with a source block and a destination block
|
||||
*/
|
||||
public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
||||
protected Block to;
|
||||
protected BlockFace face;
|
||||
protected boolean cancel;
|
||||
|
||||
public BlockFromToEvent(final Block block, final BlockFace face) {
|
||||
super(Type.BLOCK_FROMTO, block);
|
||||
this.face = face;
|
||||
this.cancel = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved to
|
||||
*
|
||||
* @return Block the block is event originated from
|
||||
*/
|
||||
public BlockFace getFace() {
|
||||
return face;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method for getting the faced block
|
||||
*
|
||||
* @return Block the faced block
|
||||
*/
|
||||
public Block getToBlock() {
|
||||
if (to == null) {
|
||||
to = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.block;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Holds information for events with a source block and a destination block
|
||||
*/
|
||||
public class BlockFromToEvent extends BlockEvent implements Cancellable {
|
||||
protected Block to;
|
||||
protected BlockFace face;
|
||||
protected boolean cancel;
|
||||
|
||||
public BlockFromToEvent(final Block block, final BlockFace face) {
|
||||
super(Type.BLOCK_FROMTO, block);
|
||||
this.face = face;
|
||||
this.cancel = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved to
|
||||
*
|
||||
* @return Block the block is event originated from
|
||||
*/
|
||||
public BlockFace getFace() {
|
||||
return face;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method for getting the faced block
|
||||
*
|
||||
* @return Block the faced block
|
||||
*/
|
||||
public Block getToBlock() {
|
||||
if (to == null) {
|
||||
to = block.getRelative(face.getModX(), face.getModY(), face.getModZ());
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,35 +1,35 @@
|
|||
package org.bukkit.event.entity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
|
||||
|
||||
private Entity projectile;
|
||||
private boolean bounce;
|
||||
|
||||
public EntityDamageByProjectileEvent(Entity damager, Entity damagee, Entity projectile, DamageCause cause, int damage) {
|
||||
super(damager, damagee, cause, damage);
|
||||
this.projectile = projectile;
|
||||
Random random = new Random();
|
||||
this.bounce = random.nextBoolean();
|
||||
}
|
||||
|
||||
/**
|
||||
* The projectile used to cause the event
|
||||
* @return the projectile
|
||||
*/
|
||||
public Entity getProjectile() {
|
||||
return projectile;
|
||||
}
|
||||
|
||||
public void setBounce(boolean bounce){
|
||||
this.bounce = bounce;
|
||||
}
|
||||
|
||||
public boolean getBounce(){
|
||||
return bounce;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
|
||||
|
||||
private Entity projectile;
|
||||
private boolean bounce;
|
||||
|
||||
public EntityDamageByProjectileEvent(Entity damager, Entity damagee, Entity projectile, DamageCause cause, int damage) {
|
||||
super(damager, damagee, cause, damage);
|
||||
this.projectile = projectile;
|
||||
Random random = new Random();
|
||||
this.bounce = random.nextBoolean();
|
||||
}
|
||||
|
||||
/**
|
||||
* The projectile used to cause the event
|
||||
* @return the projectile
|
||||
*/
|
||||
public Entity getProjectile() {
|
||||
return projectile;
|
||||
}
|
||||
|
||||
public void setBounce(boolean bounce){
|
||||
this.bounce = bounce;
|
||||
}
|
||||
|
||||
public boolean getBounce(){
|
||||
return bounce;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
private float radius;
|
||||
private boolean fire;
|
||||
|
||||
public ExplosionPrimeEvent(Entity what, float radius, boolean fire) {
|
||||
super(Type.EXPLOSION_PRIME, what);
|
||||
this.cancel = false;
|
||||
this.radius = radius;
|
||||
this.fire = fire;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void setRadius(float radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public boolean getFire() {
|
||||
return fire;
|
||||
}
|
||||
|
||||
public void setFire(boolean fire) {
|
||||
this.fire = fire;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bukkit.event.entity;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||
private boolean cancel;
|
||||
private float radius;
|
||||
private boolean fire;
|
||||
|
||||
public ExplosionPrimeEvent(Entity what, float radius, boolean fire) {
|
||||
super(Type.EXPLOSION_PRIME, what);
|
||||
this.cancel = false;
|
||||
this.radius = radius;
|
||||
this.fire = fire;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return radius;
|
||||
}
|
||||
|
||||
public void setRadius(float radius) {
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
public boolean getFire() {
|
||||
return fire;
|
||||
}
|
||||
|
||||
public void setFire(boolean fire) {
|
||||
this.fire = fire;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,52 +1,52 @@
|
|||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PlayerBucketEmptyEvent extends PlayerEvent implements Cancellable {
|
||||
ItemStack itemStack;
|
||||
boolean cancelled = false;
|
||||
Block blockClicked;
|
||||
BlockFace blockFace;
|
||||
Material bucket;
|
||||
|
||||
public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
|
||||
super(Type.PLAYER_BUCKET_EMPTY, who);
|
||||
this.blockClicked = blockClicked;
|
||||
this.blockFace = blockFace;
|
||||
this.itemStack = itemInHand;
|
||||
this.bucket = bucket;
|
||||
}
|
||||
|
||||
public Material getBucket() {
|
||||
return bucket;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public Block getBlockClicked() {
|
||||
return blockClicked;
|
||||
}
|
||||
|
||||
public BlockFace getBlockFace() {
|
||||
return blockFace;
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class PlayerBucketEmptyEvent extends PlayerEvent implements Cancellable {
|
||||
ItemStack itemStack;
|
||||
boolean cancelled = false;
|
||||
Block blockClicked;
|
||||
BlockFace blockFace;
|
||||
Material bucket;
|
||||
|
||||
public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
|
||||
super(Type.PLAYER_BUCKET_EMPTY, who);
|
||||
this.blockClicked = blockClicked;
|
||||
this.blockFace = blockFace;
|
||||
this.itemStack = itemInHand;
|
||||
this.bucket = bucket;
|
||||
}
|
||||
|
||||
public Material getBucket() {
|
||||
return bucket;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public Block getBlockClicked() {
|
||||
return blockClicked;
|
||||
}
|
||||
|
||||
public BlockFace getBlockFace() {
|
||||
return blockFace;
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
|
||||
public PlayerCommandPreprocessEvent(Player player, String message) {
|
||||
super(player, message);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
|
||||
public PlayerCommandPreprocessEvent(Player player, String message) {
|
||||
super(player, message);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,104 +1,104 @@
|
|||
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Stores details for players attempting to log in
|
||||
*/
|
||||
public class PlayerLoginEvent extends PlayerEvent {
|
||||
private Result result;
|
||||
private String message;
|
||||
|
||||
public PlayerLoginEvent(final Player player) {
|
||||
super(Type.PLAYER_LOGIN, player);
|
||||
this.result = Result.ALLOWED;
|
||||
this.message = "";
|
||||
}
|
||||
|
||||
public PlayerLoginEvent(final Type type, final Player player, final Result result, final String message) {
|
||||
super(type, player);
|
||||
this.result = result;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current result of the login, as an enum
|
||||
*
|
||||
* @return Current Result of the login
|
||||
*/
|
||||
public Result getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new result of the login, as an enum
|
||||
*
|
||||
* @param result New result to set
|
||||
*/
|
||||
public void setResult(final Result result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current kick message that will be used if getResult() != Result.ALLOWED
|
||||
*
|
||||
* @return Current kick message
|
||||
*/
|
||||
public String getKickMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the kick message to display if getResult() != Result.ALLOWED
|
||||
*
|
||||
* @param message New kick message
|
||||
*/
|
||||
public void setKickMessage(final String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the player to log in
|
||||
*/
|
||||
public void allow() {
|
||||
result = Result.ALLOWED;
|
||||
message = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Disallows the player from logging in, with the given reason
|
||||
*
|
||||
* @param result New result for disallowing the player
|
||||
* @param message Kick message to display to the user
|
||||
*/
|
||||
public void disallow(final Result result, final String message) {
|
||||
this.result = result;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic kick reasons for communicating to plugins
|
||||
*/
|
||||
public enum Result {
|
||||
/**
|
||||
* The player is allowed to log in
|
||||
*/
|
||||
ALLOWED,
|
||||
|
||||
/**
|
||||
* The player is not allowed to log in, due to the server being full
|
||||
*/
|
||||
KICK_FULL,
|
||||
|
||||
/**
|
||||
* The player is not allowed to log in, due to them being banned
|
||||
*/
|
||||
KICK_BANNED,
|
||||
|
||||
/**
|
||||
* The player is not allowed to log in, for reasons undefined
|
||||
*/
|
||||
KICK_OTHER
|
||||
}
|
||||
}
|
||||
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Stores details for players attempting to log in
|
||||
*/
|
||||
public class PlayerLoginEvent extends PlayerEvent {
|
||||
private Result result;
|
||||
private String message;
|
||||
|
||||
public PlayerLoginEvent(final Player player) {
|
||||
super(Type.PLAYER_LOGIN, player);
|
||||
this.result = Result.ALLOWED;
|
||||
this.message = "";
|
||||
}
|
||||
|
||||
public PlayerLoginEvent(final Type type, final Player player, final Result result, final String message) {
|
||||
super(type, player);
|
||||
this.result = result;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current result of the login, as an enum
|
||||
*
|
||||
* @return Current Result of the login
|
||||
*/
|
||||
public Result getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new result of the login, as an enum
|
||||
*
|
||||
* @param result New result to set
|
||||
*/
|
||||
public void setResult(final Result result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current kick message that will be used if getResult() != Result.ALLOWED
|
||||
*
|
||||
* @return Current kick message
|
||||
*/
|
||||
public String getKickMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the kick message to display if getResult() != Result.ALLOWED
|
||||
*
|
||||
* @param message New kick message
|
||||
*/
|
||||
public void setKickMessage(final String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the player to log in
|
||||
*/
|
||||
public void allow() {
|
||||
result = Result.ALLOWED;
|
||||
message = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Disallows the player from logging in, with the given reason
|
||||
*
|
||||
* @param result New result for disallowing the player
|
||||
* @param message Kick message to display to the user
|
||||
*/
|
||||
public void disallow(final Result result, final String message) {
|
||||
this.result = result;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic kick reasons for communicating to plugins
|
||||
*/
|
||||
public enum Result {
|
||||
/**
|
||||
* The player is allowed to log in
|
||||
*/
|
||||
ALLOWED,
|
||||
|
||||
/**
|
||||
* The player is not allowed to log in, due to the server being full
|
||||
*/
|
||||
KICK_FULL,
|
||||
|
||||
/**
|
||||
* The player is not allowed to log in, due to them being banned
|
||||
*/
|
||||
KICK_BANNED,
|
||||
|
||||
/**
|
||||
* The player is not allowed to log in, for reasons undefined
|
||||
*/
|
||||
KICK_OTHER
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,85 +1,85 @@
|
|||
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Holds information for player movement and teleportation events
|
||||
*/
|
||||
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private Location from;
|
||||
private Location to;
|
||||
|
||||
public PlayerMoveEvent(final Player player, final Location from, final Location to) {
|
||||
super(Type.PLAYER_MOVE, player);
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* 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
|
||||
* teleported back to the Location as defined by getFrom(). This will not
|
||||
* fire an event
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* 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
|
||||
* teleported back to the Location as defined by getFrom(). This will not
|
||||
* fire an event
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved from
|
||||
*
|
||||
* @return Location the player moved from
|
||||
*/
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location to mark as where the player moved from
|
||||
*
|
||||
* @param from New location to mark as the players previous location
|
||||
*/
|
||||
public void setFrom(Location from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved to
|
||||
*
|
||||
* @return Location the player moved to
|
||||
*/
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location that this player will move to
|
||||
*
|
||||
* @param to New Location this player will move to
|
||||
*/
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
}
|
||||
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Holds information for player movement and teleportation events
|
||||
*/
|
||||
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||
private boolean cancel = false;
|
||||
private Location from;
|
||||
private Location to;
|
||||
|
||||
public PlayerMoveEvent(final Player player, final Location from, final Location to) {
|
||||
super(Type.PLAYER_MOVE, player);
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the cancellation state of this event. A cancelled event will not
|
||||
* 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
|
||||
* teleported back to the Location as defined by getFrom(). This will not
|
||||
* fire an event
|
||||
*
|
||||
* @return true if this event is cancelled
|
||||
*/
|
||||
public boolean isCancelled() {
|
||||
return cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the cancellation state of this event. A cancelled event will not
|
||||
* 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
|
||||
* teleported back to the Location as defined by getFrom(). This will not
|
||||
* fire an event
|
||||
*
|
||||
* @param cancel true if you wish to cancel this event
|
||||
*/
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancel = cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved from
|
||||
*
|
||||
* @return Location the player moved from
|
||||
*/
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location to mark as where the player moved from
|
||||
*
|
||||
* @param from New location to mark as the players previous location
|
||||
*/
|
||||
public void setFrom(Location from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the location this player moved to
|
||||
*
|
||||
* @return Location the player moved to
|
||||
*/
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the location that this player will move to
|
||||
*
|
||||
* @param to New Location this player will move to
|
||||
*/
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerQuitEvent extends PlayerEvent {
|
||||
public PlayerQuitEvent(Player who) {
|
||||
super(Type.PLAYER_QUIT, who);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerQuitEvent extends PlayerEvent {
|
||||
public PlayerQuitEvent(Player who) {
|
||||
super(Type.PLAYER_QUIT, who);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||
public PlayerTeleportEvent(Player player, Location from, Location to) {
|
||||
super(player, from, to);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.player;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||
public PlayerTeleportEvent(Player player, Location from, Location to) {
|
||||
super(player, from, to);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.server;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class PluginDisableEvent extends PluginEvent {
|
||||
public PluginDisableEvent(Plugin plugin) {
|
||||
super(Type.PLUGIN_DISABLE, plugin);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.server;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class PluginDisableEvent extends PluginEvent {
|
||||
public PluginDisableEvent(Plugin plugin) {
|
||||
super(Type.PLUGIN_DISABLE, plugin);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.server;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class PluginEnableEvent extends PluginEvent {
|
||||
public PluginEnableEvent(Plugin plugin) {
|
||||
super(Type.PLUGIN_ENABLE, plugin);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.server;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class PluginEnableEvent extends PluginEvent {
|
||||
public PluginEnableEvent(Plugin plugin) {
|
||||
super(Type.PLUGIN_ENABLE, plugin);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
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;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle is created.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleCreateEvent extends VehicleEvent {
|
||||
public VehicleCreateEvent(Vehicle vehicle) {
|
||||
super(Type.VEHICLE_CREATE, vehicle);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle is created.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleCreateEvent extends VehicleEvent {
|
||||
public VehicleCreateEvent(Vehicle vehicle) {
|
||||
super(Type.VEHICLE_CREATE, vehicle);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +1,48 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
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) {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
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) {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when an entity enters a vehicle.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private Entity entered;
|
||||
|
||||
public VehicleEnterEvent(Vehicle vehicle, Entity entered) {
|
||||
super(Type.VEHICLE_ENTER, vehicle);
|
||||
this.entered = entered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entity that entered the vehicle.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Entity getEntered() {
|
||||
return entered;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when an entity enters a vehicle.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private Entity entered;
|
||||
|
||||
public VehicleEnterEvent(Vehicle vehicle, Entity entered) {
|
||||
super(Type.VEHICLE_ENTER, vehicle);
|
||||
this.entered = entered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entity that entered the vehicle.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Entity getEntered() {
|
||||
return entered;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle collides with an entity.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable {
|
||||
private 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);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public Entity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle collides with an entity.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable {
|
||||
private 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);
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
public Entity getEntity() {
|
||||
return entity;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a living entity exits a vehicle.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private LivingEntity exited;
|
||||
|
||||
public VehicleExitEvent(Vehicle vehicle, LivingEntity exited) {
|
||||
super(Type.VEHICLE_EXIT, vehicle);
|
||||
this.exited = exited;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the living entity that exited the vehicle.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public LivingEntity getExited() {
|
||||
return exited;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Raised when a living entity exits a vehicle.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||
private boolean cancelled;
|
||||
private LivingEntity exited;
|
||||
|
||||
public VehicleExitEvent(Vehicle vehicle, LivingEntity exited) {
|
||||
super(Type.VEHICLE_EXIT, vehicle);
|
||||
this.exited = exited;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the living entity that exited the vehicle.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public LivingEntity getExited() {
|
||||
return exited;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancel) {
|
||||
this.cancelled = cancel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,78 +1,78 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Listener for vehicle events.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public void onVehicleCreate(VehicleCreateEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is damaged by the player.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleDamage(VehicleDamageEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with a block.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with an entity.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an entity enters a vehicle.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleEnter(VehicleEnterEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an entity exits a vehicle.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleExit(VehicleExitEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an vehicle moves.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleMove(VehicleMoveEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle goes through an update cycle
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleUpdate(VehicleUpdateEvent event) {
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
/**
|
||||
* Listener for vehicle events.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public void onVehicleCreate(VehicleCreateEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle is damaged by the player.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleDamage(VehicleDamageEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with a block.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleBlockCollision(VehicleBlockCollisionEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle collides with an entity.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleEntityCollision(VehicleEntityCollisionEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an entity enters a vehicle.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleEnter(VehicleEnterEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an entity exits a vehicle.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleExit(VehicleExitEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when an vehicle moves.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleMove(VehicleMoveEvent event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a vehicle goes through an update cycle
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
public void onVehicleUpdate(VehicleUpdateEvent event) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle moves.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleMoveEvent extends VehicleEvent {
|
||||
private Location from;
|
||||
private Location to;
|
||||
|
||||
public VehicleMoveEvent(Vehicle vehicle, Location from, Location to) {
|
||||
super(Type.VEHICLE_MOVE, vehicle);
|
||||
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the previous position.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next position.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
/**
|
||||
* Raised when a vehicle moves.
|
||||
*
|
||||
* @author sk89q
|
||||
*/
|
||||
public class VehicleMoveEvent extends VehicleEvent {
|
||||
private Location from;
|
||||
private Location to;
|
||||
|
||||
public VehicleMoveEvent(Vehicle vehicle, Location from, Location to) {
|
||||
super(Type.VEHICLE_MOVE, vehicle);
|
||||
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the previous position.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next position.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
public class VehicleUpdateEvent extends VehicleEvent {
|
||||
public VehicleUpdateEvent(Vehicle vehicle) {
|
||||
super(Type.VEHICLE_UPDATE, vehicle);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.vehicle;
|
||||
|
||||
import org.bukkit.entity.Vehicle;
|
||||
|
||||
public class VehicleUpdateEvent extends VehicleEvent {
|
||||
public VehicleUpdateEvent(Vehicle vehicle) {
|
||||
super(Type.VEHICLE_UPDATE, vehicle);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
|
||||
public class ChunkEvent extends WorldEvent {
|
||||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.Chunk;
|
||||
|
||||
public class ChunkEvent extends WorldEvent {
|
||||
protected Chunk chunk;
|
||||
|
||||
protected ChunkEvent(Type type, Chunk chunk) {
|
||||
super(type, chunk.getWorld());
|
||||
this.chunk = chunk;
|
||||
}
|
||||
|
||||
protected ChunkEvent(Type type, Chunk chunk) {
|
||||
super(type, chunk.getWorld());
|
||||
this.chunk = chunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the chunk being loaded/unloaded
|
||||
*
|
||||
|
@ -18,4 +18,4 @@ public class ChunkEvent extends WorldEvent {
|
|||
public Chunk getChunk() {
|
||||
return chunk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
public class WorldLoadEvent extends WorldEvent {
|
||||
public WorldLoadEvent(World world) {
|
||||
super(Type.WORLD_LOAD, world);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
public class WorldLoadEvent extends WorldEvent {
|
||||
public WorldLoadEvent(World world) {
|
||||
super(Type.WORLD_LOAD, world);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
public class WorldSaveEvent extends WorldEvent {
|
||||
public WorldSaveEvent(World world) {
|
||||
super(Type.WORLD_SAVE, world);
|
||||
}
|
||||
}
|
||||
package org.bukkit.event.world;
|
||||
|
||||
import org.bukkit.World;
|
||||
|
||||
public class WorldSaveEvent extends WorldEvent {
|
||||
public WorldSaveEvent(World world) {
|
||||
super(Type.WORLD_SAVE, world);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue