More JavaDoc improvements.

By: EvilSeph <evilseph@unaligned.org>
This commit is contained in:
Bukkit/Spigot 2011-06-24 02:32:04 -04:00
parent 0630db640b
commit c54128077a
56 changed files with 435 additions and 139 deletions

View file

@ -9,7 +9,7 @@ public class CustomEventListener implements Listener {
public CustomEventListener() {}
/**
* Called when a player joins a server
* Called when a custom event is fired
*
* @param event Relevant event details
*/

View file

@ -26,6 +26,7 @@ public abstract class Event implements Serializable {
/**
* Gets the Type of this event
*
* @return Event type that this object represents
*/
public final Type getType() {
@ -89,6 +90,7 @@ public abstract class Event implements Serializable {
/**
* Represents Player-based events
*
* @see Category.LIVING_ENTITY
*/
PLAYER,
@ -109,7 +111,7 @@ public abstract class Event implements Serializable {
*/
WEATHER,
/**
* Vehicle-based events
* Represents Vehicle-based events
*/
VEHICLE,
/**
@ -125,7 +127,7 @@ public abstract class Event implements Serializable {
*/
INVENTORY,
/**
* Any miscellaneous events
* Represents any miscellaneous events
*/
MISCELLANEOUS;
}
@ -144,7 +146,7 @@ public abstract class Event implements Serializable {
/**
* 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),
/**
@ -162,13 +164,13 @@ public abstract class Event implements Serializable {
/**
* Called when a player respawns
*
* @see org.bukkit.event.player.PlayerEvent
* @see org.bukkit.event.player.PlayerRespawnEvent
*/
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),
/**
@ -178,15 +180,15 @@ public abstract class Event implements Serializable {
*/
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),
/**
* 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),
/**
@ -196,7 +198,7 @@ public abstract class Event implements Serializable {
*/
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
*/
@ -204,13 +206,13 @@ public abstract class Event implements Serializable {
/**
* Called when a player toggles sneak mode
*
* @todo: add javadoc see comment
* @see org.bukkit.event.player.PlayerToggleSneakEvent
*/
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),
/**
@ -220,7 +222,7 @@ public abstract class Event implements Serializable {
*/
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
*/
@ -228,7 +230,7 @@ public abstract class Event implements Serializable {
/**
* 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),
/**
@ -282,7 +284,7 @@ public abstract class Event implements Serializable {
/**
* Called when a player leaves a bed
*
* @see org.bukkit.event.player.PlayerBedEnterEvent
* @see org.bukkit.event.player.PlayerBedLeaveEvent
*/
PLAYER_BED_LEAVE(Category.PLAYER),
@ -337,7 +339,7 @@ public abstract class Event implements Serializable {
/**
* Called when a block dispenses something
*
* @see org.bukkit.event.block.BlockPlaceEvent
* @see org.bukkit.event.block.BlockDispenseEvent
*/
BLOCK_DISPENSE (Category.BLOCK),
/**
@ -363,11 +365,11 @@ public abstract class Event implements Serializable {
* that are actually capable of transmitting or carrying a redstone
* current
*
* @see org.bukkit.event.block.BlockFromToEvent
* @see org.bukkit.event.block.BlockRedstoneEvent
*/
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
*/
@ -431,14 +433,12 @@ public abstract class Event implements Serializable {
* @todo: add javadoc see comment
*/
INVENTORY_TRANSACTION (Category.INVENTORY),
/**
* Called when an ItemStack is successfully smelted in a furnace.
*
* @see org.bukkit.event.inventory.FurnaceSmeltEvent
*/
FURNACE_SMELT (Category.INVENTORY),
/**
* 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
*
* @see org.bukkit.event.server.PluginEvent
* @see org.bukkit.event.server.PluginEnableEvent
*/
PLUGIN_ENABLE (Category.SERVER),
/**
* Called when a plugin is disabled
*
* @see org.bukkit.event.server.PluginEvent
* @see org.bukkit.event.server.PluginDisableEvent
*/
PLUGIN_DISABLE (Category.SERVER),
/**
* Called when a server command is called
*
* @see org.bukkit.event.server.PluginEvent
* @see org.bukkit.event.server.ServerCommandEvent
*/
SERVER_COMMAND (Category.SERVER),
@ -511,18 +511,25 @@ public abstract class Event implements Serializable {
/**
* Called when a world is saved
*
* @see org.bukkit.event.world.WorldSaveEvent
*/
WORLD_SAVE (Category.WORLD),
/**
* Called when a World is initializing
*
* @see org.bukkit.event.world.WorldInitEvent
*/
WORLD_INIT (Category.WORLD),
/**
* Called when a World is loaded
*
* @see org.bukkit.event.world.WorldLoadEvent
*/
WORLD_LOAD (Category.WORLD),
/**
* Called when a World is unloaded
*
* @see org.bukkit.event.world.WorldUnloadEvent
*/
WORLD_UNLOAD (Category.WORLD),
/**
@ -539,13 +546,13 @@ public abstract class Event implements Serializable {
/**
* Called when a painting is placed by player
*
* @see org.bukkit.event.painting.PaintingCreateEvent
* @see org.bukkit.event.painting.PaintingPlaceEvent
*/
PAINTING_PLACE (Category.ENTITY),
/**
* Called when a painting is removed
*
* @see org.bukkit.event.painting.PaintingRemoveEvent
* @see org.bukkit.event.painting.PaintingBreakEvent
*/
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
* in the world "naturally"
*
* @todo: add javadoc see comment
* @see org.bukkit.event.entity.CreatureSpawnEvent
*/
CREATURE_SPAWN (Category.LIVING_ENTITY),
/**
@ -575,19 +582,19 @@ public abstract class Event implements Serializable {
/**
* Called when a LivingEntity dies
*
* @todo: add javadoc see comment
* @see org.bukkit.event.entity.EntityDeathEvent
*/
ENTITY_DEATH (Category.LIVING_ENTITY),
/**
* 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),
/**
* 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),
/**
@ -600,7 +607,7 @@ public abstract class Event implements Serializable {
* For EntityCreeper, this resets the fuse but does not kill the Entity.
* For EntityFireball and EntityTNTPrimed....?
*
* @see org.bukkit.event.entity.EntityExplodeTriggerEvent
* @see org.bukkit.event.entity.ExplosionPrimeEvent
*/
EXPLOSION_PRIME (Category.LIVING_ENTITY),
/**

View file

@ -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() {
return player;

View file

@ -6,7 +6,7 @@ import org.bukkit.event.Cancellable;
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 {
private Player player;

View file

@ -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() {
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) {
cancelled = cancel;

View file

@ -41,6 +41,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
*
* @param index index of the line to get
* @return String line
* @throws IndexOutOfBoundsException
*/
public String getLine(int index) throws IndexOutOfBoundsException {
return lines[index];
@ -51,6 +52,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
*
* @param index index of the line to set
* @param line text to set
* @throws IndexOutOfBoundsException
*/
public void setLine(int index, String line) throws IndexOutOfBoundsException {
lines[index] = line;

View file

@ -4,8 +4,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
/**
* The event when a skeleton or zombie catch on fire due to the sun.
* If the event is cancelled, the fire is stopped.
* Called when an entity combusts due to the sun
*/
public class EntityCombustEvent extends EntityEvent implements Cancellable {
private boolean cancel;
@ -15,10 +14,22 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
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() {
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) {
this.cancel = cancel;
}

View file

@ -5,6 +5,9 @@ import java.util.Random;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Projectile;
/**
* Called when an entity is damaged by a projectile
*/
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {
private Projectile projectile;

View file

@ -7,8 +7,7 @@ import org.bukkit.Location;
import org.bukkit.event.Cancellable;
/**
*
* @author SpeaKeasY
* Called when an entity explodes
*/
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
@ -23,10 +22,22 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
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() {
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) {
this.cancel = cancel;
}
@ -50,6 +61,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
/**
* Returns the percentage of blocks to drop from this explosion
*
* @return
*/
public float getYield() {

View file

@ -5,8 +5,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
/**
*
* @author durron597
* Called when an entity interacts with an object
*
*/
public class EntityInteractEvent extends EntityEvent implements Cancellable {

View file

@ -10,37 +10,122 @@ import org.bukkit.event.painting.PaintingBreakEvent;
public class EntityListener implements Listener {
public EntityListener() {}
/**
* Called when a creature is spawned into a world
*
* @param event Relevant event details
*/
public void onCreatureSpawn(CreatureSpawnEvent event) {}
/**
* Called when an item is spawned into a world
*
* @param event Relevant event details
*/
public void onItemSpawn(ItemSpawnEvent event) {}
/**
* Called when an entity combusts due to the sun
*
* @param event Relevant event details
*/
public void onEntityCombust(EntityCombustEvent event) {}
/**
* Called when an entity is damaged
*
* @param event Relevant event details
*/
public void onEntityDamage(EntityDamageEvent event) {}
/**
* Called when an entity explodes
*
* @param event Relevant event details
*/
public void onEntityExplode(EntityExplodeEvent event) {}
/**
* Called when an entity's fuse is lit
*
* @param event Relevant event details
*/
public void onExplosionPrime(ExplosionPrimeEvent event) {}
/**
* Called when an entity dies
*
* @param event Relevant event details
*/
public void onEntityDeath(EntityDeathEvent event) {}
/**
* Called when a creature targets another entity
*
* @param event Relevant event details
*/
public void onEntityTarget(EntityTargetEvent event) {}
/**
* Called when an entity interacts with an object
*
* @param event Relevant event details
*/
public void onEntityInteract(EntityInteractEvent event) {}
/**
* Called when an entity enters a portal
*
* @param event Relevant event details
*/
public void onEntityPortalEnter(EntityPortalEnterEvent event) {}
/**
* Called when a painting is placed
*
* @param event Relevant event details
*/
public void onPaintingPlace(PaintingPlaceEvent event) {}
/**
* Called when a painting is broken
*
* @param event Relevant event details
*/
public void onPaintingBreak(PaintingBreakEvent event) {}
/**
* Called when a Pig is struck by lightning
*
* @param event Relevant event details
*/
public void onPigZap(PigZapEvent event) {}
/**
* Called when a Creeper is struck by lightning
*
* @param event Relevant event details
*/
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) {}
/**
* Called when an entity regains health (currently only applies to Players)
*
* @param event Relevant event details
*/
public void onEntityRegainHealth(EntityRegainHealthEvent event) {}
/**
* Called when a project hits an object
*
* @param event Relevant event details
*/
public void onProjectileHit(ProjectileHitEvent event) {}
}

View file

@ -5,7 +5,6 @@ import org.bukkit.entity.Entity;
import org.bukkit.Location;
import org.bukkit.event.Cancellable;
/**
* Stores data for entities standing inside a portal block
*/
@ -18,8 +17,9 @@ public class EntityPortalEnterEvent extends EntityEvent {
this.location = location;
}
/*
/**
* Gets the portal block the entity is touching
*
* @return The portal block the entity is touching
*/
public Location getLocation() {

View file

@ -12,14 +12,12 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
private boolean cancelled;
private int amount;
public EntityRegainHealthEvent(Entity entity, int amount)
{
public EntityRegainHealthEvent(Entity entity, int amount) {
super(Event.Type.ENTITY_REGAIN_HEALTH, entity);
this.amount = amount;
}
protected EntityRegainHealthEvent(Event.Type type, Entity entity, int amount)
{
protected EntityRegainHealthEvent(Event.Type type, Entity entity, int amount) {
super(type, entity);
this.amount = amount;
}
@ -28,13 +26,14 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
* Gets the amount of regained health
* @return The amount of health regained
*/
public int getAmount()
{
public int getAmount() {
return amount;
}
/**
* Sets the amount of regained health
*
* @param amount the amount of health the entity will regain
*/
public void setAmount(int amount) {
this.amount = amount;

View file

@ -4,8 +4,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
/**
* This event is fired when a mob (or any creature) targets another entity
* @author tkelly
* Called when a creature targets another entity
*/
public class EntityTargetEvent extends EntityEvent implements Cancellable {
private boolean cancel;
@ -19,14 +18,21 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
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() {
return cancel;
}
/**
* Cancel the change in target. The entity will remain with their original
* target, whether that is nothing or another entity.
* @param 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) {
this.cancel = cancel;

View file

@ -4,6 +4,9 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Explosive;
import org.bukkit.event.Cancellable;
/**
* Called when an entity has made a decision to explode.
*/
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private float radius;
@ -20,26 +23,58 @@ public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
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() {
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) {
this.cancel = cancel;
}
/**
* Gets the radius of the explosion
*
* @return returns the radius of the explosion
*/
public float getRadius() {
return radius;
}
/**
* Sets the radius of the explosion
*
* @param radius the radius of the explosion
*/
public void setRadius(float radius) {
this.radius = radius;
}
/**
* Gets whether this explosion will create fire or not
*
* @return true if this explosion will create fire
*/
public boolean getFire() {
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) {
this.fire = fire;
}

View file

@ -2,6 +2,9 @@ package org.bukkit.event.entity;
import org.bukkit.entity.Projectile;
/**
* Called when a projectile hits an object
*/
public class ProjectileHitEvent extends EntityEvent {
public ProjectileHitEvent(Projectile projectile) {

View file

@ -5,10 +5,7 @@ import org.bukkit.entity.Painting;
/**
* Triggered when a painting is removed by an entity
*
* @author Tanel Suurhans
*/
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
private Entity remover;
@ -17,6 +14,11 @@ public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
this.remover = remover;
}
/**
* Gets the entity that removed the painting
*
* @return the entity that removed the painting.
*/
public Entity getRemover() {
return remover;
}

View file

@ -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)
*
* @author Tanel Suurhans
*/
public class PaintingBreakByWorldEvent extends PaintingBreakEvent {
public PaintingBreakByWorldEvent(final Painting painting) {
super(painting, RemoveCause.WORLD);

View file

@ -6,10 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Triggered when a painting is removed
*
* @author Tanel Suurhans
*/
public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
private boolean cancelled;
@ -20,14 +17,31 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
this.cause = cause;
}
/**
* Gets the cause for the painting's removal
*
* @return the RemoveCause for the painting's removal
*/
public RemoveCause getCause() {
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() {
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) {
this.cancelled = cancel;
}
@ -36,13 +50,12 @@ public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
* An enum to specify the cause of the removal
*/
public enum RemoveCause {
/**
* Removed by an 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

View file

@ -5,8 +5,6 @@ import org.bukkit.event.Event;
/**
* Represents a painting-related event.
*
* @author Tanel Suurhans
*/
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
*/

View file

@ -10,8 +10,6 @@ import org.bukkit.event.Event;
/**
* Triggered when a painting is created in the world
*
* @author Tanel Suurhans
*/
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
*/
@ -55,10 +53,22 @@ public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
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() {
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) {
this.cancelled = cancel;
}

View file

@ -2,17 +2,16 @@ package org.bukkit.event.player;
import org.bukkit.entity.Player;
/*
/**
* Represents a player animation event
*/
public class PlayerAnimationEvent extends PlayerEvent {
private PlayerAnimationType animationType;
/*
* Construct a new event
/**
* Construct a new PlayerAnimation event
*
* @param type The event type
* @param player The player instance
*/
public PlayerAnimationEvent(final Player player) {
@ -22,10 +21,10 @@ public class PlayerAnimationEvent extends PlayerEvent {
animationType = PlayerAnimationType.ARM_SWING;
}
/*
/**
* Get the type of this animation event
*
* @returns the animation type
* @return the animation type
*/
public PlayerAnimationType getAnimationType() {
return animationType;

View file

@ -1,7 +1,7 @@
package org.bukkit.event.player;
/*
* Differet types of player animations
/**
* Different types of player animations
*/
public enum PlayerAnimationType {
ARM_SWING

View file

@ -7,8 +7,6 @@ import org.bukkit.event.Cancellable;
/**
* This event is fired when the player is almost about to enter the bed.
* It can be cancelled.
*
* @author sk89q
*/
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
*/
@ -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
*/
@ -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() {
return bed;

View file

@ -5,8 +5,6 @@ import org.bukkit.entity.Player;
/**
* This event is fired when the player is leaving a bed.
*
* @author sk89q
*/
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() {
return bed;

View file

@ -2,6 +2,10 @@ package org.bukkit.event.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 PlayerCommandPreprocessEvent(final Player player, final String message) {
super(Type.PLAYER_COMMAND_PREPROCESS, player, message);

View file

@ -19,7 +19,7 @@ public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
/**
* Gets the ItemDrop created by the player
*
* @return ItemDrop
* @return ItemDrop created by the player
*/
public Item getItemDrop() {
return drop;

View file

@ -5,9 +5,7 @@ import org.bukkit.entity.Egg;
import org.bukkit.entity.Player;
/**
*
* @author tkelly
*
* Called when a player throws an egg and it might hatch
*/
public class PlayerEggThrowEvent extends PlayerEvent {
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() {
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.
*
* @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
* false if you want it not to

View file

@ -16,6 +16,7 @@ public class PlayerEvent extends Event {
/**
* Returns the player involved in this event
*
* @return Player who is involved in this event
*/
public final Player getPlayer() {

View file

@ -9,9 +9,7 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.block.Action;
/**
*
* @author durron597
*
* Called when a player interacts with an object or air.
*/
public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
protected ItemStack item;
@ -93,7 +91,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
/**
* Check if this event involved a block
*
* return boolean true if it did
* @return boolean true if it did
*/
public boolean hasBlock() {
return this.blockClicked != null;
@ -102,7 +100,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
/**
* Check if this event involved an item
*
* return boolean true if it did
* @return boolean true if it did
*/
public boolean hasItem() {
return this.item != null;

View file

@ -2,6 +2,9 @@ package org.bukkit.event.player;
import org.bukkit.entity.Player;
/**
* Called when a player joins a server
*/
public class PlayerJoinEvent extends PlayerEvent {
private String joinMessage;

View file

@ -3,6 +3,9 @@ package org.bukkit.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
/**
* Called when a player gets kicked from the server
*/
public class PlayerKickEvent extends PlayerEvent implements Cancellable {
private String leaveMessage;
private String kickReason;

View file

@ -66,7 +66,7 @@ public class PlayerListener implements Listener {
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
*/

View file

@ -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() {
return name;

View file

@ -2,6 +2,9 @@ package org.bukkit.event.player;
import org.bukkit.entity.Player;
/**
* Called when a player leaves a server
*/
public class PlayerQuitEvent extends PlayerEvent {
private String quitMessage;

View file

@ -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() {
return this.isBedSpawn;

View file

@ -4,8 +4,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
/**
*
* @author azi
* Called when a player toggles their sneaking state
*/
public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
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
*/
public boolean isSneaking() {

View file

@ -2,6 +2,9 @@ package org.bukkit.event.server;
import org.bukkit.plugin.Plugin;
/**
* Called when a plugin is disabled.
*/
public class PluginDisableEvent extends PluginEvent {
public PluginDisableEvent(Plugin plugin) {
super(Type.PLUGIN_DISABLE, plugin);

View file

@ -2,6 +2,9 @@ package org.bukkit.event.server;
import org.bukkit.plugin.Plugin;
/**
* Called when a plugin is enabled.
*/
public class PluginEnableEvent extends PluginEvent {
public PluginEnableEvent(Plugin plugin) {
super(Type.PLUGIN_ENABLE, plugin);

View file

@ -3,7 +3,7 @@ package org.bukkit.event.server;
import org.bukkit.plugin.Plugin;
/**
* Used for plugin loaded and unloaded events
* Used for plugin enable and disable events
*/
public class PluginEvent extends ServerEvent {
private final Plugin plugin;

View file

@ -5,8 +5,6 @@ import org.bukkit.entity.Vehicle;
/**
* Raised when a vehicle collides with a block.
*
* @author sk89q
*/
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
private Block block;
@ -16,6 +14,11 @@ public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
this.block = block;
}
/**
* Gets the block the vehicle collided with
*
* @return the block the vehicle collided with
*/
public Block getBlock() {
return block;
}

View file

@ -4,8 +4,6 @@ import org.bukkit.entity.Vehicle;
/**
* Raised when a vehicle collides.
*
* @author sk89q
*/
public class VehicleCollisionEvent extends VehicleEvent {
public VehicleCollisionEvent(Type type, Vehicle vehicle) {

View file

@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
/**
* Raised when a vehicle receives damage.
*
* @author sk89q
*/
public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
private Entity attacker;
@ -20,16 +18,26 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
this.damage = damage;
}
/**
* Gets the Entity that is attacking the vehicle
*
* @return the Entity that is attacking the vehicle
*/
public Entity getAttacker() {
return attacker;
}
/**
* Gets the damage done to the vehicle
*
* @return the damage done to the vehicle
*/
public int getDamage() {
return damage;
}
/**
* Change the damage.
* Sets the damage done to the vehicle
*
* @param damage
*/
@ -37,10 +45,22 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
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() {
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) {
this.cancelled = cancel;
}

View file

@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
/**
* Raised when a vehicle is destroyed
*
* @author sk89q, cyklo
*/
public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
private Entity attacker;
@ -18,14 +16,31 @@ public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
this.attacker = attacker;
}
/**
* Gets the Entity that has destroyed the vehicle
*
* @return the Entity that has destroyed the vehicle
*/
public Entity getAttacker() {
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() {
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) {
this.cancelled = cancel;
}

View file

@ -6,8 +6,6 @@ import org.bukkit.event.Cancellable;
/**
* Raised when an entity enters a vehicle.
*
* @author sk89q
*/
public class VehicleEnterEvent extends VehicleEvent implements Cancellable {
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() {
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() {
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) {
this.cancelled = cancel;
}

View file

@ -6,8 +6,6 @@ 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;
@ -27,10 +25,22 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable {
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() {
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) {
this.cancelled = cancel;
}

View file

@ -4,7 +4,7 @@ import org.bukkit.World;
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 {

View file

@ -4,7 +4,7 @@ import org.bukkit.World;
import org.bukkit.event.Event;
/**
* Represents an Weather-related event
* Represents a Weather-related event
*/
public class WeatherEvent extends Event {
protected World world;
@ -15,8 +15,9 @@ public class WeatherEvent extends Event {
}
/**
* Returns the World where this event is occuring
* @return World this event is occuring in
* Returns the World where this event is occurring
*
* @return World this event is occurring in
*/
public final World getWorld() {
return world;

View file

@ -8,9 +8,24 @@ import org.bukkit.event.Listener;
public class WeatherListener implements Listener {
public WeatherListener() {}
/**
* Called when a weather change occurs
*
* @param event Relevant event details
*/
public void onWeatherChange(WeatherChangeEvent event) {}
/**
* Called when the state of thunder changes
*
* @param event Relevant event details
*/
public void onThunderChange(ThunderChangeEvent event) {}
/**
* Called when lightning strikes
*
* @param event Relevant event details
*/
public void onLightningStrike(LightningStrikeEvent event) {}
}

View file

@ -2,6 +2,9 @@ package org.bukkit.event.world;
import org.bukkit.Chunk;
/**
* Represents a Chunk related event
*/
public class ChunkEvent extends WorldEvent {
protected Chunk chunk;

View file

@ -1,4 +1,3 @@
package org.bukkit.event.world;
import org.bukkit.Chunk;

View file

@ -1,12 +1,10 @@
package org.bukkit.event.world;
import org.bukkit.block.Block;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
import java.util.ArrayList;
/**
* 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;
}
/**
* 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() {
return this.blocks;
}

View file

@ -6,8 +6,6 @@ import org.bukkit.Location;
/**
* An event that is called when a world's spawn changes. The
* world's previous spawn location is included.
*
* @author willurd
*/
public class SpawnChangeEvent extends WorldEvent {
private Location previousLocation;

View file

@ -2,6 +2,9 @@ package org.bukkit.event.world;
import org.bukkit.World;
/**
* Called when a World is initializing
*/
public class WorldInitEvent extends WorldEvent {
public WorldInitEvent(World world) {
super(Type.WORLD_INIT, world);

View file

@ -2,6 +2,9 @@ package org.bukkit.event.world;
import org.bukkit.World;
/**
* Called when a World is loaded
*/
public class WorldLoadEvent extends WorldEvent {
public WorldLoadEvent(World world) {
super(Type.WORLD_LOAD, world);

View file

@ -3,6 +3,9 @@ package org.bukkit.event.world;
import org.bukkit.World;
import org.bukkit.event.Cancellable;
/**
* Called when a World is unloaded
*/
public class WorldUnloadEvent extends WorldEvent implements Cancellable {
private boolean isCancelled;
@ -11,10 +14,22 @@ public class WorldUnloadEvent extends WorldEvent implements Cancellable {
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() {
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) {
this.isCancelled = cancel;
}