Generic cleanup of warnings, whitespace and style.

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot
2011-12-25 16:02:30 +01:00
parent 98960fd73e
commit aaab1cba23
257 changed files with 1408 additions and 1152 deletions

View File

@@ -7,6 +7,7 @@ import org.bukkit.entity.Projectile;
/**
* Represents an event
*/
@SuppressWarnings("serial")
public abstract class Event implements Serializable {
private final Type type;
private final String name;
@@ -146,128 +147,128 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.player.PlayerJoinEvent
*/
PLAYER_JOIN (Category.PLAYER),
PLAYER_JOIN(Category.PLAYER),
/**
* Called when a player is attempting to connect to the server
*
* @see org.bukkit.event.player.PlayerLoginEvent
*/
PLAYER_LOGIN (Category.PLAYER),
PLAYER_LOGIN(Category.PLAYER),
/**
* Called when a player has just been authenticated
*
* @see org.bukkit.event.player.PlayerPreLoginEvent
*/
PLAYER_PRELOGIN (Category.PLAYER),
PLAYER_PRELOGIN(Category.PLAYER),
/**
* Called when a player respawns
*
* @see org.bukkit.event.player.PlayerRespawnEvent
*/
PLAYER_RESPAWN (Category.PLAYER),
PLAYER_RESPAWN(Category.PLAYER),
/**
* Called when a player gets kicked from the server
*
* @see org.bukkit.event.player.PlayerKickEvent
*/
PLAYER_KICK (Category.PLAYER),
PLAYER_KICK(Category.PLAYER),
/**
* Called when a player sends a chat message
*
* @see org.bukkit.event.player.PlayerChatEvent
*/
PLAYER_CHAT (Category.PLAYER),
PLAYER_CHAT(Category.PLAYER),
/**
* Called when a player uses a command (early in the command handling process)
*
* @see org.bukkit.event.player.PlayerCommandPreprocessEvent
*/
PLAYER_COMMAND_PREPROCESS (Category.PLAYER),
PLAYER_COMMAND_PREPROCESS(Category.PLAYER),
/**
* Called when a player leaves the server
*
* @see org.bukkit.event.player.PlayerQuitEvent
*/
PLAYER_QUIT (Category.PLAYER),
PLAYER_QUIT(Category.PLAYER),
/**
* Called when a player moves position in the world
*
* @see org.bukkit.event.player.PlayerMoveEvent
*/
PLAYER_MOVE (Category.PLAYER),
PLAYER_MOVE(Category.PLAYER),
/**
* Called before a player gets a velocity vector sent, which will instruct him to
* get "pushed" into a specific direction, e.g. after an explosion
*
* @see org.bukkit.event.player.PlayerVelocityEvent
*/
PLAYER_VELOCITY (Category.PLAYER),
PLAYER_VELOCITY(Category.PLAYER),
/**
* Called when a player undergoes an animation (Arm Swing is the only animation currently supported)
*
* @see org.bukkit.event.player.PlayerAnimationEvent
*/
PLAYER_ANIMATION (Category.PLAYER),
PLAYER_ANIMATION(Category.PLAYER),
/**
* Called when a player toggles sneak mode
*
* @see org.bukkit.event.player.PlayerToggleSneakEvent
*/
PLAYER_TOGGLE_SNEAK (Category.PLAYER),
PLAYER_TOGGLE_SNEAK(Category.PLAYER),
/**
* Called when a player toggles sprint mode
*
* @see org.bukkit.event.player.PlayerToggleSprintEvent
*/
PLAYER_TOGGLE_SPRINT (Category.PLAYER),
PLAYER_TOGGLE_SPRINT(Category.PLAYER),
/**
* Called when a player interacts with an object or air
*
* @see org.bukkit.event.player.PlayerInteractEvent
*/
PLAYER_INTERACT (Category.PLAYER),
PLAYER_INTERACT(Category.PLAYER),
/**
* Called when a player right clicks an entity
*
* @see org.bukkit.event.player.PlayerInteractEntityEvent
*/
PLAYER_INTERACT_ENTITY (Category.PLAYER),
PLAYER_INTERACT_ENTITY(Category.PLAYER),
/**
* Called when a player throws an egg
*
* @see org.bukkit.event.player.PlayerEggThrowEvent
*/
PLAYER_EGG_THROW (Category.PLAYER),
PLAYER_EGG_THROW(Category.PLAYER),
/**
* Called when a player teleports from one position to another
*
* @see org.bukkit.event.player.PlayerTeleportEvent
*/
PLAYER_TELEPORT (Category.PLAYER),
PLAYER_TELEPORT(Category.PLAYER),
/**
* Called when a player completes the portaling process by standing in a portal
*
* @see org.bukkit.event.player.PlayerPortalEvent
*/
PLAYER_PORTAL (Category.PLAYER),
PLAYER_PORTAL(Category.PLAYER),
/**
* Called when a player changes their held item
*
* @see org.bukkit.event.player.PlayerItemHeldEvent
*/
PLAYER_ITEM_HELD (Category.PLAYER),
PLAYER_ITEM_HELD(Category.PLAYER),
/**
* Called when a player drops an item
*
* @see org.bukkit.event.player.PlayerDropItemEvent
*/
PLAYER_DROP_ITEM (Category.PLAYER),
PLAYER_DROP_ITEM(Category.PLAYER),
/**
* Called when a player picks an item up off the ground
*
* @see org.bukkit.event.player.PlayerPickupItemEvent
*/
PLAYER_PICKUP_ITEM (Category.PLAYER),
PLAYER_PICKUP_ITEM(Category.PLAYER),
/**
* Called when a player empties a bucket
*
@@ -328,7 +329,7 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.block.BlockDamageEvent
*/
BLOCK_DAMAGE (Category.BLOCK),
BLOCK_DAMAGE(Category.BLOCK),
/**
* Called when a block is undergoing a universe physics
* check on whether it can be built
@@ -337,21 +338,21 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.block.BlockCanBuildEvent
*/
BLOCK_CANBUILD (Category.BLOCK),
BLOCK_CANBUILD(Category.BLOCK),
/**
* Called when a block of water or lava attempts to flow into another
* block
*
* @see org.bukkit.event.block.BlockFromToEvent
*/
BLOCK_FROMTO (Category.BLOCK),
BLOCK_FROMTO(Category.BLOCK),
/**
* Called when a block is being set on fire from another block, such as
* an adjacent block of fire attempting to set fire to wood
*
* @see org.bukkit.event.block.BlockIgniteEvent
*/
BLOCK_IGNITE (Category.BLOCK),
BLOCK_IGNITE(Category.BLOCK),
/**
* Called when a block undergoes a physics check
*
@@ -360,37 +361,37 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.block.BlockPhysicsEvent
*/
BLOCK_PHYSICS (Category.BLOCK),
BLOCK_PHYSICS(Category.BLOCK),
/**
* Called when a player is attempting to place a block
*
* @see org.bukkit.event.block.BlockPlaceEvent
*/
BLOCK_PLACE (Category.BLOCK),
BLOCK_PLACE(Category.BLOCK),
/**
* Called when a block dispenses something
*
* @see org.bukkit.event.block.BlockDispenseEvent
*/
BLOCK_DISPENSE (Category.BLOCK),
BLOCK_DISPENSE(Category.BLOCK),
/**
* Called when a block is destroyed from being burnt by fire
*
* @see org.bukkit.event.block.BlockBurnEvent
*/
BLOCK_BURN (Category.BLOCK),
BLOCK_BURN(Category.BLOCK),
/**
* Called when leaves are decaying naturally
*
* @see org.bukkit.event.block.LeavesDecayEvent
*/
LEAVES_DECAY (Category.BLOCK),
LEAVES_DECAY(Category.BLOCK),
/**
* Called when a sign is changed
*
* @see org.bukkit.event.block.SignChangeEvent
*/
SIGN_CHANGE (Category.BLOCK),
SIGN_CHANGE(Category.BLOCK),
/**
* Called when a block changes redstone current. Only triggered on blocks
* that are actually capable of transmitting or carrying a redstone
@@ -398,43 +399,43 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.block.BlockRedstoneEvent
*/
REDSTONE_CHANGE (Category.BLOCK),
REDSTONE_CHANGE(Category.BLOCK),
/**
* Called when a block is broken by a player
*
* @see org.bukkit.event.block.BlockBreakEvent
*/
BLOCK_BREAK (Category.BLOCK),
BLOCK_BREAK(Category.BLOCK),
/**
* Called when a block is formed based on world conditions
*
* @see org.bukkit.event.block.BlockFormEvent
*/
BLOCK_FORM (Category.BLOCK),
BLOCK_FORM(Category.BLOCK),
/**
* Called when a block spreads based on world conditions
*
* @see org.bukkit.event.block.BlockSpreadEvent
*/
BLOCK_SPREAD (Category.BLOCK),
BLOCK_SPREAD(Category.BLOCK),
/**
* Called when a block fades, melts or disappears based on world conditions
*
* @see org.bukkit.event.block.BlockFadeEvent
*/
BLOCK_FADE (Category.BLOCK),
BLOCK_FADE(Category.BLOCK),
/**
* Called when a piston extends
*
* @see org.bukkit.event.block.BlockPistonExtendEvent
*/
BLOCK_PISTON_EXTEND (Category.BLOCK),
BLOCK_PISTON_EXTEND(Category.BLOCK),
/**
* Called when a piston retracts
*
* @see org.bukkit.event.block.BlockPistonRetractEvent
*/
BLOCK_PISTON_RETRACT (Category.BLOCK),
BLOCK_PISTON_RETRACT(Category.BLOCK),
/**
* INVENTORY EVENTS
@@ -445,43 +446,43 @@ public abstract class Event implements Serializable {
*
* @todo: add javadoc see comment
*/
INVENTORY_OPEN (Category.INVENTORY),
INVENTORY_OPEN(Category.INVENTORY),
/**
* Called when a player closes an inventory
*
* @todo: add javadoc see comment
*/
INVENTORY_CLOSE (Category.INVENTORY),
INVENTORY_CLOSE(Category.INVENTORY),
/**
* Called when a player clicks on an inventory slot
*
* @todo: add javadoc see comment
*/
INVENTORY_CLICK (Category.INVENTORY),
INVENTORY_CLICK(Category.INVENTORY),
/**
* Called when an inventory slot changes values or type
*
* @todo: add javadoc see comment
*/
INVENTORY_CHANGE (Category.INVENTORY),
INVENTORY_CHANGE(Category.INVENTORY),
/**
* Called when a player is attempting to perform an inventory transaction
*
* @todo: add javadoc see comment
*/
INVENTORY_TRANSACTION (Category.INVENTORY),
INVENTORY_TRANSACTION(Category.INVENTORY),
/**
* Called when an ItemStack is successfully smelted in a furnace.
*
* @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.
*
* @see org.bukkit.event.inventory.FurnaceBurnEvent
*/
FURNACE_BURN (Category.INVENTORY),
FURNACE_BURN(Category.INVENTORY),
/**
* SERVER EVENTS
@@ -492,19 +493,19 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.server.PluginEnableEvent
*/
PLUGIN_ENABLE (Category.SERVER),
PLUGIN_ENABLE(Category.SERVER),
/**
* Called when a plugin is disabled
*
* @see org.bukkit.event.server.PluginDisableEvent
*/
PLUGIN_DISABLE (Category.SERVER),
PLUGIN_DISABLE(Category.SERVER),
/**
* Called when a server command is called
*
* @see org.bukkit.event.server.ServerCommandEvent
*/
SERVER_COMMAND (Category.SERVER),
SERVER_COMMAND(Category.SERVER),
/**
* Called when a remote server command is called
*
@@ -516,13 +517,13 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.server.MapInitializeEvent
*/
MAP_INITIALIZE (Category.SERVER),
MAP_INITIALIZE(Category.SERVER),
/**
* Called when a client pings a server.
*
* @see org.bukkit.event.server.ServerListPingEvent
*/
SERVER_LIST_PING (Category.SERVER),
SERVER_LIST_PING(Category.SERVER),
/**
* WORLD EVENTS
@@ -536,13 +537,13 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.world.ChunkLoadEvent
*/
CHUNK_LOAD (Category.WORLD),
CHUNK_LOAD(Category.WORLD),
/**
* Called when a chunk is unloaded
*
* @see org.bukkit.event.world.ChunkUnloadEvent
*/
CHUNK_UNLOAD (Category.WORLD),
CHUNK_UNLOAD(Category.WORLD),
/**
* Called when a newly created chunk has been populated.
*
@@ -550,55 +551,55 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.world.ChunkPopulateEvent
*/
CHUNK_POPULATED (Category.WORLD),
CHUNK_POPULATED(Category.WORLD),
/**
* Called when an ItemEntity spawns in the world
*
* @see org.bukkit.event.entity.ItemSpawnEvent
*/
ITEM_SPAWN (Category.WORLD),
ITEM_SPAWN(Category.WORLD),
/**
* Called when a World's spawn is changed
*
* @see org.bukkit.event.world.SpawnChangeEvent
*/
SPAWN_CHANGE (Category.WORLD),
SPAWN_CHANGE(Category.WORLD),
/**
* 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
*
* @see org.bukkit.event.world.WorldInitEvent
*/
WORLD_INIT (Category.WORLD),
WORLD_INIT(Category.WORLD),
/**
* 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
*
* @see org.bukkit.event.world.WorldUnloadEvent
*/
WORLD_UNLOAD (Category.WORLD),
WORLD_UNLOAD(Category.WORLD),
/**
* Called when world attempts to create a matching end to a portal
*
* @see org.bukkit.event.world.PortalCreateEvent
*/
PORTAL_CREATE (Category.WORLD),
PORTAL_CREATE(Category.WORLD),
/**
* Called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal.
*
+ * @see org.bukkit.event.world.TreeGrowEvent
* @see org.bukkit.event.world.TreeGrowEvent
*/
STRUCTURE_GROW (Category.WORLD),
STRUCTURE_GROW(Category.WORLD),
/**
* ENTITY EVENTS
@@ -609,19 +610,19 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.painting.PaintingPlaceEvent
*/
PAINTING_PLACE (Category.ENTITY),
PAINTING_PLACE(Category.ENTITY),
/**
* Called when a painting is removed
*
* @see org.bukkit.event.painting.PaintingBreakEvent
*/
PAINTING_BREAK (Category.ENTITY),
PAINTING_BREAK(Category.ENTITY),
/**
* Called when an entity touches a portal block
*
* @see org.bukkit.event.entity.EntityPortalEnterEvent
*/
ENTITY_PORTAL_ENTER (Category.ENTITY),
ENTITY_PORTAL_ENTER(Category.ENTITY),
/**
* LIVING_ENTITY EVENTS
@@ -633,31 +634,31 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.entity.CreatureSpawnEvent
*/
CREATURE_SPAWN (Category.LIVING_ENTITY),
CREATURE_SPAWN(Category.LIVING_ENTITY),
/**
* Called when a LivingEntity is damaged with no source.
*
* @see org.bukkit.event.entity.EntityDamageEvent
*/
ENTITY_DAMAGE (Category.LIVING_ENTITY),
ENTITY_DAMAGE(Category.LIVING_ENTITY),
/**
* Called when a LivingEntity dies
*
* @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
*
* @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
*
* @see org.bukkit.event.entity.EntityExplodeEvent
*/
ENTITY_EXPLODE (Category.LIVING_ENTITY),
ENTITY_EXPLODE(Category.LIVING_ENTITY),
/**
* Called when an entity has made a decision to explode.
*
@@ -670,74 +671,74 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.entity.ExplosionPrimeEvent
*/
EXPLOSION_PRIME (Category.LIVING_ENTITY),
EXPLOSION_PRIME(Category.LIVING_ENTITY),
/**
* Called when an entity targets another entity
*
* @see org.bukkit.event.entity.EntityTargetEvent
*/
ENTITY_TARGET (Category.LIVING_ENTITY),
ENTITY_TARGET(Category.LIVING_ENTITY),
/**
* Called when an entity interacts with a block
* This event specifically excludes player entities
*
* @see org.bukkit.event.entity.EntityInteractEvent
*/
ENTITY_INTERACT (Category.LIVING_ENTITY),
ENTITY_INTERACT(Category.LIVING_ENTITY),
/**
* Called when a creeper gains or loses a power shell
*
* @see org.bukkit.event.entity.CreeperPowerEvent
*/
CREEPER_POWER (Category.LIVING_ENTITY),
CREEPER_POWER(Category.LIVING_ENTITY),
/**
* Called when a pig is zapped, zombifying it
*
* @see org.bukkit.event.entity.PigZapEvent
*/
PIG_ZAP (Category.LIVING_ENTITY),
PIG_ZAP(Category.LIVING_ENTITY),
/**
* Called when a LivingEntity is tamed
*
* @see org.bukkit.event.entity.EntityTameEvent
*/
ENTITY_TAME (Category.LIVING_ENTITY),
ENTITY_TAME(Category.LIVING_ENTITY),
/**
* Called when a {@link Projectile} hits something
*
* @see org.bukkit.event.entity.ProjectileHitEvent
*/
PROJECTILE_HIT (Category.ENTITY),
PROJECTILE_HIT(Category.ENTITY),
/**
* Called when a Slime splits into smaller Slimes upon death
*
* @see org.bukkit.event.entity.SlimeSplitEvent
*/
SLIME_SPLIT (Category.LIVING_ENTITY),
SLIME_SPLIT(Category.LIVING_ENTITY),
/**
* Called when a LivingEntity is regains health
*
* @see org.bukkit.event.entity.EntityRegainHealthEvent
*/
ENTITY_REGAIN_HEALTH (Category.LIVING_ENTITY),
ENTITY_REGAIN_HEALTH(Category.LIVING_ENTITY),
/**
* Called when an Enderman picks a block up
*
* @see org.bukkit.event.entity.EndermanPickupEvent
*/
ENDERMAN_PICKUP (Category.LIVING_ENTITY),
ENDERMAN_PICKUP(Category.LIVING_ENTITY),
/**
* Called when an Enderman places a block
*
* @see org.bukkit.event.entity.EndermanPlaceEvent
*/
ENDERMAN_PLACE (Category.LIVING_ENTITY),
ENDERMAN_PLACE(Category.LIVING_ENTITY),
/**
* Called when a human entity's food level changes
*
* @see org.bukkit.event.entity.FoodLevelChangeEvent
*/
FOOD_LEVEL_CHANGE (Category.LIVING_ENTITY),
FOOD_LEVEL_CHANGE(Category.LIVING_ENTITY),
/**
* WEATHER EVENTS
@@ -748,19 +749,19 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.weather.LightningStrikeEvent
*/
LIGHTNING_STRIKE (Category.WEATHER),
LIGHTNING_STRIKE(Category.WEATHER),
/**
* Called when the weather in a world changes
*
* @see org.bukkit.event.weather.WeatherChangeEvent
*/
WEATHER_CHANGE (Category.WEATHER),
WEATHER_CHANGE(Category.WEATHER),
/**
* Called when the thunder state in a world changes
*
* @see org.bukkit.event.weather.ThunderChangeEvent
*/
THUNDER_CHANGE (Category.WEATHER),
THUNDER_CHANGE(Category.WEATHER),
/**
* VEHICLE EVENTS
@@ -771,55 +772,55 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.vehicle.VehicleCreateEvent
*/
VEHICLE_CREATE (Category.VEHICLE),
VEHICLE_CREATE(Category.VEHICLE),
/**
* Called when a vehicle is destroyed
*
* @see org.bukkit.event.vehicle.VehicleDestroyEvent
*/
VEHICLE_DESTROY (Category.VEHICLE),
VEHICLE_DESTROY(Category.VEHICLE),
/**
* Called when a vehicle is damaged by a LivingEntity
*
* @see org.bukkit.event.vehicle.VehicleDamageEvent
*/
VEHICLE_DAMAGE (Category.VEHICLE),
VEHICLE_DAMAGE(Category.VEHICLE),
/**
* Called when a vehicle collides with an Entity
*
* @see org.bukkit.event.vehicle.VehicleCollisionEvent
*/
VEHICLE_COLLISION_ENTITY (Category.VEHICLE),
VEHICLE_COLLISION_ENTITY(Category.VEHICLE),
/**
* Called when a vehicle collides with a Block
*
* @see org.bukkit.event.vehicle.VehicleBlockCollisionEvent
*/
VEHICLE_COLLISION_BLOCK (Category.VEHICLE),
VEHICLE_COLLISION_BLOCK(Category.VEHICLE),
/**
* Called when a vehicle is entered by a LivingEntity
*
* @see org.bukkit.event.vehicle.VehicleEnterEvent
*/
VEHICLE_ENTER (Category.VEHICLE),
VEHICLE_ENTER(Category.VEHICLE),
/**
* Called when a vehicle is exited by a LivingEntity
*
* @see org.bukkit.event.vehicle.VehicleExitEvent
*/
VEHICLE_EXIT (Category.VEHICLE),
VEHICLE_EXIT(Category.VEHICLE),
/**
* Called when a vehicle moves position in the world
*
* @see org.bukkit.event.vehicle.VehicleMoveEvent
*/
VEHICLE_MOVE (Category.VEHICLE),
VEHICLE_MOVE(Category.VEHICLE),
/**
* Called when a vehicle is going through an update cycle, rechecking itself
*
* @see org.bukkit.event.vehicle.VehicleUpdateEvent
*/
VEHICLE_UPDATE (Category.VEHICLE),
VEHICLE_UPDATE(Category.VEHICLE),
/**
* MISCELLANEOUS EVENTS
*/
@@ -827,7 +828,7 @@ public abstract class Event implements Serializable {
/**
* Represents a custom event, isn't actually used
*/
CUSTOM_EVENT (Category.MISCELLANEOUS);
CUSTOM_EVENT(Category.MISCELLANEOUS);
private final Category category;

View File

@@ -22,6 +22,7 @@ public class EventException extends Exception {
/**
* Constructs a new EventException with the given message
*
* @param cause The exception that caused this
* @param message The message
*/
@@ -32,6 +33,7 @@ public class EventException extends Exception {
/**
* Constructs a new EventException with the given message
*
* @param message The message
*/
public EventException(String message) {

View File

@@ -6,13 +6,14 @@ import org.bukkit.event.Cancellable;
/**
* Called when a block is broken by a player.
*<p />
* <p />
* Note:
* Plugins wanting to simulate a traditional block drop should set the block to air and utilise their own methods for determining
* what the default drop for the block being broken is and what to do about it, if anything.
*<p />
* <p />
* If a Block Break event is cancelled, the block will not break.
*/
@SuppressWarnings("serial")
public class BlockBreakEvent extends BlockEvent implements Cancellable {
private Player player;

View File

@@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable;
/**
* Called when a block is destroyed as a result of being burnt by fire.
*<p />
* <p />
* If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
*/
@SuppressWarnings("serial")
public class BlockBurnEvent extends BlockEvent implements Cancellable {
private boolean cancelled;

View File

@@ -5,13 +5,14 @@ import org.bukkit.Material;
/**
* Called when we try to place a block, to see if we can build it here or not.
*<p />
* <p />
* Note:
* <ul>
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
* <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li>
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
* <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li>
* </ul>
*/
@SuppressWarnings("serial")
public class BlockCanBuildEvent extends BlockEvent {
protected boolean buildable;
protected int material;

View File

@@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
* <p />
* If a Block Damage event is cancelled, the block will not be damaged.
*/
@SuppressWarnings("serial")
public class BlockDamageEvent extends BlockEvent implements Cancellable {
private Player player;
private boolean instaBreak;

View File

@@ -7,9 +7,10 @@ import org.bukkit.util.Vector;
/**
* Called when an item is dispensed from a block.
*<p />
* <p />
* If a Block Dispense event is cancelled, the block will not dispense the item.
*/
@SuppressWarnings("serial")
public class BlockDispenseEvent extends BlockEvent implements Cancellable {
private boolean cancelled = false;
@@ -43,7 +44,7 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
/**
* Gets the velocity.
*<p />
* <p />
* Note: Modifying the returned Vector will not change the velocity, you must use {@link #setVelocity(org.bukkit.util.Vector)} instead.
*
* @return A Vector for the dispensed item's velocity

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/**
* Represents a block related event.
*/
@SuppressWarnings("serial")
public class BlockEvent extends Event {
protected Block block;

View File

@@ -3,17 +3,19 @@ package org.bukkit.event.block;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.event.Cancellable;
/**
* Called when a block fades, melts or disappears based on world conditions
* <p />
* Examples:
* <ul>
* <li>Snow melting due to being near a light source.</li>
* <li>Ice melting due to being near a light source.</li>
* <li>Snow melting due to being near a light source.</li>
* <li>Ice melting due to being near a light source.</li>
* </ul>
* <p />
* If a Block Fade event is cancelled, the block will not fade, melt or disappear.
*/
@SuppressWarnings("serial")
public class BlockFadeEvent extends BlockEvent implements Cancellable {
private boolean cancelled;
private BlockState newState;

View File

@@ -7,16 +7,18 @@ import org.bukkit.event.Cancellable;
/**
* Called when a block is formed or spreads based on world conditions.
* Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't just "randomly" form.
*<p />
* <p />
* Examples:
*<ul>
* <li>Snow forming due to a snow storm.</li>
* <li>Ice forming in a snowy Biome like Taiga or Tundra.</li>
* <ul>
* <li>Snow forming due to a snow storm.</li>
* <li>Ice forming in a snowy Biome like Taiga or Tundra.</li>
* </ul>
*<p />
* <p />
* If a Block Form event is cancelled, the block will not be formed.
*
* @see BlockSpreadEvent
*/
@SuppressWarnings("serial")
public class BlockFormEvent extends BlockEvent implements Cancellable {
private boolean cancelled;
private BlockState newState;

View File

@@ -6,9 +6,10 @@ import org.bukkit.event.Cancellable;
/**
* Represents events with a source block and a destination block, currently only applies to liquid (lava and water).
*<p />
* <p />
* If a Block From To event is cancelled, the block will not move (the liquid will not flow).
*/
@SuppressWarnings("serial")
public class BlockFromToEvent extends BlockEvent implements Cancellable {
protected Block to;
protected BlockFace face;

View File

@@ -7,9 +7,10 @@ import org.bukkit.event.Event;
/**
* Called when a block is ignited. If you want to catch when a Player places fire, you need to use {@link BlockPlaceEvent}.
*<p />
* <p />
* If a Block Ignite event is cancelled, the block will not be ignited.
*/
@SuppressWarnings("serial")
public class BlockIgniteEvent extends BlockEvent implements Cancellable {
private IgniteCause cause;
private boolean cancel;

View File

@@ -23,11 +23,11 @@ public class BlockListener implements Listener {
/**
* Called when we try to place a block, to see if we can build it here or not.
*<p />
* <p />
* Note:
* <ul>
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
* <li>If you want to figure out what is being placed, use {@link BlockCanBuildEvent#getMaterial()} or {@link BlockCanBuildEvent#getMaterialId()} instead.</li>
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
* <li>If you want to figure out what is being placed, use {@link BlockCanBuildEvent#getMaterial()} or {@link BlockCanBuildEvent#getMaterialId()} instead.</li>
* </ul>
*
* @param event Relevant event details
@@ -36,7 +36,7 @@ public class BlockListener implements Listener {
/**
* Represents events with a source block and a destination block, currently only applies to liquid (lava and water).
*<p />
* <p />
* If a Block From To event is cancelled, the block will not move (the liquid will not flow).
*
* @param event Relevant event details
@@ -45,7 +45,7 @@ public class BlockListener implements Listener {
/**
* Called when a block is ignited. If you want to catch when a Player places fire, you need to use {@link BlockPlaceEvent}.
*<p />
* <p />
* If a Block Ignite event is cancelled, the block will not be ignited.
*
* @param event Relevant event details
@@ -61,7 +61,7 @@ public class BlockListener implements Listener {
/**
* Called when a block is placed by a player.
*<p />
* <p />
* If a Block Place event is cancelled, the block will not be placed.
*
* @param event Relevant event details
@@ -79,7 +79,7 @@ public class BlockListener implements Listener {
/**
* Called when leaves are decaying naturally.
*<p />
* <p />
* If a Leaves Decay event is cancelled, the leaves will not decay.
*
* @param event Relevant event details
@@ -97,7 +97,7 @@ public class BlockListener implements Listener {
/**
* Called when a block is destroyed as a result of being burnt by fire.
*<p />
* <p />
* If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
*
* @param event Relevant event details
@@ -106,11 +106,11 @@ public class BlockListener implements Listener {
/**
* Called when a block is broken by a player.
*<p />
* <p />
* Note:
* Plugins wanting to simulate a traditional block drop should set the block to air and utilise their own methods for determining
* what the default drop for the block being broken is and what to do about it, if anything.
*<p />
* <p />
* If a Block Break event is cancelled, the block will not break.
*
* @param event Relevant event details
@@ -120,13 +120,13 @@ public class BlockListener implements Listener {
/**
* Called when a block is formed or spreads based on world conditions.
* Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't just "randomly" form.
*<p />
* <p />
* Examples:
*<ul>
* <li>Snow forming due to a snow storm.</li>
* <li>Ice forming in a snowy Biome like Tiga or Tundra.</li>
* <ul>
* <li>Snow forming due to a snow storm.</li>
* <li>Ice forming in a snowy Biome like Tiga or Tundra.</li>
* </ul>
*<p />
* <p />
* If a Block Form event is cancelled, the block will not be formed or will not spread.
*
* @see BlockSpreadEvent
@@ -137,13 +137,13 @@ public class BlockListener implements Listener {
/**
* Called when a block spreads based on world conditions.
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread.
*<p />
* <p />
* Examples:
*<ul>
* <li>Mushrooms spreading.</li>
* <li>Fire spreading.</li>
* <ul>
* <li>Mushrooms spreading.</li>
* <li>Fire spreading.</li>
* </ul>
*<p />
* <p />
* If a Block Spread event is cancelled, the block will not spread.
*
* @param event Relevant event details
@@ -155,8 +155,8 @@ public class BlockListener implements Listener {
* <p />
* Examples:
* <ul>
* <li>Snow melting due to being near a light source.</li>
* <li>Ice melting due to being near a light source.</li>
* <li>Snow melting due to being near a light source.</li>
* <li>Ice melting due to being near a light source.</li>
* </ul>
* <p />
* If a Block Fade event is cancelled, the block will not fade, melt or disappear.
@@ -167,7 +167,7 @@ public class BlockListener implements Listener {
/**
* Called when an item is dispensed from a block.
*<p />
* <p />
* If a Block Dispense event is cancelled, the block will not dispense the item.
*
* @param event Relevant event details

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Thrown when a block physics check is called
*/
@SuppressWarnings("serial")
public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
private final int changed;
private boolean cancel = false;

View File

@@ -4,9 +4,9 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.Cancellable;
import org.bukkit.material.PistonBaseMaterial;
public abstract class BlockPistonEvent extends BlockEvent implements Cancellable {
@SuppressWarnings("serial")
public abstract class BlockPistonEvent extends BlockEvent implements Cancellable {
private boolean cancelled;
private BlockFace direction;

View File

@@ -7,6 +7,7 @@ import java.util.List;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@SuppressWarnings("serial")
public class BlockPistonExtendEvent extends BlockPistonEvent {
private int length;
private List<Block> blocks;

View File

@@ -4,6 +4,7 @@ import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@SuppressWarnings("serial")
public class BlockPistonRetractEvent extends BlockPistonEvent {
public BlockPistonRetractEvent(Block block, BlockFace direction) {
super(Type.BLOCK_PISTON_RETRACT, block, direction);

View File

@@ -8,9 +8,10 @@ import org.bukkit.inventory.ItemStack;
/**
* Called when a block is placed by a player.
*<p />
* <p />
* If a Block Place event is cancelled, the block will not be placed.
*/
@SuppressWarnings("serial")
public class BlockPlaceEvent extends BlockEvent implements Cancellable {
protected boolean cancel;
protected boolean canBuild;

View File

@@ -5,6 +5,7 @@ import org.bukkit.block.Block;
/**
* Called when a redstone current changes
*/
@SuppressWarnings("serial")
public class BlockRedstoneEvent extends BlockEvent {
private int oldCurrent;
private int newCurrent;

View File

@@ -2,19 +2,22 @@ package org.bukkit.event.block;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
/**
* Called when a block spreads based on world conditions.
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread.
*<p />
* <p />
* Examples:
*<ul>
* <li>Mushrooms spreading.</li>
* <li>Fire spreading.</li>
* <ul>
* <li>Mushrooms spreading.</li>
* <li>Fire spreading.</li>
* </ul>
*<p />
* <p />
* If a Block Spread event is cancelled, the block will not spread.
*
* @see BlockFormEvent
*/
@SuppressWarnings("serial")
public class BlockSpreadEvent extends BlockFormEvent {
private Block source;

View File

@@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable;
/**
* Called when leaves are decaying naturally.
*<p />
* <p />
* If a Leaves Decay event is cancelled, the leaves will not decay.
*/
@SuppressWarnings("serial")
public class LeavesDecayEvent extends BlockEvent implements Cancellable {
private boolean cancel = false;

View File

@@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable;
* <p />
* If a Sign Change event is cancelled, the sign will not be changed.
*/
@SuppressWarnings("serial")
public class SignChangeEvent extends BlockEvent implements Cancellable {
private boolean cancel = false;
private Player player;

View File

@@ -7,9 +7,10 @@ import org.bukkit.event.Cancellable;
/**
* Called when a creature is spawned into a world.
*<p />
* <p />
* If a Creature Spawn event is cancelled, the creature will not spawn.
*/
@SuppressWarnings("serial")
public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
private Location location;

View File

@@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable;
/**
* Called when a Creeper is struck by lightning.
*<p />
* <p />
* If a Creeper Power event is cancelled, the Creeper will not be powered.
*/
@SuppressWarnings("serial")
public class CreeperPowerEvent extends EntityEvent implements Cancellable {
private boolean canceled;

View File

@@ -4,6 +4,7 @@ import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
@SuppressWarnings("serial")
public class EndermanPickupEvent extends EntityEvent implements Cancellable {
private boolean cancel;

View File

@@ -4,6 +4,7 @@ import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
@SuppressWarnings("serial")
public class EndermanPlaceEvent extends EntityEvent implements Cancellable {
private boolean cancel;

View File

@@ -3,6 +3,7 @@ package org.bukkit.event.entity;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
@SuppressWarnings("serial")
public class EntityCombustByBlockEvent extends EntityCombustEvent {
private Block combuster;
@@ -16,6 +17,7 @@ public class EntityCombustByBlockEvent extends EntityCombustEvent {
* The combuster can be lava or a block that is on fire.
*
* WARNING: block may be null.
*
* @return the Block that set the combustee alight.
*/
public Block getCombuster() {

View File

@@ -2,6 +2,7 @@ package org.bukkit.event.entity;
import org.bukkit.entity.Entity;
@SuppressWarnings("serial")
public class EntityCombustByEntityEvent extends EntityCombustEvent {
private Entity combuster;
@@ -13,6 +14,7 @@ public class EntityCombustByEntityEvent extends EntityCombustEvent {
/**
* The combuster can be a WeatherStorm a Blaze, or an Entity holding a FIRE_ASPECT enchanted item.
*
* @return the Entity that set the combustee alight.
*/
public Entity getCombuster() {

View File

@@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable;
/**
* Called when an entity combusts.
*<p />
* <p />
* If an Entity Combust event is cancelled, the entity will not combust.
*/
@SuppressWarnings("serial")
public class EntityCombustEvent extends EntityEvent implements Cancellable {
private int duration;
private boolean cancel;
@@ -37,6 +38,7 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
* The number of seconds the combustee should be alight for.
*
* This value will only ever increase the combustion time, not decrease existing combustion times.
*
* @param duration the time in seconds to be alight for.
*/
public void setDuration(int duration) {

View File

@@ -6,6 +6,7 @@ import org.bukkit.entity.Entity;
/**
* Called when an entity is damaged by a block
*/
@SuppressWarnings("serial")
public class EntityDamageByBlockEvent extends EntityDamageEvent {
private Block damager;

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Entity;
/**
* Called when an entity is damaged by an entity
*/
@SuppressWarnings("serial")
public class EntityDamageByEntityEvent extends EntityDamageEvent {
private Entity damager;

View File

@@ -8,6 +8,7 @@ import org.bukkit.entity.Projectile;
*
* @deprecated use {@link EntityDamageByEntityEvent} instead, where {@link EntityDamageByEntityEvent#getDamager()} will return the {@link Projectile}
*/
@SuppressWarnings("serial")
@Deprecated
public class EntityDamageByProjectileEvent extends EntityDamageByEntityEvent {

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Event;
/**
* Stores data for damage events
*/
@SuppressWarnings("serial")
public class EntityDamageEvent extends EntityEvent implements Cancellable {
private int damage;

View File

@@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack;
/**
* Thrown whenever a LivingEntity dies
*/
@SuppressWarnings("serial")
public class EntityDeathEvent extends EntityEvent {
private List<ItemStack> drops;
private int dropExp = 0;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/**
* Represents an Entity-related event
*/
@SuppressWarnings("serial")
public class EntityEvent extends Event {
protected Entity entity;

View File

@@ -10,6 +10,7 @@ import java.util.List;
/**
* Called when an entity explodes
*/
@SuppressWarnings("serial")
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private Location location;
@@ -40,6 +41,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
/**
* Returns the list of blocks that would have been removed or were
* removed from the explosion event.
*
* @return All blown-up blocks
*/
public List<Block> blockList() {
@@ -50,6 +52,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
* Returns the location where the explosion happened.
* It is not possible to get this value from the Entity as
* the Entity no longer exists in the world.
*
* @return The location of the explosion
*/
public Location getLocation() {
@@ -67,6 +70,7 @@ public class EntityExplodeEvent extends EntityEvent implements Cancellable {
/**
* Sets the percentage of blocks to drop from this explosion
*
* @param yield The new yield percentage
*/
public void setYield(float yield) {

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when an entity interacts with an object
*/
@SuppressWarnings("serial")
public class EntityInteractEvent extends EntityEvent implements Cancellable {
protected Block block;

View File

@@ -12,7 +12,7 @@ public class EntityListener implements Listener {
/**
* Called when a creature is spawned into a world.
*<p />
* <p />
* If a Creature Spawn event is cancelled, the creature will not spawn.
*
* @param event Relevant event details
@@ -28,7 +28,7 @@ public class EntityListener implements Listener {
/**
* Called when an entity combusts.
*<p />
* <p />
* If an Entity Combust event is cancelled, the entity will not combust.
*
* @param event Relevant event details
@@ -107,7 +107,7 @@ public class EntityListener implements Listener {
/**
* Called when a Creeper is struck by lightning.
*<p />
* <p />
* If a Creeper Power event is cancelled, the Creeper will not be powered.
*
* @param event Relevant event details

View File

@@ -1,12 +1,12 @@
package org.bukkit.event.entity;
import org.bukkit.entity.Entity;
import org.bukkit.Location;
/**
* Stores data for entities standing inside a portal block
*/
@SuppressWarnings("serial")
public class EntityPortalEnterEvent extends EntityEvent {
private Location location;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Event;
/**
* Stores data for health-regain events
*/
@SuppressWarnings("serial")
public class EntityRegainHealthEvent extends EntityEvent implements Cancellable {
private boolean cancelled;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Thrown when a LivingEntity is tamed
*/
@SuppressWarnings("serial")
public class EntityTameEvent extends EntityEvent implements Cancellable {
private boolean cancelled;
private AnimalTamer owner;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a creature targets or untargets another entity
*/
@SuppressWarnings("serial")
public class EntityTargetEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private Entity target;
@@ -28,6 +29,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
/**
* Returns the reason for the targeting
*
* @return The reason
*/
public TargetReason getReason() {
@@ -38,6 +40,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
* Get the entity that this is targeting.
* This will be null in the case that the event is called when
* the mob forgets its target.
*
* @return The entity
*/
public Entity getTarget() {

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when an entity has made a decision to explode.
*/
@SuppressWarnings("serial")
public class ExplosionPrimeEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private float radius;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a human entity's food level changes
*/
@SuppressWarnings("serial")
public class FoodLevelChangeEvent extends EntityEvent implements Cancellable {
private boolean cancel = false;
private int level;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when an item is spawned into a world
*/
@SuppressWarnings("serial")
public class ItemSpawnEvent extends EntityEvent implements Cancellable {
private Location location;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Stores data for pigs being zapped
*/
@SuppressWarnings("serial")
public class PigZapEvent extends EntityEvent implements Cancellable {
private boolean canceled;

View File

@@ -8,6 +8,7 @@ import org.bukkit.inventory.ItemStack;
/**
* Thrown whenever a {@link Player} dies
*/
@SuppressWarnings("serial")
public class PlayerDeathEvent extends EntityDeathEvent {
private int newExp = 0;
private String deathMessage = "";
@@ -53,7 +54,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
* <p>
* This does not indicate how much EXP should be dropped, please see
* {@link #setDroppedExp(int)} for that.
*
*
* @get exp New EXP of the respawned player
*/
public void setNewExp(int exp) {

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Projectile;
/**
* Called when a projectile hits an object
*/
@SuppressWarnings("serial")
public class ProjectileHitEvent extends EntityEvent {
public ProjectileHitEvent(Projectile projectile) {

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a Slime splits into smaller Slimes upon death
*/
@SuppressWarnings("serial")
public class SlimeSplitEvent extends EntityEvent implements Cancellable {
private boolean cancel;
private int count;

View File

@@ -4,9 +4,11 @@ import org.bukkit.block.Block;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.inventory.ItemStack;
/**
* Called when an ItemStack is successfully burned as fuel in a furnace.
*/
@SuppressWarnings("serial")
public class FurnaceBurnEvent extends Event implements Cancellable {
private Block furnace;
private ItemStack fuel;

View File

@@ -8,7 +8,8 @@ import org.bukkit.inventory.ItemStack;
/**
* Called when an ItemStack is successfully smelted in a furnace.
*/
public class FurnaceSmeltEvent extends Event implements Cancellable{
@SuppressWarnings("serial")
public class FurnaceSmeltEvent extends Event implements Cancellable {
private Block furnace;
private ItemStack source;
private ItemStack result;
@@ -56,7 +57,7 @@ public class FurnaceSmeltEvent extends Event implements Cancellable{
* @param result new result ItemStack
*/
public void setResult(ItemStack result) {
this.result = result;
this.result = result;
}
public boolean isCancelled() {

View File

@@ -1,8 +1,9 @@
package org.bukkit.event.inventory;
import org.bukkit.event.Listener;
/**
* Handles all events thrown in relation to Blocks
* Handles all events thrown in relation to Blocks
*/
public class InventoryListener implements Listener {
public InventoryListener() {}

View File

@@ -6,6 +6,7 @@ import org.bukkit.entity.Painting;
/**
* Triggered when a painting is removed by an entity
*/
@SuppressWarnings("serial")
public class PaintingBreakByEntityEvent extends PaintingBreakEvent {
private Entity remover;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Triggered when a painting is removed
*/
@SuppressWarnings("serial")
public class PaintingBreakEvent extends PaintingEvent implements Cancellable {
private boolean cancelled;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/**
* Represents a painting-related event.
*/
@SuppressWarnings("serial")
public class PaintingEvent extends Event {
protected Painting painting;

View File

@@ -10,6 +10,7 @@ import org.bukkit.event.Event;
/**
* Triggered when a painting is created in the world
*/
@SuppressWarnings("serial")
public class PaintingPlaceEvent extends PaintingEvent implements Cancellable {
private boolean cancelled;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Represents a player animation event
*/
@SuppressWarnings("serial")
public class PlayerAnimationEvent extends PlayerEvent implements Cancellable {
private PlayerAnimationType animationType;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* This event is fired when the player is almost about to enter the bed.
*/
@SuppressWarnings("serial")
public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false;

View File

@@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
/**
* This event is fired when the player is leaving a bed.
*/
@SuppressWarnings("serial")
public class PlayerBedLeaveEvent extends PlayerEvent {
private Block bed;

View File

@@ -9,9 +9,10 @@ import org.bukkit.inventory.ItemStack;
/**
* Called when a player empties a bucket
*/
@SuppressWarnings("serial")
public class PlayerBucketEmptyEvent extends PlayerBucketEvent {
public PlayerBucketEmptyEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
super(Type.PLAYER_BUCKET_EMPTY, who, blockClicked, blockFace, bucket, itemInHand);
super(Type.PLAYER_BUCKET_EMPTY, who, blockClicked, blockFace, bucket, itemInHand);
}
}

View File

@@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.inventory.ItemStack;
@SuppressWarnings("serial")
public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable {
private ItemStack itemStack;
@@ -50,7 +51,6 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab
this.itemStack = itemStack;
}
/**
* Return the block clicked
*

View File

@@ -9,6 +9,7 @@ import org.bukkit.inventory.ItemStack;
/**
* Called when a player fills a bucket
*/
@SuppressWarnings("serial")
public class PlayerBucketFillEvent extends PlayerBucketEvent {
public PlayerBucketFillEvent(Player who, Block blockClicked, BlockFace blockFace, Material bucket, ItemStack itemInHand) {
super(Type.PLAYER_BUCKET_FILL, who, blockClicked, blockFace, bucket, itemInHand);

View File

@@ -3,6 +3,7 @@ package org.bukkit.event.player;
import org.bukkit.World;
import org.bukkit.entity.Player;
@SuppressWarnings("serial")
public class PlayerChangedWorldEvent extends PlayerEvent {
private final World from;

View File

@@ -10,6 +10,7 @@ import org.bukkit.event.Cancellable;
/**
* Holds information for player chat and commands
*/
@SuppressWarnings("serial")
public class PlayerChatEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false;
private String message;

View File

@@ -6,6 +6,7 @@ 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.
*/
@SuppressWarnings("serial")
public class PlayerCommandPreprocessEvent extends PlayerChatEvent {
public PlayerCommandPreprocessEvent(final Player player, final String message) {
super(Type.PLAYER_COMMAND_PREPROCESS, player, message);

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Thrown when a player drops an item from their inventory
*/
@SuppressWarnings("serial")
public class PlayerDropItemEvent extends PlayerEvent implements Cancellable {
private final Item drop;
private boolean cancel = false;

View File

@@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
/**
* Called when a player throws an egg and it might hatch
*/
@SuppressWarnings("serial")
public class PlayerEggThrowEvent extends PlayerEvent {
private Egg egg;
private boolean hatching;
@@ -44,7 +45,7 @@ public class PlayerEggThrowEvent extends PlayerEvent {
* 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
* false if you want it not to
*/
public void setHatching(boolean hatching) {
this.hatching = hatching;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/**
* Represents a player related event
*/
@SuppressWarnings("serial")
public class PlayerEvent extends Event {
protected Player player;

View File

@@ -7,6 +7,7 @@ import org.bukkit.entity.Entity;
/**
* Thrown when a player is fishing
*/
@SuppressWarnings("serial")
public class PlayerFishEvent extends PlayerEvent implements Cancellable {
private final Entity entity;
private boolean cancel = false;

View File

@@ -4,6 +4,7 @@ import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@SuppressWarnings("serial")
public class PlayerGameModeChangeEvent extends PlayerEvent implements Cancellable {
private boolean cancelled;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Represents an event that is called when a player right clicks an entity.
*/
@SuppressWarnings("serial")
public class PlayerInteractEntityEvent extends PlayerEvent implements Cancellable {
protected Entity clickedEntity;
boolean cancelled = false;

View File

@@ -11,6 +11,7 @@ import org.bukkit.event.block.Action;
/**
* Called when a player interacts with an object or air.
*/
@SuppressWarnings("serial")
public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
protected ItemStack item;
protected Action action;
@@ -141,6 +142,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
/**
* This controls the action to take with the block (if any) that was clicked on
* This event gets processed for all blocks, but most don't have a default action
*
* @return the action to take with the interacted block
*/
public Result useInteractedBlock() {
@@ -158,6 +160,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
* This controls the action to take with the item the player is holding
* This includes both blocks and items (such as flint and steel or records)
* When this is set to default, it will be allowed if no action is taken on the interacted block
*
* @return the action to take with the item in hand
*/
public Result useItemInHand() {

View File

@@ -6,6 +6,7 @@ import org.bukkit.inventory.Inventory;
/**
* Represents a player related inventory event
*/
@SuppressWarnings("serial")
public class PlayerInventoryEvent extends PlayerEvent {
protected Inventory inventory;

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
/**
* Fired when a player changes their currently held item
*/
@SuppressWarnings("serial")
public class PlayerItemHeldEvent extends PlayerEvent {
private int previous;
private int current;

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
/**
* Called when a player joins a server
*/
@SuppressWarnings("serial")
public class PlayerJoinEvent extends PlayerEvent {
private String joinMessage;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player gets kicked from the server
*/
@SuppressWarnings("serial")
public class PlayerKickEvent extends PlayerEvent implements Cancellable {
private String leaveMessage;
private String kickReason;

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
/**
* Stores details for players attempting to log in
*/
@SuppressWarnings("serial")
public class PlayerLoginEvent extends PlayerEvent {
private Result result;
private String message;

View File

@@ -8,6 +8,7 @@ import org.bukkit.event.Event;
/**
* Holds information for player movement events
*/
@SuppressWarnings("serial")
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
private boolean cancel = false;
private Location from;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Thrown when a player picks an item up from the ground
*/
@SuppressWarnings("serial")
public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable {
private final Item item;
private boolean cancel = false;

View File

@@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
/**
* Called when a player completes the portaling process by standing in a portal
*/
@SuppressWarnings("serial")
public class PlayerPortalEvent extends PlayerTeleportEvent {
protected boolean useTravelAgent = true;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Event;
/**
* Stores details for players attempting to log in
*/
@SuppressWarnings("serial")
public class PlayerPreLoginEvent extends Event {
private Result result;
private String message;

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Player;
/**
* Called when a player leaves a server
*/
@SuppressWarnings("serial")
public class PlayerQuitEvent extends PlayerEvent {
private String quitMessage;

View File

@@ -3,6 +3,7 @@ package org.bukkit.event.player;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@SuppressWarnings("serial")
public class PlayerRespawnEvent extends PlayerEvent {
private Location respawnLocation;
private boolean isBedSpawn;

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Event;
/**
* Holds information for player teleport events
*/
@SuppressWarnings("serial")
public class PlayerTeleportEvent extends PlayerMoveEvent {
private TeleportCause cause = TeleportCause.UNKNOWN;
@@ -32,6 +33,7 @@ public class PlayerTeleportEvent extends PlayerMoveEvent {
/**
* Gets the cause of this teleportation event
*
* @return Cause of the event
*/
public TeleportCause getCause() {

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player toggles their sneaking state
*/
@SuppressWarnings("serial")
public class PlayerToggleSneakEvent extends PlayerEvent implements Cancellable {
private boolean isSneaking;
private boolean cancel = false;

View File

@@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable;
/**
* Called when a player toggles their sprinting state
*/
@SuppressWarnings("serial")
public class PlayerToggleSprintEvent extends PlayerEvent implements Cancellable {
private boolean isSprinting;
private boolean cancel = false;

View File

@@ -5,6 +5,7 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.util.Vector;
@SuppressWarnings("serial")
public class PlayerVelocityEvent extends PlayerEvent implements Cancellable {
/**

View File

@@ -6,17 +6,18 @@ import org.bukkit.map.MapView;
/**
* Called when a map is initialized.
*/
@SuppressWarnings("serial")
public class MapInitializeEvent extends ServerEvent {
private final MapView mapView;
public MapInitializeEvent(MapView mapView) {
super(Event.Type.MAP_INITIALIZE);
this.mapView = mapView;
}
/**
* Gets the map initialized in this event.
*
*
* @return Map for this event
*/
public MapView getMap() {

View File

@@ -5,6 +5,7 @@ import org.bukkit.plugin.Plugin;
/**
* Called when a plugin is disabled.
*/
@SuppressWarnings("serial")
public class PluginDisableEvent extends PluginEvent {
public PluginDisableEvent(Plugin plugin) {
super(Type.PLUGIN_DISABLE, plugin);

View File

@@ -5,6 +5,7 @@ import org.bukkit.plugin.Plugin;
/**
* Called when a plugin is enabled.
*/
@SuppressWarnings("serial")
public class PluginEnableEvent extends PluginEvent {
public PluginEnableEvent(Plugin plugin) {
super(Type.PLUGIN_ENABLE, plugin);

View File

@@ -5,6 +5,7 @@ import org.bukkit.plugin.Plugin;
/**
* Used for plugin enable and disable events
*/
@SuppressWarnings("serial")
public class PluginEvent extends ServerEvent {
private final Plugin plugin;

View File

@@ -6,9 +6,11 @@ import org.bukkit.command.ConsoleCommandSender;
/**
* Server Command events
*/
@SuppressWarnings("serial")
public class ServerCommandEvent extends ServerEvent {
private String command;
private CommandSender sender;
@Deprecated
public ServerCommandEvent(ConsoleCommandSender console, String message) {
this(Type.SERVER_COMMAND, console, message);
@@ -40,6 +42,7 @@ public class ServerCommandEvent extends ServerEvent {
/**
* Get the command sender.
*
* @return The sender
*/
public CommandSender getSender() {

View File

@@ -5,6 +5,7 @@ import org.bukkit.event.Event;
/**
* Miscellaneous server events
*/
@SuppressWarnings("serial")
public class ServerEvent extends Event {
public ServerEvent(final Type type) {
super(type);

View File

@@ -7,13 +7,14 @@ import org.bukkit.event.Event;
/**
* Called when a server list ping is coming in.
*/
@SuppressWarnings("serial")
public class ServerListPingEvent extends ServerEvent {
private InetAddress address;
private String motd;
private int numPlayers;
private int maxPlayers;
public ServerListPingEvent(InetAddress address, String motd, int numPlayers, int maxPlayers) {
super(Event.Type.SERVER_LIST_PING);
this.address = address;
@@ -24,7 +25,7 @@ public class ServerListPingEvent extends ServerEvent {
/**
* Get the address the ping is coming from.
*
*
* @return the address
*/
public InetAddress getAddress() {
@@ -33,7 +34,7 @@ public class ServerListPingEvent extends ServerEvent {
/**
* Get the message of the day message.
*
*
* @return the message of the day
*/
public String getMotd() {
@@ -42,7 +43,7 @@ public class ServerListPingEvent extends ServerEvent {
/**
* Change the message of the day message.
*
*
* @param motd the message of the day
*/
public void setMotd(String motd) {
@@ -51,7 +52,7 @@ public class ServerListPingEvent extends ServerEvent {
/**
* Get the number of players sent.
*
*
* @return the number of players
*/
public int getNumPlayers() {
@@ -60,7 +61,7 @@ public class ServerListPingEvent extends ServerEvent {
/**
* Get the maximum number of players sent.
*
*
* @return the the maximum number of player
*/
public int getMaxPlayers() {
@@ -69,7 +70,7 @@ public class ServerListPingEvent extends ServerEvent {
/**
* Set the maximum number of players sent.
*
*
* @param maxPlayers the maximum number of player
*/
public void setMaxPlayers(int maxPlayers) {

View File

@@ -27,17 +27,17 @@ public class ServerListener implements Listener {
* @param event Relevant event details
*/
public void onServerCommand(ServerCommandEvent event) {}
/**
* Called when a map item is initialized (created or loaded into memory)
*
*
* @param event Relevant event details
*/
public void onMapInitialize(MapInitializeEvent event) {}
/**
* Called when a server list ping has come in.
*
*
* @param event Relevant event details
*/
public void onServerListPing(ServerListPingEvent event) {}

View File

@@ -6,6 +6,7 @@ import org.bukkit.entity.Vehicle;
/**
* Raised when a vehicle collides with a block.
*/
@SuppressWarnings("serial")
public class VehicleBlockCollisionEvent extends VehicleCollisionEvent {
private Block block;

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Vehicle;
/**
* Raised when a vehicle collides.
*/
@SuppressWarnings("serial")
public class VehicleCollisionEvent extends VehicleEvent {
public VehicleCollisionEvent(Type type, Vehicle vehicle) {
super(type, vehicle);

View File

@@ -5,6 +5,7 @@ import org.bukkit.entity.Vehicle;
/**
* Raised when a vehicle is created.
*/
@SuppressWarnings("serial")
public class VehicleCreateEvent extends VehicleEvent {
public VehicleCreateEvent(Vehicle vehicle) {
super(Type.VEHICLE_CREATE, vehicle);

View File

@@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable;
/**
* Raised when a vehicle receives damage.
*/
@SuppressWarnings("serial")
public class VehicleDamageEvent extends VehicleEvent implements Cancellable {
private Entity attacker;
private int damage;

View File

@@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable;
* or the environment. This is not raised if the boat is simply 'removed'
* due to other means.
*/
@SuppressWarnings("serial")
public class VehicleDestroyEvent extends VehicleEvent implements Cancellable {
private Entity attacker;
private boolean cancelled;

Some files were not shown because too many files have changed in this diff Show More