mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
More JavaDoc improvements.
By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
parent
0630db640b
commit
c54128077a
56 changed files with 435 additions and 139 deletions
|
@ -9,7 +9,7 @@ public class CustomEventListener implements Listener {
|
||||||
public CustomEventListener() {}
|
public CustomEventListener() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a player joins a server
|
* Called when a custom event is fired
|
||||||
*
|
*
|
||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -26,6 +26,7 @@ public abstract class Event implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Type of this event
|
* Gets the Type of this event
|
||||||
|
*
|
||||||
* @return Event type that this object represents
|
* @return Event type that this object represents
|
||||||
*/
|
*/
|
||||||
public final Type getType() {
|
public final Type getType() {
|
||||||
|
@ -89,6 +90,7 @@ public abstract class Event implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents Player-based events
|
* Represents Player-based events
|
||||||
|
*
|
||||||
* @see Category.LIVING_ENTITY
|
* @see Category.LIVING_ENTITY
|
||||||
*/
|
*/
|
||||||
PLAYER,
|
PLAYER,
|
||||||
|
@ -109,7 +111,7 @@ public abstract class Event implements Serializable {
|
||||||
*/
|
*/
|
||||||
WEATHER,
|
WEATHER,
|
||||||
/**
|
/**
|
||||||
* Vehicle-based events
|
* Represents Vehicle-based events
|
||||||
*/
|
*/
|
||||||
VEHICLE,
|
VEHICLE,
|
||||||
/**
|
/**
|
||||||
|
@ -125,7 +127,7 @@ public abstract class Event implements Serializable {
|
||||||
*/
|
*/
|
||||||
INVENTORY,
|
INVENTORY,
|
||||||
/**
|
/**
|
||||||
* Any miscellaneous events
|
* Represents any miscellaneous events
|
||||||
*/
|
*/
|
||||||
MISCELLANEOUS;
|
MISCELLANEOUS;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +146,7 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a player enters the world on a server
|
* Called when a player enters the world on a server
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerEvent
|
* @see org.bukkit.event.player.PlayerJoinEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_JOIN (Category.PLAYER),
|
PLAYER_JOIN (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
|
@ -162,13 +164,13 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a player respawns
|
* Called when a player respawns
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerEvent
|
* @see org.bukkit.event.player.PlayerRespawnEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_RESPAWN (Category.PLAYER),
|
PLAYER_RESPAWN (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
* Called when a player gets kicked a server
|
* Called when a player gets kicked from the server
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerEvent
|
* @see org.bukkit.event.player.PlayerKickEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_KICK (Category.PLAYER),
|
PLAYER_KICK (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
|
@ -178,15 +180,15 @@ public abstract class Event implements Serializable {
|
||||||
*/
|
*/
|
||||||
PLAYER_CHAT (Category.PLAYER),
|
PLAYER_CHAT (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
* Called when a player early in the command handling process
|
* Called when a player uses a command (early in the command handling process)
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerChatEvent
|
* @see org.bukkit.event.player.PlayerCommandPreprocessEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_COMMAND_PREPROCESS (Category.PLAYER),
|
PLAYER_COMMAND_PREPROCESS (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
* Called when a player leaves a server
|
* Called when a player leaves the server
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerEvent
|
* @see org.bukkit.event.player.PlayerQuitEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_QUIT (Category.PLAYER),
|
PLAYER_QUIT (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
|
@ -196,7 +198,7 @@ public abstract class Event implements Serializable {
|
||||||
*/
|
*/
|
||||||
PLAYER_MOVE (Category.PLAYER),
|
PLAYER_MOVE (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
* Called when a player undergoes an animation, such as arm swinging
|
* Called when a player undergoes an animation (Arm Swing is the only animation currently supported)
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerAnimationEvent
|
* @see org.bukkit.event.player.PlayerAnimationEvent
|
||||||
*/
|
*/
|
||||||
|
@ -204,13 +206,13 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a player toggles sneak mode
|
* Called when a player toggles sneak mode
|
||||||
*
|
*
|
||||||
* @todo: add javadoc see comment
|
* @see org.bukkit.event.player.PlayerToggleSneakEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_TOGGLE_SNEAK (Category.PLAYER),
|
PLAYER_TOGGLE_SNEAK (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
* Called when a player uses an item
|
* Called when a player interacts with an object or air
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerItemEvent
|
* @see org.bukkit.event.player.PlayerInteractEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_INTERACT (Category.PLAYER),
|
PLAYER_INTERACT (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
|
@ -220,7 +222,7 @@ public abstract class Event implements Serializable {
|
||||||
*/
|
*/
|
||||||
PLAYER_INTERACT_ENTITY (Category.PLAYER),
|
PLAYER_INTERACT_ENTITY (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
* Called when a player throws an egg and it might hatch
|
* Called when a player throws an egg
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerEggThrowEvent
|
* @see org.bukkit.event.player.PlayerEggThrowEvent
|
||||||
*/
|
*/
|
||||||
|
@ -228,7 +230,7 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a player teleports from one position to another
|
* Called when a player teleports from one position to another
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerMoveEvent
|
* @see org.bukkit.event.player.PlayerTeleportEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_TELEPORT (Category.PLAYER),
|
PLAYER_TELEPORT (Category.PLAYER),
|
||||||
/**
|
/**
|
||||||
|
@ -282,7 +284,7 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a player leaves a bed
|
* Called when a player leaves a bed
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.player.PlayerBedEnterEvent
|
* @see org.bukkit.event.player.PlayerBedLeaveEvent
|
||||||
*/
|
*/
|
||||||
PLAYER_BED_LEAVE(Category.PLAYER),
|
PLAYER_BED_LEAVE(Category.PLAYER),
|
||||||
|
|
||||||
|
@ -337,7 +339,7 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a block dispenses something
|
* Called when a block dispenses something
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.block.BlockPlaceEvent
|
* @see org.bukkit.event.block.BlockDispenseEvent
|
||||||
*/
|
*/
|
||||||
BLOCK_DISPENSE (Category.BLOCK),
|
BLOCK_DISPENSE (Category.BLOCK),
|
||||||
/**
|
/**
|
||||||
|
@ -363,11 +365,11 @@ public abstract class Event implements Serializable {
|
||||||
* that are actually capable of transmitting or carrying a redstone
|
* that are actually capable of transmitting or carrying a redstone
|
||||||
* current
|
* current
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.block.BlockFromToEvent
|
* @see org.bukkit.event.block.BlockRedstoneEvent
|
||||||
*/
|
*/
|
||||||
REDSTONE_CHANGE (Category.BLOCK),
|
REDSTONE_CHANGE (Category.BLOCK),
|
||||||
/**
|
/**
|
||||||
* Called when a block is destroyed by a player.
|
* Called when a block is broken by a player
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.block.BlockBreakEvent
|
* @see org.bukkit.event.block.BlockBreakEvent
|
||||||
*/
|
*/
|
||||||
|
@ -431,14 +433,12 @@ public abstract class Event implements Serializable {
|
||||||
* @todo: add javadoc see comment
|
* @todo: add javadoc see comment
|
||||||
*/
|
*/
|
||||||
INVENTORY_TRANSACTION (Category.INVENTORY),
|
INVENTORY_TRANSACTION (Category.INVENTORY),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an ItemStack is successfully smelted in a furnace.
|
* Called when an ItemStack is successfully smelted in a furnace.
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.inventory.FurnaceSmeltEvent
|
* @see org.bukkit.event.inventory.FurnaceSmeltEvent
|
||||||
*/
|
*/
|
||||||
FURNACE_SMELT (Category.INVENTORY),
|
FURNACE_SMELT (Category.INVENTORY),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when an ItemStack is successfully burned as fuel in a furnace.
|
* Called when an ItemStack is successfully burned as fuel in a furnace.
|
||||||
*
|
*
|
||||||
|
@ -453,19 +453,19 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a plugin is enabled
|
* Called when a plugin is enabled
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.server.PluginEvent
|
* @see org.bukkit.event.server.PluginEnableEvent
|
||||||
*/
|
*/
|
||||||
PLUGIN_ENABLE (Category.SERVER),
|
PLUGIN_ENABLE (Category.SERVER),
|
||||||
/**
|
/**
|
||||||
* Called when a plugin is disabled
|
* Called when a plugin is disabled
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.server.PluginEvent
|
* @see org.bukkit.event.server.PluginDisableEvent
|
||||||
*/
|
*/
|
||||||
PLUGIN_DISABLE (Category.SERVER),
|
PLUGIN_DISABLE (Category.SERVER),
|
||||||
/**
|
/**
|
||||||
* Called when a server command is called
|
* Called when a server command is called
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.server.PluginEvent
|
* @see org.bukkit.event.server.ServerCommandEvent
|
||||||
*/
|
*/
|
||||||
SERVER_COMMAND (Category.SERVER),
|
SERVER_COMMAND (Category.SERVER),
|
||||||
|
|
||||||
|
@ -511,18 +511,25 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a world is saved
|
* Called when a world is saved
|
||||||
*
|
*
|
||||||
|
* @see org.bukkit.event.world.WorldSaveEvent
|
||||||
*/
|
*/
|
||||||
WORLD_SAVE (Category.WORLD),
|
WORLD_SAVE (Category.WORLD),
|
||||||
/**
|
/**
|
||||||
* Called when a World is initializing
|
* Called when a World is initializing
|
||||||
|
*
|
||||||
|
* @see org.bukkit.event.world.WorldInitEvent
|
||||||
*/
|
*/
|
||||||
WORLD_INIT (Category.WORLD),
|
WORLD_INIT (Category.WORLD),
|
||||||
/**
|
/**
|
||||||
* Called when a World is loaded
|
* Called when a World is loaded
|
||||||
|
*
|
||||||
|
* @see org.bukkit.event.world.WorldLoadEvent
|
||||||
*/
|
*/
|
||||||
WORLD_LOAD (Category.WORLD),
|
WORLD_LOAD (Category.WORLD),
|
||||||
/**
|
/**
|
||||||
* Called when a World is unloaded
|
* Called when a World is unloaded
|
||||||
|
*
|
||||||
|
* @see org.bukkit.event.world.WorldUnloadEvent
|
||||||
*/
|
*/
|
||||||
WORLD_UNLOAD (Category.WORLD),
|
WORLD_UNLOAD (Category.WORLD),
|
||||||
/**
|
/**
|
||||||
|
@ -539,13 +546,13 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a painting is placed by player
|
* Called when a painting is placed by player
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.painting.PaintingCreateEvent
|
* @see org.bukkit.event.painting.PaintingPlaceEvent
|
||||||
*/
|
*/
|
||||||
PAINTING_PLACE (Category.ENTITY),
|
PAINTING_PLACE (Category.ENTITY),
|
||||||
/**
|
/**
|
||||||
* Called when a painting is removed
|
* Called when a painting is removed
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.painting.PaintingRemoveEvent
|
* @see org.bukkit.event.painting.PaintingBreakEvent
|
||||||
*/
|
*/
|
||||||
PAINTING_BREAK (Category.ENTITY),
|
PAINTING_BREAK (Category.ENTITY),
|
||||||
/**
|
/**
|
||||||
|
@ -563,7 +570,7 @@ public abstract class Event implements Serializable {
|
||||||
* Called when a creature, either hostile or neutral, attempts to spawn
|
* Called when a creature, either hostile or neutral, attempts to spawn
|
||||||
* in the world "naturally"
|
* in the world "naturally"
|
||||||
*
|
*
|
||||||
* @todo: add javadoc see comment
|
* @see org.bukkit.event.entity.CreatureSpawnEvent
|
||||||
*/
|
*/
|
||||||
CREATURE_SPAWN (Category.LIVING_ENTITY),
|
CREATURE_SPAWN (Category.LIVING_ENTITY),
|
||||||
/**
|
/**
|
||||||
|
@ -575,19 +582,19 @@ public abstract class Event implements Serializable {
|
||||||
/**
|
/**
|
||||||
* Called when a LivingEntity dies
|
* Called when a LivingEntity dies
|
||||||
*
|
*
|
||||||
* @todo: add javadoc see comment
|
* @see org.bukkit.event.entity.EntityDeathEvent
|
||||||
*/
|
*/
|
||||||
ENTITY_DEATH (Category.LIVING_ENTITY),
|
ENTITY_DEATH (Category.LIVING_ENTITY),
|
||||||
/**
|
/**
|
||||||
* Called when a Skeleton or Zombie catch fire due to the sun
|
* Called when a Skeleton or Zombie catch fire due to the sun
|
||||||
*
|
*
|
||||||
* @todo: add javadoc see comment
|
* @see org.bukkit.event.entity.EntityCombustEvent
|
||||||
*/
|
*/
|
||||||
ENTITY_COMBUST (Category.LIVING_ENTITY),
|
ENTITY_COMBUST (Category.LIVING_ENTITY),
|
||||||
/**
|
/**
|
||||||
* Called when an entity explodes, either TNT, Creeper, or Ghast Fireball
|
* Called when an entity explodes, either TNT, Creeper, or Ghast Fireball
|
||||||
*
|
*
|
||||||
* @todo: add javadoc see comment
|
* @see org.bukkit.event.entity.EntityExplodeEvent
|
||||||
*/
|
*/
|
||||||
ENTITY_EXPLODE (Category.LIVING_ENTITY),
|
ENTITY_EXPLODE (Category.LIVING_ENTITY),
|
||||||
/**
|
/**
|
||||||
|
@ -600,7 +607,7 @@ public abstract class Event implements Serializable {
|
||||||
* For EntityCreeper, this resets the fuse but does not kill the Entity.
|
* For EntityCreeper, this resets the fuse but does not kill the Entity.
|
||||||
* For EntityFireball and EntityTNTPrimed....?
|
* For EntityFireball and EntityTNTPrimed....?
|
||||||
*
|
*
|
||||||
* @see org.bukkit.event.entity.EntityExplodeTriggerEvent
|
* @see org.bukkit.event.entity.ExplosionPrimeEvent
|
||||||
*/
|
*/
|
||||||
EXPLOSION_PRIME (Category.LIVING_ENTITY),
|
EXPLOSION_PRIME (Category.LIVING_ENTITY),
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,9 +19,9 @@ public class BlockBreakEvent extends BlockEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the player doing the damage
|
* Gets the Player that is breaking the block
|
||||||
*
|
*
|
||||||
* @return the Player doing the damage
|
* @return the Player that is breaking the block
|
||||||
*/
|
*/
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
return player;
|
return player;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a block is damaged by a player
|
* Called when a block is damaged (hit by a player)
|
||||||
*/
|
*/
|
||||||
public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
public class BlockDamageEvent extends BlockEvent implements Cancellable {
|
||||||
private Player player;
|
private Player player;
|
||||||
|
|
|
@ -59,14 +59,20 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if the event was cancelled.
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
*/
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevent dispensing.
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
*/
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
cancelled = cancel;
|
cancelled = cancel;
|
||||||
|
|
|
@ -41,6 +41,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
|
||||||
*
|
*
|
||||||
* @param index index of the line to get
|
* @param index index of the line to get
|
||||||
* @return String line
|
* @return String line
|
||||||
|
* @throws IndexOutOfBoundsException
|
||||||
*/
|
*/
|
||||||
public String getLine(int index) throws IndexOutOfBoundsException {
|
public String getLine(int index) throws IndexOutOfBoundsException {
|
||||||
return lines[index];
|
return lines[index];
|
||||||
|
@ -51,6 +52,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
|
||||||
*
|
*
|
||||||
* @param index index of the line to set
|
* @param index index of the line to set
|
||||||
* @param line text to set
|
* @param line text to set
|
||||||
|
* @throws IndexOutOfBoundsException
|
||||||
*/
|
*/
|
||||||
public void setLine(int index, String line) throws IndexOutOfBoundsException {
|
public void setLine(int index, String line) throws IndexOutOfBoundsException {
|
||||||
lines[index] = line;
|
lines[index] = line;
|
||||||
|
|
|
@ -4,8 +4,7 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event when a skeleton or zombie catch on fire due to the sun.
|
* Called when an entity combusts due to the sun
|
||||||
* If the event is cancelled, the fire is stopped.
|
|
||||||
*/
|
*/
|
||||||
public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
|
@ -15,10 +14,22 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
|
||||||
this.cancel = false;
|
this.cancel = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,9 @@ import java.util.Random;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity is damaged by a projectile
|
||||||
|
*/
|
||||||
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
|
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
|
||||||
|
|
||||||
private Projectile projectile;
|
private Projectile projectile;
|
||||||
|
|
|
@ -7,8 +7,7 @@ import org.bukkit.Location;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Called when an entity explodes
|
||||||
* @author SpeaKeasY
|
|
||||||
*/
|
*/
|
||||||
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
|
@ -23,10 +22,22 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @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;
|
||||||
}
|
}
|
||||||
|
@ -50,6 +61,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the percentage of blocks to drop from this explosion
|
* Returns the percentage of blocks to drop from this explosion
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public float getYield() {
|
public float getYield() {
|
||||||
|
|
|
@ -5,8 +5,7 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Called when an entity interacts with an object
|
||||||
* @author durron597
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EntityInteractEvent extends EntityEvent implements Cancellable {
|
public class EntityInteractEvent extends EntityEvent implements Cancellable {
|
||||||
|
|
|
@ -10,37 +10,122 @@ import org.bukkit.event.painting.PaintingBreakEvent;
|
||||||
public class EntityListener implements Listener {
|
public class EntityListener implements Listener {
|
||||||
public EntityListener() {}
|
public EntityListener() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a creature is spawned into a world
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onCreatureSpawn(CreatureSpawnEvent event) {}
|
public void onCreatureSpawn(CreatureSpawnEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an item is spawned into a world
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onItemSpawn(ItemSpawnEvent event) {}
|
public void onItemSpawn(ItemSpawnEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity combusts due to the sun
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityCombust(EntityCombustEvent event) {}
|
public void onEntityCombust(EntityCombustEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity is damaged
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityDamage(EntityDamageEvent event) {}
|
public void onEntityDamage(EntityDamageEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity explodes
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityExplode(EntityExplodeEvent event) {}
|
public void onEntityExplode(EntityExplodeEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity's fuse is lit
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onExplosionPrime(ExplosionPrimeEvent event) {}
|
public void onExplosionPrime(ExplosionPrimeEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity dies
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityDeath(EntityDeathEvent event) {}
|
public void onEntityDeath(EntityDeathEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a creature targets another entity
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityTarget(EntityTargetEvent event) {}
|
public void onEntityTarget(EntityTargetEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity interacts with an object
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityInteract(EntityInteractEvent event) {}
|
public void onEntityInteract(EntityInteractEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity enters a portal
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityPortalEnter(EntityPortalEnterEvent event) {}
|
public void onEntityPortalEnter(EntityPortalEnterEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a painting is placed
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onPaintingPlace(PaintingPlaceEvent event) {}
|
public void onPaintingPlace(PaintingPlaceEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a painting is broken
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onPaintingBreak(PaintingBreakEvent event) {}
|
public void onPaintingBreak(PaintingBreakEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a Pig is struck by lightning
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onPigZap(PigZapEvent event) {}
|
public void onPigZap(PigZapEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a Creeper is struck by lightning
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onCreeperPower(CreeperPowerEvent event) {}
|
public void onCreeperPower(CreeperPowerEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity is tamed (currently only applies to Wolves)
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityTame(EntityTameEvent event) {}
|
public void onEntityTame(EntityTameEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity regains health (currently only applies to Players)
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onEntityRegainHealth(EntityRegainHealthEvent event) {}
|
public void onEntityRegainHealth(EntityRegainHealthEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a project hits an object
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onProjectileHit(ProjectileHitEvent event) {}
|
public void onProjectileHit(ProjectileHitEvent event) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores data for entities standing inside a portal block
|
* Stores data for entities standing inside a portal block
|
||||||
*/
|
*/
|
||||||
|
@ -18,8 +17,9 @@ public class EntityPortalEnterEvent extends EntityEvent {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Gets the portal block the entity is touching
|
* Gets the portal block the entity is touching
|
||||||
|
*
|
||||||
* @return The portal block the entity is touching
|
* @return The portal block the entity is touching
|
||||||
*/
|
*/
|
||||||
public Location getLocation() {
|
public Location getLocation() {
|
||||||
|
|
|
@ -12,14 +12,12 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
private int amount;
|
private int amount;
|
||||||
|
|
||||||
public EntityRegainHealthEvent(Entity entity, int amount)
|
public EntityRegainHealthEvent(Entity entity, int amount) {
|
||||||
{
|
|
||||||
super(Event.Type.ENTITY_REGAIN_HEALTH, entity);
|
super(Event.Type.ENTITY_REGAIN_HEALTH, entity);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EntityRegainHealthEvent(Event.Type type, Entity entity, int amount)
|
protected EntityRegainHealthEvent(Event.Type type, Entity entity, int amount) {
|
||||||
{
|
|
||||||
super(type, entity);
|
super(type, entity);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
@ -28,13 +26,14 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||||
* Gets the amount of regained health
|
* Gets the amount of regained health
|
||||||
* @return The amount of health regained
|
* @return The amount of health regained
|
||||||
*/
|
*/
|
||||||
public int getAmount()
|
public int getAmount() {
|
||||||
{
|
|
||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the amount of regained health
|
* Sets the amount of regained health
|
||||||
|
*
|
||||||
|
* @param amount the amount of health the entity will regain
|
||||||
*/
|
*/
|
||||||
public void setAmount(int amount) {
|
public void setAmount(int amount) {
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
|
|
|
@ -4,8 +4,7 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired when a mob (or any creature) targets another entity
|
* Called when a creature targets another entity
|
||||||
* @author tkelly
|
|
||||||
*/
|
*/
|
||||||
public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
||||||
private boolean cancel;
|
private boolean cancel;
|
||||||
|
@ -19,14 +18,21 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancel;
|
return cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cancel the change in target. The entity will remain with their original
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
* target, whether that is nothing or another entity.
|
* be executed in the server, but will still pass to other plugins
|
||||||
* @param cancel
|
*
|
||||||
|
* @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;
|
||||||
|
|
|
@ -4,6 +4,9 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Explosive;
|
import org.bukkit.entity.Explosive;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an entity has made a decision to explode.
|
||||||
|
*/
|
||||||
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;
|
||||||
|
@ -20,26 +23,58 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
|
||||||
this(explosive, explosive.getYield(), explosive.isIncendiary());
|
this(explosive, explosive.getYield(), explosive.isIncendiary());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @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 radius of the explosion
|
||||||
|
*
|
||||||
|
* @return returns the radius of the explosion
|
||||||
|
*/
|
||||||
public float getRadius() {
|
public float getRadius() {
|
||||||
return radius;
|
return radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the radius of the explosion
|
||||||
|
*
|
||||||
|
* @param radius the radius of the explosion
|
||||||
|
*/
|
||||||
public void setRadius(float radius) {
|
public void setRadius(float radius) {
|
||||||
this.radius = radius;
|
this.radius = radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether this explosion will create fire or not
|
||||||
|
*
|
||||||
|
* @return true if this explosion will create fire
|
||||||
|
*/
|
||||||
public boolean getFire() {
|
public boolean getFire() {
|
||||||
return fire;
|
return fire;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether this explosion will create fire or not
|
||||||
|
*
|
||||||
|
* @param fire true if you want this explosion to create fire
|
||||||
|
*/
|
||||||
public void setFire(boolean fire) {
|
public void setFire(boolean fire) {
|
||||||
this.fire = fire;
|
this.fire = fire;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.entity;
|
||||||
|
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a projectile hits an object
|
||||||
|
*/
|
||||||
public class ProjectileHitEvent extends EntityEvent {
|
public class ProjectileHitEvent extends EntityEvent {
|
||||||
|
|
||||||
public ProjectileHitEvent(Projectile projectile) {
|
public ProjectileHitEvent(Projectile projectile) {
|
||||||
|
|
|
@ -5,10 +5,7 @@ import org.bukkit.entity.Painting;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when a painting is removed by an entity
|
* Triggered when a painting is removed by an entity
|
||||||
*
|
|
||||||
* @author Tanel Suurhans
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
|
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
|
||||||
private Entity remover;
|
private Entity remover;
|
||||||
|
|
||||||
|
@ -17,6 +14,11 @@ public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
|
||||||
this.remover = remover;
|
this.remover = remover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the entity that removed the painting
|
||||||
|
*
|
||||||
|
* @return the entity that removed the painting.
|
||||||
|
*/
|
||||||
public Entity getRemover() {
|
public Entity getRemover() {
|
||||||
return remover;
|
return remover;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,7 @@ import org.bukkit.entity.Painting;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when a painting is removed by the world (water flowing over it, block damaged behind it)
|
* Triggered when a painting is removed by the world (water flowing over it, block damaged behind it)
|
||||||
*
|
|
||||||
* @author Tanel Suurhans
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PaintingBreakByWorldEvent extends PaintingBreakEvent {
|
public class PaintingBreakByWorldEvent extends PaintingBreakEvent {
|
||||||
public PaintingBreakByWorldEvent(final Painting painting) {
|
public PaintingBreakByWorldEvent(final Painting painting) {
|
||||||
super(painting, RemoveCause.WORLD);
|
super(painting, RemoveCause.WORLD);
|
||||||
|
|
|
@ -6,10 +6,7 @@ import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when a painting is removed
|
* Triggered when a painting is removed
|
||||||
*
|
|
||||||
* @author Tanel Suurhans
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
||||||
|
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
@ -20,14 +17,31 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
||||||
this.cause = cause;
|
this.cause = cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cause for the painting's removal
|
||||||
|
*
|
||||||
|
* @return the RemoveCause for the painting's removal
|
||||||
|
*/
|
||||||
public RemoveCause getCause() {
|
public RemoveCause getCause() {
|
||||||
return cause;
|
return cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
@ -36,13 +50,12 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
|
||||||
* An enum to specify the cause of the removal
|
* An enum to specify the cause of the removal
|
||||||
*/
|
*/
|
||||||
public enum RemoveCause {
|
public enum RemoveCause {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removed by an entity
|
* Removed by an entity
|
||||||
*/
|
*/
|
||||||
ENTITY,
|
ENTITY,
|
||||||
/**
|
/**
|
||||||
* Removed by the world - block destroyed behind, water flowing over etc
|
* Removed by the world - block the painting is on is destroyed, water flowing over etc
|
||||||
*/
|
*/
|
||||||
WORLD
|
WORLD
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ import org.bukkit.event.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a painting-related event.
|
* Represents a painting-related event.
|
||||||
*
|
|
||||||
* @author Tanel Suurhans
|
|
||||||
*/
|
*/
|
||||||
public class PaintingEvent extends Event {
|
public class PaintingEvent extends Event {
|
||||||
|
|
||||||
|
@ -18,7 +16,7 @@ public class PaintingEvent extends Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the painting.
|
* Gets the painting involved in this event.
|
||||||
*
|
*
|
||||||
* @return the painting
|
* @return the painting
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,8 +10,6 @@ import org.bukkit.event.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Triggered when a painting is created in the world
|
* Triggered when a painting is created in the world
|
||||||
*
|
|
||||||
* @author Tanel Suurhans
|
|
||||||
*/
|
*/
|
||||||
public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
|
public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
|
||||||
|
|
||||||
|
@ -38,7 +36,7 @@ public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the block painting placed on
|
* Returns the block that the painting was placed on
|
||||||
*
|
*
|
||||||
* @return Block returns the block painting placed on
|
* @return Block returns the block painting placed on
|
||||||
*/
|
*/
|
||||||
|
@ -55,10 +53,22 @@ public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
|
||||||
return blockFace;
|
return blockFace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,16 @@ package org.bukkit.event.player;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Represents a player animation event
|
* Represents a player animation event
|
||||||
*/
|
*/
|
||||||
public class PlayerAnimationEvent extends PlayerEvent {
|
public class PlayerAnimationEvent extends PlayerEvent {
|
||||||
|
|
||||||
private PlayerAnimationType animationType;
|
private PlayerAnimationType animationType;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Construct a new event
|
* Construct a new PlayerAnimation event
|
||||||
*
|
*
|
||||||
* @param type The event type
|
|
||||||
* @param player The player instance
|
* @param player The player instance
|
||||||
*/
|
*/
|
||||||
public PlayerAnimationEvent(final Player player) {
|
public PlayerAnimationEvent(final Player player) {
|
||||||
|
@ -22,10 +21,10 @@ public class PlayerAnimationEvent extends PlayerEvent {
|
||||||
animationType = PlayerAnimationType.ARM_SWING;
|
animationType = PlayerAnimationType.ARM_SWING;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get the type of this animation event
|
* Get the type of this animation event
|
||||||
*
|
*
|
||||||
* @returns the animation type
|
* @return the animation type
|
||||||
*/
|
*/
|
||||||
public PlayerAnimationType getAnimationType() {
|
public PlayerAnimationType getAnimationType() {
|
||||||
return animationType;
|
return animationType;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.bukkit.event.player;
|
package org.bukkit.event.player;
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Differet types of player animations
|
* Different types of player animations
|
||||||
*/
|
*/
|
||||||
public enum PlayerAnimationType {
|
public enum PlayerAnimationType {
|
||||||
ARM_SWING
|
ARM_SWING
|
||||||
|
|
|
@ -7,8 +7,6 @@ import org.bukkit.event.Cancellable;
|
||||||
/**
|
/**
|
||||||
* This event is fired when the player is almost about to enter the bed.
|
* This event is fired when the player is almost about to enter the bed.
|
||||||
* It can be cancelled.
|
* It can be cancelled.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
|
public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
|
||||||
|
|
||||||
|
@ -21,7 +19,8 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the cancellation state of this event.
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
*
|
*
|
||||||
* @return true if this event is cancelled
|
* @return true if this event is cancelled
|
||||||
*/
|
*/
|
||||||
|
@ -30,7 +29,8 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prevents the player from entering the bed.
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
*
|
*
|
||||||
* @param cancel true if you wish to cancel this event
|
* @param cancel true if you wish to cancel this event
|
||||||
*/
|
*/
|
||||||
|
@ -39,9 +39,9 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the bed block.
|
* Returns the bed block involved in this event.
|
||||||
*
|
*
|
||||||
* @return
|
* @return the bed block involved in this event
|
||||||
*/
|
*/
|
||||||
public Block getBed() {
|
public Block getBed() {
|
||||||
return bed;
|
return bed;
|
||||||
|
|
|
@ -5,8 +5,6 @@ import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This event is fired when the player is leaving a bed.
|
* This event is fired when the player is leaving a bed.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class PlayerBedLeaveEvent extends PlayerEvent {
|
public class PlayerBedLeaveEvent extends PlayerEvent {
|
||||||
|
|
||||||
|
@ -18,9 +16,9 @@ public class PlayerBedLeaveEvent extends PlayerEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the bed block.
|
* Returns the bed block involved in this event.
|
||||||
*
|
*
|
||||||
* @return
|
* @return the bed block involved in this event
|
||||||
*/
|
*/
|
||||||
public Block getBed() {
|
public Block getBed() {
|
||||||
return bed;
|
return bed;
|
||||||
|
|
|
@ -2,6 +2,10 @@ package org.bukkit.event.player;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called early in the command handling process. This event is only
|
||||||
|
* for very exceptional cases and you should not normally use it.
|
||||||
|
*/
|
||||||
public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
|
public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
|
||||||
public PlayerCommandPreprocessEvent(final Player player, final String message) {
|
public PlayerCommandPreprocessEvent(final Player player, final String message) {
|
||||||
super(Type.PLAYER_COMMAND_PREPROCESS, player, message);
|
super(Type.PLAYER_COMMAND_PREPROCESS, player, message);
|
||||||
|
|
|
@ -19,7 +19,7 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
|
||||||
/**
|
/**
|
||||||
* Gets the ItemDrop created by the player
|
* Gets the ItemDrop created by the player
|
||||||
*
|
*
|
||||||
* @return ItemDrop
|
* @return ItemDrop created by the player
|
||||||
*/
|
*/
|
||||||
public Item getItemDrop() {
|
public Item getItemDrop() {
|
||||||
return drop;
|
return drop;
|
||||||
|
|
|
@ -5,9 +5,7 @@ import org.bukkit.entity.Egg;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Called when a player throws an egg and it might hatch
|
||||||
* @author tkelly
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class PlayerEggThrowEvent extends PlayerEvent {
|
public class PlayerEggThrowEvent extends PlayerEvent {
|
||||||
private Egg egg;
|
private Egg egg;
|
||||||
|
@ -24,16 +22,16 @@ public class PlayerEggThrowEvent extends PlayerEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the egg.
|
* Gets the egg involved in this event.
|
||||||
*
|
*
|
||||||
* @return the egg
|
* @return the egg involved in this event
|
||||||
*/
|
*/
|
||||||
public Egg getEgg() {
|
public Egg getEgg() {
|
||||||
return egg;
|
return egg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grabs whether the egg is hatching or not. Will be what the server
|
* Gets whether the egg is hatching or not. Will be what the server
|
||||||
* would've done without interaction.
|
* would've done without interaction.
|
||||||
*
|
*
|
||||||
* @return boolean Whether the egg is going to hatch or not
|
* @return boolean Whether the egg is going to hatch or not
|
||||||
|
@ -43,7 +41,7 @@ public class PlayerEggThrowEvent extends PlayerEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether the egg will hatch.
|
* Sets whether the egg will hatch or not.
|
||||||
*
|
*
|
||||||
* @param hatching true if you want the egg to hatch
|
* @param hatching true if you want the egg to hatch
|
||||||
* false if you want it not to
|
* false if you want it not to
|
||||||
|
|
|
@ -16,6 +16,7 @@ public class PlayerEvent extends Event {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the player involved in this event
|
* Returns the player involved in this event
|
||||||
|
*
|
||||||
* @return Player who is involved in this event
|
* @return Player who is involved in this event
|
||||||
*/
|
*/
|
||||||
public final Player getPlayer() {
|
public final Player getPlayer() {
|
||||||
|
|
|
@ -9,9 +9,7 @@ import org.bukkit.event.Cancellable;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Called when a player interacts with an object or air.
|
||||||
* @author durron597
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
||||||
protected ItemStack item;
|
protected ItemStack item;
|
||||||
|
@ -93,7 +91,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
||||||
/**
|
/**
|
||||||
* Check if this event involved a block
|
* Check if this event involved a block
|
||||||
*
|
*
|
||||||
* return boolean true if it did
|
* @return boolean true if it did
|
||||||
*/
|
*/
|
||||||
public boolean hasBlock() {
|
public boolean hasBlock() {
|
||||||
return this.blockClicked != null;
|
return this.blockClicked != null;
|
||||||
|
@ -102,7 +100,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
||||||
/**
|
/**
|
||||||
* Check if this event involved an item
|
* Check if this event involved an item
|
||||||
*
|
*
|
||||||
* return boolean true if it did
|
* @return boolean true if it did
|
||||||
*/
|
*/
|
||||||
public boolean hasItem() {
|
public boolean hasItem() {
|
||||||
return this.item != null;
|
return this.item != null;
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.player;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a player joins a server
|
||||||
|
*/
|
||||||
public class PlayerJoinEvent extends PlayerEvent {
|
public class PlayerJoinEvent extends PlayerEvent {
|
||||||
private String joinMessage;
|
private String joinMessage;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@ package org.bukkit.event.player;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a player gets kicked from the server
|
||||||
|
*/
|
||||||
public class PlayerKickEvent extends PlayerEvent implements Cancellable {
|
public class PlayerKickEvent extends PlayerEvent implements Cancellable {
|
||||||
private String leaveMessage;
|
private String leaveMessage;
|
||||||
private String kickReason;
|
private String kickReason;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class PlayerListener implements Listener {
|
||||||
public void onPlayerRespawn(PlayerRespawnEvent event) {}
|
public void onPlayerRespawn(PlayerRespawnEvent event) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when a player interacts
|
* Called when a player interacts with an object or air.
|
||||||
*
|
*
|
||||||
* @param event Relevant event details
|
* @param event Relevant event details
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,9 +76,9 @@ public class PlayerPreLoginEvent extends Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the player name.
|
* Gets the player's name.
|
||||||
*
|
*
|
||||||
* @return
|
* @return the player's name
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.player;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a player leaves a server
|
||||||
|
*/
|
||||||
public class PlayerQuitEvent extends PlayerEvent {
|
public class PlayerQuitEvent extends PlayerEvent {
|
||||||
|
|
||||||
private String quitMessage;
|
private String quitMessage;
|
||||||
|
|
|
@ -32,9 +32,9 @@ public class PlayerRespawnEvent extends PlayerEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the respawn location is the players bed.
|
* Gets whether the respawn location is the player's bed.
|
||||||
*
|
*
|
||||||
* @return true if the respawn location is the players bed.
|
* @return true if the respawn location is the player's bed.
|
||||||
*/
|
*/
|
||||||
public boolean isBedSpawn() {
|
public boolean isBedSpawn() {
|
||||||
return this.isBedSpawn;
|
return this.isBedSpawn;
|
||||||
|
|
|
@ -4,8 +4,7 @@ import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Called when a player toggles their sneaking state
|
||||||
* @author azi
|
|
||||||
*/
|
*/
|
||||||
public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
|
public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
|
||||||
private boolean isSneaking;
|
private boolean isSneaking;
|
||||||
|
@ -17,8 +16,8 @@ public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the player is now sneaking.
|
* Returns whether the player is now sneaking or not.
|
||||||
*
|
*
|
||||||
* @return sneaking state
|
* @return sneaking state
|
||||||
*/
|
*/
|
||||||
public boolean isSneaking() {
|
public boolean isSneaking() {
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.server;
|
||||||
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a plugin is disabled.
|
||||||
|
*/
|
||||||
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);
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.server;
|
||||||
|
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a plugin is enabled.
|
||||||
|
*/
|
||||||
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);
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.bukkit.event.server;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for plugin loaded and unloaded events
|
* Used for plugin enable and disable events
|
||||||
*/
|
*/
|
||||||
public class PluginEvent extends ServerEvent {
|
public class PluginEvent extends ServerEvent {
|
||||||
private final Plugin plugin;
|
private final Plugin plugin;
|
||||||
|
|
|
@ -5,8 +5,6 @@ import org.bukkit.entity.Vehicle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a vehicle collides with a block.
|
* Raised when a vehicle collides with a block.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
|
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
|
||||||
private Block block;
|
private Block block;
|
||||||
|
@ -16,6 +14,11 @@ public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
|
||||||
this.block = block;
|
this.block = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the block the vehicle collided with
|
||||||
|
*
|
||||||
|
* @return the block the vehicle collided with
|
||||||
|
*/
|
||||||
public Block getBlock() {
|
public Block getBlock() {
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,6 @@ import org.bukkit.entity.Vehicle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a vehicle collides.
|
* Raised when a vehicle collides.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class VehicleCollisionEvent extends VehicleEvent {
|
public class VehicleCollisionEvent extends VehicleEvent {
|
||||||
public VehicleCollisionEvent(Type type, Vehicle vehicle) {
|
public VehicleCollisionEvent(Type type, Vehicle vehicle) {
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a vehicle receives damage.
|
* Raised when a vehicle receives damage.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
||||||
private Entity attacker;
|
private Entity attacker;
|
||||||
|
@ -20,16 +18,26 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Entity that is attacking the vehicle
|
||||||
|
*
|
||||||
|
* @return the Entity that is attacking the vehicle
|
||||||
|
*/
|
||||||
public Entity getAttacker() {
|
public Entity getAttacker() {
|
||||||
return attacker;
|
return attacker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the damage done to the vehicle
|
||||||
|
*
|
||||||
|
* @return the damage done to the vehicle
|
||||||
|
*/
|
||||||
public int getDamage() {
|
public int getDamage() {
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the damage.
|
* Sets the damage done to the vehicle
|
||||||
*
|
*
|
||||||
* @param damage
|
* @param damage
|
||||||
*/
|
*/
|
||||||
|
@ -37,10 +45,22 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a vehicle is destroyed
|
* Raised when a vehicle is destroyed
|
||||||
*
|
|
||||||
* @author sk89q, cyklo
|
|
||||||
*/
|
*/
|
||||||
public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
||||||
private Entity attacker;
|
private Entity attacker;
|
||||||
|
@ -18,14 +16,31 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
|
||||||
this.attacker = attacker;
|
this.attacker = attacker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Entity that has destroyed the vehicle
|
||||||
|
*
|
||||||
|
* @return the Entity that has destroyed the vehicle
|
||||||
|
*/
|
||||||
public Entity getAttacker() {
|
public Entity getAttacker() {
|
||||||
return attacker;
|
return attacker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when an entity enters a vehicle.
|
* Raised when an entity enters a vehicle.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
@ -19,18 +17,30 @@ public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the entity that entered the vehicle.
|
* Gets the Entity that entered the vehicle.
|
||||||
*
|
*
|
||||||
* @return
|
* @return the Entity that entered the vehicle
|
||||||
*/
|
*/
|
||||||
public Entity getEntered() {
|
public Entity getEntered() {
|
||||||
return entered;
|
return entered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Raised when a living entity exits a vehicle.
|
* Raised when a living entity exits a vehicle.
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
*/
|
||||||
public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
@ -27,10 +25,22 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable {
|
||||||
return exited;
|
return exited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import org.bukkit.World;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores data for thudner state changing in a world
|
* Stores data for thunder state changing in a world
|
||||||
*/
|
*/
|
||||||
public class ThunderChangeEvent extends WeatherEvent implements Cancellable {
|
public class ThunderChangeEvent extends WeatherEvent implements Cancellable {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import org.bukkit.World;
|
||||||
import org.bukkit.event.Event;
|
import org.bukkit.event.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an Weather-related event
|
* Represents a Weather-related event
|
||||||
*/
|
*/
|
||||||
public class WeatherEvent extends Event {
|
public class WeatherEvent extends Event {
|
||||||
protected World world;
|
protected World world;
|
||||||
|
@ -15,8 +15,9 @@ public class WeatherEvent extends Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the World where this event is occuring
|
* Returns the World where this event is occurring
|
||||||
* @return World this event is occuring in
|
*
|
||||||
|
* @return World this event is occurring in
|
||||||
*/
|
*/
|
||||||
public final World getWorld() {
|
public final World getWorld() {
|
||||||
return world;
|
return world;
|
||||||
|
|
|
@ -8,9 +8,24 @@ import org.bukkit.event.Listener;
|
||||||
public class WeatherListener implements Listener {
|
public class WeatherListener implements Listener {
|
||||||
public WeatherListener() {}
|
public WeatherListener() {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a weather change occurs
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onWeatherChange(WeatherChangeEvent event) {}
|
public void onWeatherChange(WeatherChangeEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when the state of thunder changes
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onThunderChange(ThunderChangeEvent event) {}
|
public void onThunderChange(ThunderChangeEvent event) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when lightning strikes
|
||||||
|
*
|
||||||
|
* @param event Relevant event details
|
||||||
|
*/
|
||||||
public void onLightningStrike(LightningStrikeEvent event) {}
|
public void onLightningStrike(LightningStrikeEvent event) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.world;
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a Chunk related event
|
||||||
|
*/
|
||||||
public class ChunkEvent extends WorldEvent {
|
public class ChunkEvent extends WorldEvent {
|
||||||
protected Chunk chunk;
|
protected Chunk chunk;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
package org.bukkit.event.world;
|
package org.bukkit.event.world;
|
||||||
|
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
package org.bukkit.event.world;
|
package org.bukkit.event.world;
|
||||||
|
|
||||||
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the world attempts to create a matching end to a portal
|
* Called when the world attempts to create a matching end to a portal
|
||||||
*/
|
*/
|
||||||
|
@ -19,6 +17,11 @@ public class PortalCreateEvent extends WorldEvent implements Cancellable {
|
||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets an array list of all the blocks associated with the created portal
|
||||||
|
*
|
||||||
|
* @return array list of all the blocks associated with the created portal
|
||||||
|
*/
|
||||||
public ArrayList<Block> getBlocks() {
|
public ArrayList<Block> getBlocks() {
|
||||||
return this.blocks;
|
return this.blocks;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@ import org.bukkit.Location;
|
||||||
/**
|
/**
|
||||||
* An event that is called when a world's spawn changes. The
|
* An event that is called when a world's spawn changes. The
|
||||||
* world's previous spawn location is included.
|
* world's previous spawn location is included.
|
||||||
*
|
|
||||||
* @author willurd
|
|
||||||
*/
|
*/
|
||||||
public class SpawnChangeEvent extends WorldEvent {
|
public class SpawnChangeEvent extends WorldEvent {
|
||||||
private Location previousLocation;
|
private Location previousLocation;
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.world;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a World is initializing
|
||||||
|
*/
|
||||||
public class WorldInitEvent extends WorldEvent {
|
public class WorldInitEvent extends WorldEvent {
|
||||||
public WorldInitEvent(World world) {
|
public WorldInitEvent(World world) {
|
||||||
super(Type.WORLD_INIT, world);
|
super(Type.WORLD_INIT, world);
|
||||||
|
|
|
@ -2,6 +2,9 @@ package org.bukkit.event.world;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a World is loaded
|
||||||
|
*/
|
||||||
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);
|
||||||
|
|
|
@ -3,6 +3,9 @@ package org.bukkit.event.world;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when a World is unloaded
|
||||||
|
*/
|
||||||
public class WorldUnloadEvent extends WorldEvent implements Cancellable {
|
public class WorldUnloadEvent extends WorldEvent implements Cancellable {
|
||||||
|
|
||||||
private boolean isCancelled;
|
private boolean isCancelled;
|
||||||
|
@ -11,10 +14,22 @@ public class WorldUnloadEvent extends WorldEvent implements Cancellable {
|
||||||
super(Type.WORLD_UNLOAD, world);
|
super(Type.WORLD_UNLOAD, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @return true if this event is cancelled
|
||||||
|
*/
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return this.isCancelled;
|
return this.isCancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the cancellation state of this event. A cancelled event will not
|
||||||
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
*
|
||||||
|
* @param cancel true if you wish to cancel this event
|
||||||
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
this.isCancelled = cancel;
|
this.isCancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue