From b9fca3c04d3561ffa1430724e5fb5ab8e024dd2c Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Sun, 25 Dec 2011 16:02:30 +0100 Subject: Generic cleanup of warnings, whitespace and style. --- src/main/java/org/bukkit/Art.java | 54 ++-- src/main/java/org/bukkit/BlockChangeDelegate.java | 1 + src/main/java/org/bukkit/Bukkit.java | 2 +- src/main/java/org/bukkit/Chunk.java | 4 + src/main/java/org/bukkit/ChunkSnapshot.java | 2 + src/main/java/org/bukkit/Location.java | 14 +- src/main/java/org/bukkit/OfflinePlayer.java | 4 +- src/main/java/org/bukkit/Server.java | 9 +- src/main/java/org/bukkit/TravelAgent.java | 2 +- src/main/java/org/bukkit/World.java | 13 +- src/main/java/org/bukkit/WorldCreator.java | 2 +- src/main/java/org/bukkit/block/Block.java | 11 +- src/main/java/org/bukkit/block/BlockFace.java | 3 + src/main/java/org/bukkit/block/Jukebox.java | 10 +- src/main/java/org/bukkit/block/NoteBlock.java | 4 +- .../java/org/bukkit/block/PistonMoveReaction.java | 2 +- src/main/java/org/bukkit/command/Command.java | 3 +- .../java/org/bukkit/command/CommandException.java | 2 + .../org/bukkit/command/ConsoleCommandSender.java | 2 +- .../org/bukkit/command/MultipleCommandAlias.java | 1 - .../java/org/bukkit/command/PluginCommand.java | 2 +- .../bukkit/command/RemoteConsoleCommandSender.java | 2 +- .../java/org/bukkit/command/SimpleCommandMap.java | 7 +- .../org/bukkit/command/defaults/DeopCommand.java | 2 +- .../org/bukkit/command/defaults/ExpCommand.java | 2 +- .../org/bukkit/command/defaults/KillCommand.java | 2 +- .../org/bukkit/command/defaults/MeCommand.java | 8 +- .../org/bukkit/command/defaults/OpCommand.java | 2 +- .../bukkit/command/defaults/PluginsCommand.java | 6 +- .../org/bukkit/command/defaults/SayCommand.java | 10 +- .../org/bukkit/command/defaults/TimeCommand.java | 2 +- .../command/defaults/ToggleDownfallCommand.java | 2 +- .../bukkit/command/defaults/VersionCommand.java | 8 +- .../org/bukkit/configuration/Configuration.java | 4 +- .../bukkit/configuration/ConfigurationOptions.java | 22 +- .../bukkit/configuration/ConfigurationSection.java | 29 +- .../InvalidConfigurationException.java | 1 + .../bukkit/configuration/MemoryConfiguration.java | 4 +- .../configuration/MemoryConfigurationOptions.java | 2 +- .../org/bukkit/configuration/MemorySection.java | 359 +++++++++++---------- .../configuration/file/FileConfiguration.java | 16 +- .../file/FileConfigurationOptions.java | 22 +- .../configuration/file/YamlConfiguration.java | 111 +++---- .../file/YamlConfigurationOptions.java | 14 +- .../serialization/ConfigurationSerializable.java | 10 +- .../serialization/ConfigurationSerialization.java | 96 +++--- .../serialization/DelegateDeserialization.java | 2 +- .../serialization/SerializableAs.java | 2 +- src/main/java/org/bukkit/entity/Animals.java | 2 +- src/main/java/org/bukkit/entity/Blaze.java | 2 +- src/main/java/org/bukkit/entity/Boat.java | 14 +- .../java/org/bukkit/entity/ComplexEntityPart.java | 2 +- .../org/bukkit/entity/ComplexLivingEntity.java | 2 +- src/main/java/org/bukkit/entity/CreatureType.java | 2 +- src/main/java/org/bukkit/entity/EnderDragon.java | 2 +- src/main/java/org/bukkit/entity/EnderPearl.java | 2 +- src/main/java/org/bukkit/entity/EnderSignal.java | 2 +- src/main/java/org/bukkit/entity/Entity.java | 17 +- src/main/java/org/bukkit/entity/ExperienceOrb.java | 4 +- src/main/java/org/bukkit/entity/Explosive.java | 4 + src/main/java/org/bukkit/entity/HumanEntity.java | 8 - src/main/java/org/bukkit/entity/LivingEntity.java | 6 +- src/main/java/org/bukkit/entity/Minecart.java | 3 +- src/main/java/org/bukkit/entity/MushroomCow.java | 2 +- src/main/java/org/bukkit/entity/NPC.java | 2 +- src/main/java/org/bukkit/entity/Painting.java | 8 +- src/main/java/org/bukkit/entity/Pig.java | 2 +- src/main/java/org/bukkit/entity/Player.java | 7 +- src/main/java/org/bukkit/entity/SmallFireball.java | 2 +- src/main/java/org/bukkit/entity/Snowman.java | 2 +- src/main/java/org/bukkit/entity/TNTPrimed.java | 2 + src/main/java/org/bukkit/entity/ThrownPotion.java | 2 +- src/main/java/org/bukkit/entity/Villager.java | 2 +- src/main/java/org/bukkit/event/Event.java | 191 +++++------ src/main/java/org/bukkit/event/EventException.java | 2 + .../org/bukkit/event/block/BlockBreakEvent.java | 5 +- .../org/bukkit/event/block/BlockBurnEvent.java | 3 +- .../org/bukkit/event/block/BlockCanBuildEvent.java | 7 +- .../org/bukkit/event/block/BlockDamageEvent.java | 1 + .../org/bukkit/event/block/BlockDispenseEvent.java | 5 +- .../java/org/bukkit/event/block/BlockEvent.java | 1 + .../org/bukkit/event/block/BlockFadeEvent.java | 6 +- .../org/bukkit/event/block/BlockFormEvent.java | 12 +- .../org/bukkit/event/block/BlockFromToEvent.java | 3 +- .../org/bukkit/event/block/BlockIgniteEvent.java | 3 +- .../java/org/bukkit/event/block/BlockListener.java | 46 +-- .../org/bukkit/event/block/BlockPhysicsEvent.java | 1 + .../org/bukkit/event/block/BlockPistonEvent.java | 4 +- .../bukkit/event/block/BlockPistonExtendEvent.java | 1 + .../event/block/BlockPistonRetractEvent.java | 1 + .../org/bukkit/event/block/BlockPlaceEvent.java | 3 +- .../org/bukkit/event/block/BlockRedstoneEvent.java | 1 + .../org/bukkit/event/block/BlockSpreadEvent.java | 13 +- .../org/bukkit/event/block/LeavesDecayEvent.java | 3 +- .../org/bukkit/event/block/SignChangeEvent.java | 1 + .../bukkit/event/entity/CreatureSpawnEvent.java | 3 +- .../org/bukkit/event/entity/CreeperPowerEvent.java | 3 +- .../bukkit/event/entity/EndermanPickupEvent.java | 1 + .../bukkit/event/entity/EndermanPlaceEvent.java | 1 + .../event/entity/EntityCombustByBlockEvent.java | 2 + .../event/entity/EntityCombustByEntityEvent.java | 2 + .../bukkit/event/entity/EntityCombustEvent.java | 4 +- .../event/entity/EntityDamageByBlockEvent.java | 1 + .../event/entity/EntityDamageByEntityEvent.java | 1 + .../entity/EntityDamageByProjectileEvent.java | 1 + .../org/bukkit/event/entity/EntityDamageEvent.java | 1 + .../org/bukkit/event/entity/EntityDeathEvent.java | 1 + .../java/org/bukkit/event/entity/EntityEvent.java | 1 + .../bukkit/event/entity/EntityExplodeEvent.java | 4 + .../bukkit/event/entity/EntityInteractEvent.java | 1 + .../org/bukkit/event/entity/EntityListener.java | 6 +- .../event/entity/EntityPortalEnterEvent.java | 2 +- .../event/entity/EntityRegainHealthEvent.java | 1 + .../org/bukkit/event/entity/EntityTameEvent.java | 1 + .../org/bukkit/event/entity/EntityTargetEvent.java | 3 + .../bukkit/event/entity/ExplosionPrimeEvent.java | 1 + .../bukkit/event/entity/FoodLevelChangeEvent.java | 1 + .../org/bukkit/event/entity/ItemSpawnEvent.java | 1 + .../java/org/bukkit/event/entity/PigZapEvent.java | 1 + .../org/bukkit/event/entity/PlayerDeathEvent.java | 3 +- .../bukkit/event/entity/ProjectileHitEvent.java | 1 + .../org/bukkit/event/entity/SlimeSplitEvent.java | 1 + .../bukkit/event/inventory/FurnaceBurnEvent.java | 2 + .../bukkit/event/inventory/FurnaceSmeltEvent.java | 5 +- .../bukkit/event/inventory/InventoryListener.java | 3 +- .../event/painting/PaintingBreakByEntityEvent.java | 1 + .../bukkit/event/painting/PaintingBreakEvent.java | 1 + .../org/bukkit/event/painting/PaintingEvent.java | 1 + .../bukkit/event/painting/PaintingPlaceEvent.java | 1 + .../bukkit/event/player/PlayerAnimationEvent.java | 1 + .../bukkit/event/player/PlayerBedEnterEvent.java | 1 + .../bukkit/event/player/PlayerBedLeaveEvent.java | 1 + .../event/player/PlayerBucketEmptyEvent.java | 3 +- .../org/bukkit/event/player/PlayerBucketEvent.java | 2 +- .../bukkit/event/player/PlayerBucketFillEvent.java | 1 + .../event/player/PlayerChangedWorldEvent.java | 1 + .../org/bukkit/event/player/PlayerChatEvent.java | 1 + .../event/player/PlayerCommandPreprocessEvent.java | 1 + .../bukkit/event/player/PlayerDropItemEvent.java | 1 + .../bukkit/event/player/PlayerEggThrowEvent.java | 3 +- .../java/org/bukkit/event/player/PlayerEvent.java | 1 + .../org/bukkit/event/player/PlayerFishEvent.java | 1 + .../event/player/PlayerGameModeChangeEvent.java | 1 + .../event/player/PlayerInteractEntityEvent.java | 1 + .../bukkit/event/player/PlayerInteractEvent.java | 3 + .../bukkit/event/player/PlayerInventoryEvent.java | 1 + .../bukkit/event/player/PlayerItemHeldEvent.java | 1 + .../org/bukkit/event/player/PlayerJoinEvent.java | 1 + .../org/bukkit/event/player/PlayerKickEvent.java | 1 + .../org/bukkit/event/player/PlayerLoginEvent.java | 1 + .../org/bukkit/event/player/PlayerMoveEvent.java | 1 + .../bukkit/event/player/PlayerPickupItemEvent.java | 1 + .../org/bukkit/event/player/PlayerPortalEvent.java | 1 + .../bukkit/event/player/PlayerPreLoginEvent.java | 1 + .../org/bukkit/event/player/PlayerQuitEvent.java | 1 + .../bukkit/event/player/PlayerRespawnEvent.java | 1 + .../bukkit/event/player/PlayerTeleportEvent.java | 2 + .../event/player/PlayerToggleSneakEvent.java | 1 + .../event/player/PlayerToggleSprintEvent.java | 1 + .../bukkit/event/player/PlayerVelocityEvent.java | 1 + .../bukkit/event/server/MapInitializeEvent.java | 7 +- .../bukkit/event/server/PluginDisableEvent.java | 1 + .../org/bukkit/event/server/PluginEnableEvent.java | 1 + .../java/org/bukkit/event/server/PluginEvent.java | 1 + .../bukkit/event/server/ServerCommandEvent.java | 3 + .../java/org/bukkit/event/server/ServerEvent.java | 1 + .../bukkit/event/server/ServerListPingEvent.java | 17 +- .../org/bukkit/event/server/ServerListener.java | 8 +- .../event/vehicle/VehicleBlockCollisionEvent.java | 1 + .../event/vehicle/VehicleCollisionEvent.java | 1 + .../bukkit/event/vehicle/VehicleCreateEvent.java | 1 + .../bukkit/event/vehicle/VehicleDamageEvent.java | 1 + .../bukkit/event/vehicle/VehicleDestroyEvent.java | 1 + .../bukkit/event/vehicle/VehicleEnterEvent.java | 1 + .../event/vehicle/VehicleEntityCollisionEvent.java | 1 + .../org/bukkit/event/vehicle/VehicleEvent.java | 1 + .../org/bukkit/event/vehicle/VehicleExitEvent.java | 1 + .../org/bukkit/event/vehicle/VehicleMoveEvent.java | 1 + .../bukkit/event/vehicle/VehicleUpdateEvent.java | 1 + .../bukkit/event/weather/LightningStrikeEvent.java | 1 + .../bukkit/event/weather/ThunderChangeEvent.java | 1 + .../bukkit/event/weather/WeatherChangeEvent.java | 1 + .../org/bukkit/event/weather/WeatherEvent.java | 1 + .../java/org/bukkit/event/world/ChunkEvent.java | 1 + .../org/bukkit/event/world/ChunkLoadEvent.java | 1 + .../org/bukkit/event/world/ChunkPopulateEvent.java | 1 + .../org/bukkit/event/world/ChunkUnloadEvent.java | 1 + .../org/bukkit/event/world/PortalCreateEvent.java | 1 + .../org/bukkit/event/world/SpawnChangeEvent.java | 1 + .../org/bukkit/event/world/StructureGrowEvent.java | 2 +- .../java/org/bukkit/event/world/WorldEvent.java | 1 + .../org/bukkit/event/world/WorldInitEvent.java | 1 + .../org/bukkit/event/world/WorldLoadEvent.java | 1 + .../org/bukkit/event/world/WorldSaveEvent.java | 1 + .../org/bukkit/event/world/WorldUnloadEvent.java | 1 + .../java/org/bukkit/generator/ChunkGenerator.java | 24 +- .../java/org/bukkit/inventory/FurnaceRecipe.java | 6 + src/main/java/org/bukkit/inventory/ItemStack.java | 11 +- .../java/org/bukkit/inventory/PlayerInventory.java | 2 +- src/main/java/org/bukkit/inventory/Recipe.java | 1 + .../java/org/bukkit/inventory/ShapedRecipe.java | 8 + .../java/org/bukkit/inventory/ShapelessRecipe.java | 10 + src/main/java/org/bukkit/map/MapCanvas.java | 28 +- src/main/java/org/bukkit/map/MapCursor.java | 53 +-- .../java/org/bukkit/map/MapCursorCollection.java | 25 +- src/main/java/org/bukkit/map/MapFont.java | 42 ++- src/main/java/org/bukkit/map/MapPalette.java | 32 +- src/main/java/org/bukkit/map/MapRenderer.java | 18 +- src/main/java/org/bukkit/map/MapView.java | 67 ++-- src/main/java/org/bukkit/map/MinecraftFont.java | 24 +- src/main/java/org/bukkit/material/Bed.java | 2 + src/main/java/org/bukkit/material/Directional.java | 1 + src/main/java/org/bukkit/material/Door.java | 5 + src/main/java/org/bukkit/material/Furnace.java | 1 + src/main/java/org/bukkit/material/Lever.java | 1 + .../org/bukkit/material/PistonBaseMaterial.java | 63 ++-- .../bukkit/material/PistonExtensionMaterial.java | 63 ++-- src/main/java/org/bukkit/material/PoweredRail.java | 1 + src/main/java/org/bukkit/material/Pumpkin.java | 1 + src/main/java/org/bukkit/material/Rails.java | 10 +- .../java/org/bukkit/material/TexturedMaterial.java | 8 +- src/main/java/org/bukkit/material/TrapDoor.java | 34 +- .../java/org/bukkit/permissions/Permissible.java | 1 - .../org/bukkit/permissions/PermissibleBase.java | 9 +- .../java/org/bukkit/permissions/Permission.java | 29 +- .../bukkit/permissions/PermissionAttachment.java | 1 - .../permissions/PermissionAttachmentInfo.java | 1 - .../org/bukkit/permissions/PermissionDefault.java | 22 +- .../permissions/PermissionRemovedExecutor.java | 1 - .../java/org/bukkit/plugin/AuthorNagException.java | 1 + .../plugin/IllegalPluginAccessException.java | 2 + src/main/java/org/bukkit/plugin/Plugin.java | 16 +- .../org/bukkit/plugin/PluginDescriptionFile.java | 10 +- .../java/org/bukkit/plugin/PluginLoadOrder.java | 1 - src/main/java/org/bukkit/plugin/PluginLoader.java | 5 +- .../java/org/bukkit/plugin/RegisteredListener.java | 4 + .../bukkit/plugin/RegisteredServiceProvider.java | 5 +- .../java/org/bukkit/plugin/ServicesManager.java | 6 +- .../org/bukkit/plugin/SimplePluginManager.java | 4 +- .../org/bukkit/plugin/SimpleServicesManager.java | 3 +- .../java/org/bukkit/plugin/java/JavaPlugin.java | 35 +- .../org/bukkit/plugin/java/JavaPluginLoader.java | 28 +- .../java/org/bukkit/scheduler/BukkitScheduler.java | 4 +- .../java/org/bukkit/scheduler/BukkitWorker.java | 2 +- src/main/java/org/bukkit/util/BlockIterator.java | 40 +-- src/main/java/org/bukkit/util/BlockVector.java | 13 +- .../java/org/bukkit/util/NumberConversions.java | 24 +- src/main/java/org/bukkit/util/Vector.java | 18 +- .../java/org/bukkit/util/config/Configuration.java | 21 +- .../org/bukkit/util/config/ConfigurationNode.java | 11 +- .../java/org/bukkit/util/noise/NoiseGenerator.java | 3 +- .../org/bukkit/util/noise/OctaveGenerator.java | 1 - .../bukkit/util/noise/PerlinNoiseGenerator.java | 2 +- .../bukkit/util/noise/PerlinOctaveGenerator.java | 1 - .../bukkit/util/noise/SimplexOctaveGenerator.java | 7 +- .../util/permissions/DefaultPermissions.java | 3 +- 256 files changed, 1308 insertions(+), 1046 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/bukkit/Art.java b/src/main/java/org/bukkit/Art.java index fef562bb..10fad07b 100644 --- a/src/main/java/org/bukkit/Art.java +++ b/src/main/java/org/bukkit/Art.java @@ -6,34 +6,34 @@ import java.util.HashMap; * Represents the art on a painting */ public enum Art { - KEBAB(0,1,1), - AZTEC(1,1,1), - ALBAN(2,1,1), - AZTEC2(3,1,1), - BOMB(4,1,1), - PLANT(5,1,1), - WASTELAND(6,1,1), - POOL(7,2,1), - COURBET(8,2,1), - SEA(9,2,1), - SUNSET(10,2,1), - CREEBET(11,2,1), - WANDERER(12,1,2), - GRAHAM(13,1,2), - MATCH(14,4,2), - BUST(15,2,2), - STAGE(16,2,2), - VOID(17,2,2), - SKULL_AND_ROSES(18,2,2), - FIGHTERS(19,2,2), - POINTER(20,4,4), - PIGSCENE(21,4,4), - BURNINGSKULL(22,4,4), - SKELETON(23,4,3), - DONKEYKONG(24,4,3); + KEBAB(0, 1, 1), + AZTEC(1, 1, 1), + ALBAN(2, 1, 1), + AZTEC2(3, 1, 1), + BOMB(4, 1, 1), + PLANT(5, 1, 1), + WASTELAND(6, 1, 1), + POOL(7, 2, 1), + COURBET(8, 2, 1), + SEA(9, 2, 1), + SUNSET(10, 2, 1), + CREEBET(11, 2, 1), + WANDERER(12, 1, 2), + GRAHAM(13, 1, 2), + MATCH(14, 4, 2), + BUST(15, 2, 2), + STAGE(16, 2, 2), + VOID(17, 2, 2), + SKULL_AND_ROSES(18, 2, 2), + FIGHTERS(19, 2, 2), + POINTER(20, 4, 4), + PIGSCENE(21, 4, 4), + BURNINGSKULL(22, 4, 4), + SKELETON(23, 4, 3), + DONKEYKONG(24, 4, 3); private int id, width, height; - private static HashMap names = new HashMap(); - private static HashMap ids = new HashMap(); + private static HashMap names = new HashMap(); + private static HashMap ids = new HashMap(); static { for (Art art : Art.values()) { ids.put(art.id, art); diff --git a/src/main/java/org/bukkit/BlockChangeDelegate.java b/src/main/java/org/bukkit/BlockChangeDelegate.java index 64be8f09..78c7b7bc 100644 --- a/src/main/java/org/bukkit/BlockChangeDelegate.java +++ b/src/main/java/org/bukkit/BlockChangeDelegate.java @@ -32,6 +32,7 @@ public interface BlockChangeDelegate { /** * Get the block type at the location. + * * @param x X coordinate * @param y Y coordinate * @param z Z coordinate diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index c051209d..d7753329 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -258,7 +258,7 @@ public final class Bukkit { public static void unbanIP(String address) { server.unbanIP(address); } - + public static Set getBannedPlayers() { return server.getBannedPlayers(); } diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java index c44bc5ce..77651392 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -42,12 +42,14 @@ public interface Chunk { /** * Capture thread-safe read-only snapshot of chunk data + * * @return ChunkSnapshot */ ChunkSnapshot getChunkSnapshot(); /** * Capture thread-safe read-only snapshot of chunk data + * * @param includeMaxblocky - if true, snapshot includes per-coordinate maximum Y values * @param includeBiome - if true, snapshot includes per-coordinate biome type * @param includeBiomeTempRain - if true, snapshot includes per-coordinate raw biome temperature and rainfall @@ -57,12 +59,14 @@ public interface Chunk { /** * Get a list of all entities in the chunk. + * * @return The entities. */ Entity[] getEntities(); /** * Get a list of all tile entities in the chunk. + * * @return The tile entities. */ BlockState[] getTileEntities(); diff --git a/src/main/java/org/bukkit/ChunkSnapshot.java b/src/main/java/org/bukkit/ChunkSnapshot.java index e54b5e6b..e1373c61 100644 --- a/src/main/java/org/bukkit/ChunkSnapshot.java +++ b/src/main/java/org/bukkit/ChunkSnapshot.java @@ -1,6 +1,7 @@ package org.bukkit; import org.bukkit.block.Biome; + /** * Represents a static, thread-safe snapshot of chunk of blocks * Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering) @@ -106,6 +107,7 @@ public interface ChunkSnapshot { /** * Get world full time when chunk snapshot was captured + * * @return time in ticks */ long getCaptureFullTime(); diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java index 6ee1852e..f4b8c989 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -240,10 +240,10 @@ public class Location implements Cloneable { z += vec.z; return this; } - - /** + + /** * Adds the location by a vector. - * + * * @see Vector * @param vec Vector to use * @return the same location @@ -289,10 +289,10 @@ public class Location implements Cloneable { z -= vec.z; return this; } - - /** + + /** * Subtracts the location by a vector. - * + * * @see Vector * @param vec The vector to use * @return the same location @@ -348,7 +348,7 @@ public class Location implements Cloneable { } /** - * Get the distance between this location and another. The value + * Get the distance between this location and another. The value * of this method is not cached and uses a costly square-root function, so * do not repeatedly call this method to get the location's magnitude. NaN * will be returned if the inner result of the sqrt() function overflows, diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java index 2f4ca39f..a59f8424 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java @@ -47,13 +47,13 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @param value true if whitelisted */ public void setWhitelisted(boolean value); - + /** * Gets a {@link Player} object that this represents, if there is one *

* If the player is online, this will return that player. Otherwise, * it will return null. - * + * * @return Online player */ public Player getPlayer(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 80cd8127..54f301e3 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -53,10 +53,10 @@ public interface Server { * @return version of this server implementation */ public String getVersion(); - + /** * Gets the Bukkit version that this server is running. - * + * * @return Version of Bukkit */ public String getBukkitVersion(); @@ -110,7 +110,7 @@ public interface Server { * @return The ID of this server */ public String getServerId(); - + /** * Gets whether this server allows the End or not. * @@ -304,7 +304,7 @@ public interface Server { */ public World createWorld(WorldCreator creator); - /** + /** * Unloads a world with the given name. * * @param name Name of the world to unload @@ -398,6 +398,7 @@ public interface Server { /** * Adds a recipe to the crafting manager. + * * @param recipe The recipe to add. * @return True to indicate that the recipe was added. */ diff --git a/src/main/java/org/bukkit/TravelAgent.java b/src/main/java/org/bukkit/TravelAgent.java index 1fac1e73..5a545fc7 100644 --- a/src/main/java/org/bukkit/TravelAgent.java +++ b/src/main/java/org/bukkit/TravelAgent.java @@ -64,7 +64,7 @@ public interface TravelAgent { /** * Attempt to create a portal near the given location. - * + * * @param location The desired location of the portal. * @return True if a nether portal was successfully created. */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 2ecb8a95..d6ae084d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -552,12 +552,14 @@ public interface World { /** * Gets the current PVP setting for this world. + * * @return True if PVP is enabled */ public boolean getPVP(); /** * Sets the PVP setting for this world. + * * @param pvp True/False whether PVP should be Enabled. */ public void setPVP(boolean pvp); @@ -613,7 +615,8 @@ public interface World { /** * Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome - * data. Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk. + * data. Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk. + * * @param x - chunk x coordinate * @param z - chunk z coordinate * @param includeBiome - if true, snapshot includes per-coordinate biome type @@ -706,10 +709,10 @@ public interface World { public boolean getKeepSpawnInMemory(); /** - * Sets whether the world's spawn area should be kept loaded into memory or not. - * - * @param keepLoaded if true then the world's spawn area will be kept loaded into memory. - */ + * Sets whether the world's spawn area should be kept loaded into memory or not. + * + * @param keepLoaded if true then the world's spawn area will be kept loaded into memory. + */ public void setKeepSpawnInMemory(boolean keepLoaded); /** diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java index 0d299ff8..fec84f0c 100644 --- a/src/main/java/org/bukkit/WorldCreator.java +++ b/src/main/java/org/bukkit/WorldCreator.java @@ -226,7 +226,7 @@ public class WorldCreator { if (output == null) { output = Bukkit.getConsoleSender(); } - + if (name != null) { String[] split = name.split(":", 2); String id = (split.length > 1) ? split[1] : null; diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java index e4a9be93..58030574 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -23,12 +23,14 @@ public interface Block { /** * @deprecated use {@link #getRelative(BlockFace face)} */ - @Deprecated Block getFace(BlockFace face); + @Deprecated + Block getFace(BlockFace face); /** * @deprecated use {@link #getRelative(BlockFace face, int distance)} */ - @Deprecated Block getFace(BlockFace face, int distance); + @Deprecated + Block getFace(BlockFace face, int distance); /** * Gets the block at the given offsets @@ -56,8 +58,9 @@ public interface Block { *
* For example, the following method places water at 100,102,100; two blocks * above 100,100,100. + * *

-     * Block block = world.getBlockAt(100,100,100);
+     * Block block = world.getBlockAt(100, 100, 100);
      * Block shower = block.getFace(BlockFace.UP, 2);
      * shower.setType(Material.WATER);
      * 
@@ -164,12 +167,14 @@ public interface Block { * Gets the face relation of this block compared to the given block
*
* For example: + * *
      * Block current = world.getBlockAt(100, 100, 100);
      * Block target = world.getBlockAt(100, 101, 100);
      *
      * current.getFace(target) == BlockFace.Up;
      * 
+ * *
* If the given block is not connected to this block, null may be returned * diff --git a/src/main/java/org/bukkit/block/BlockFace.java b/src/main/java/org/bukkit/block/BlockFace.java index 1c687ebb..43447648 100644 --- a/src/main/java/org/bukkit/block/BlockFace.java +++ b/src/main/java/org/bukkit/block/BlockFace.java @@ -42,6 +42,7 @@ public enum BlockFace { /** * Get the amount of X-coordinates to modify to get the represented block + * * @return Amount of X-coordinates to modify */ public int getModX() { @@ -50,6 +51,7 @@ public enum BlockFace { /** * Get the amount of Y-coordinates to modify to get the represented block + * * @return Amount of Y-coordinates to modify */ public int getModY() { @@ -58,6 +60,7 @@ public enum BlockFace { /** * Get the amount of Z-coordinates to modify to get the represented block + * * @return Amount of Z-coordinates to modify */ public int getModZ() { diff --git a/src/main/java/org/bukkit/block/Jukebox.java b/src/main/java/org/bukkit/block/Jukebox.java index 6d941168..7b45b833 100644 --- a/src/main/java/org/bukkit/block/Jukebox.java +++ b/src/main/java/org/bukkit/block/Jukebox.java @@ -8,24 +8,28 @@ import org.bukkit.Material; public interface Jukebox extends BlockState { /** * Get the record currently playing + * * @return The record Material, or AIR if none is playing */ public Material getPlaying(); - + /** * Set the record currently playing + * * @param record The record Material, or null/AIR to stop playing */ public void setPlaying(Material record); - + /** * Check if the jukebox is currently playing a record + * * @return True if there is a record playing */ public boolean isPlaying(); - + /** * Stop the jukebox playing and eject the current record + * * @return True if a record was ejected; false if there was none playing */ public boolean eject(); diff --git a/src/main/java/org/bukkit/block/NoteBlock.java b/src/main/java/org/bukkit/block/NoteBlock.java index e086fdc6..ffe5af65 100644 --- a/src/main/java/org/bukkit/block/NoteBlock.java +++ b/src/main/java/org/bukkit/block/NoteBlock.java @@ -47,7 +47,7 @@ public interface NoteBlock extends BlockState { /** * Plays an arbitrary note with an arbitrary instrument - * + * * @param instrument Instrument ID * @param note Note ID * @return true if successful, otherwise false @@ -56,7 +56,7 @@ public interface NoteBlock extends BlockState { /** * Plays an arbitrary note with an arbitrary instrument - * + * * @param instrument The instrument * @param note The note * @return true if successful, otherwise false diff --git a/src/main/java/org/bukkit/block/PistonMoveReaction.java b/src/main/java/org/bukkit/block/PistonMoveReaction.java index 83064122..42023b9a 100644 --- a/src/main/java/org/bukkit/block/PistonMoveReaction.java +++ b/src/main/java/org/bukkit/block/PistonMoveReaction.java @@ -11,7 +11,7 @@ public enum PistonMoveReaction { private int id; private static Map byId = new HashMap(); static { - for (PistonMoveReaction reaction: PistonMoveReaction.values()) { + for (PistonMoveReaction reaction : PistonMoveReaction.values()) { byId.put(reaction.id, reaction); } } diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java index 65e3370a..c4305878 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -149,7 +149,6 @@ public abstract class Command { return false; } - private boolean allowChangesFrom(CommandMap commandMap) { return (null == this.commandMap || this.commandMap == commandMap); } @@ -237,7 +236,7 @@ public abstract class Command { for (Permissible user : users) { if (user instanceof CommandSender) { - CommandSender target = (CommandSender)user; + CommandSender target = (CommandSender) user; if (target instanceof ConsoleCommandSender) { target.sendMessage(result); diff --git a/src/main/java/org/bukkit/command/CommandException.java b/src/main/java/org/bukkit/command/CommandException.java index 2ea2c6f1..76c1a016 100644 --- a/src/main/java/org/bukkit/command/CommandException.java +++ b/src/main/java/org/bukkit/command/CommandException.java @@ -3,6 +3,7 @@ package org.bukkit.command; /** * Thrown when an unhandled exception occurs during the execution of a Command */ +@SuppressWarnings("serial") public class CommandException extends RuntimeException { /** @@ -12,6 +13,7 @@ public class CommandException extends RuntimeException { /** * Constructs an instance of CommandException with the specified detail message. + * * @param msg the detail message. */ public CommandException(String msg) { diff --git a/src/main/java/org/bukkit/command/ConsoleCommandSender.java b/src/main/java/org/bukkit/command/ConsoleCommandSender.java index a74df60a..baf80b6e 100644 --- a/src/main/java/org/bukkit/command/ConsoleCommandSender.java +++ b/src/main/java/org/bukkit/command/ConsoleCommandSender.java @@ -1,4 +1,4 @@ package org.bukkit.command; -public interface ConsoleCommandSender extends CommandSender{ +public interface ConsoleCommandSender extends CommandSender { } diff --git a/src/main/java/org/bukkit/command/MultipleCommandAlias.java b/src/main/java/org/bukkit/command/MultipleCommandAlias.java index e1474542..59ac4c20 100644 --- a/src/main/java/org/bukkit/command/MultipleCommandAlias.java +++ b/src/main/java/org/bukkit/command/MultipleCommandAlias.java @@ -1,4 +1,3 @@ - package org.bukkit.command; /** diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java index 1b220b10..67597d32 100644 --- a/src/main/java/org/bukkit/command/PluginCommand.java +++ b/src/main/java/org/bukkit/command/PluginCommand.java @@ -43,7 +43,7 @@ public final class PluginCommand extends Command { } if (!success && usageMessage.length() > 0) { - for (String line: usageMessage.replace("", commandLabel).split("\n")) { + for (String line : usageMessage.replace("", commandLabel).split("\n")) { sender.sendMessage(line); } } diff --git a/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java b/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java index 5ba3c438..dc3bc1d1 100644 --- a/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java +++ b/src/main/java/org/bukkit/command/RemoteConsoleCommandSender.java @@ -1,4 +1,4 @@ package org.bukkit.command; -public interface RemoteConsoleCommandSender extends CommandSender{ +public interface RemoteConsoleCommandSender extends CommandSender { } diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java index 3f03ebcf..5965e4d7 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -79,7 +79,7 @@ public class SimpleCommandMap implements CommandMap { public boolean register(String label, String fallbackPrefix, Command command) { boolean registeredPassedLabel = register(label, fallbackPrefix, command, false); - Iterator iterator = command.getAliases().iterator(); + Iterator iterator = command.getAliases().iterator(); while (iterator.hasNext()) { if (!register((String) iterator.next(), fallbackPrefix, command, true)) { iterator.remove(); @@ -94,12 +94,13 @@ public class SimpleCommandMap implements CommandMap { /** * Registers a command with the given name is possible, otherwise uses fallbackPrefix to create a unique name if its not an alias + * * @param name the name of the command, without the '/'-prefix. * @param fallbackPrefix a prefix which is prepended to the command with a ':' one or more times to make the command unique * @param command the command to register * @return true if command was registered with the passed in label, false otherwise. - * If isAlias was true a return of false indicates no command was registerd - * If isAlias was false a return of false indicates the fallbackPrefix was used one or more times to create a unique name for the command + * If isAlias was true a return of false indicates no command was registerd + * If isAlias was false a return of false indicates the fallbackPrefix was used one or more times to create a unique name for the command */ private synchronized boolean register(String label, String fallbackPrefix, Command command, boolean isAlias) { String lowerLabel = label.trim().toLowerCase(); diff --git a/src/main/java/org/bukkit/command/defaults/DeopCommand.java b/src/main/java/org/bukkit/command/defaults/DeopCommand.java index a01327dc..ef7ab2f1 100644 --- a/src/main/java/org/bukkit/command/defaults/DeopCommand.java +++ b/src/main/java/org/bukkit/command/defaults/DeopCommand.java @@ -29,7 +29,7 @@ public class DeopCommand extends VanillaCommand { player.setOp(false); if (player instanceof Player) { - ((Player)player).sendMessage(ChatColor.YELLOW + "You are no longer op!"); + ((Player) player).sendMessage(ChatColor.YELLOW + "You are no longer op!"); } return true; diff --git a/src/main/java/org/bukkit/command/defaults/ExpCommand.java b/src/main/java/org/bukkit/command/defaults/ExpCommand.java index 71773fd2..721a7d7a 100644 --- a/src/main/java/org/bukkit/command/defaults/ExpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ExpCommand.java @@ -28,7 +28,7 @@ public class ExpCommand extends VanillaCommand { try { int exp = Integer.parseInt(args[1]); - Command.broadcastCommandMessage(sender, "Giving " + exp + " exp to " + player.getName()); + Command.broadcastCommandMessage(sender, "Giving " + exp + " exp to " + player.getName()); player.giveExp(exp); } catch (NumberFormatException ex) { diff --git a/src/main/java/org/bukkit/command/defaults/KillCommand.java b/src/main/java/org/bukkit/command/defaults/KillCommand.java index e6c2fa13..0fe80db4 100644 --- a/src/main/java/org/bukkit/command/defaults/KillCommand.java +++ b/src/main/java/org/bukkit/command/defaults/KillCommand.java @@ -18,7 +18,7 @@ public class KillCommand extends VanillaCommand { if (!testPermission(sender)) return true; if (sender instanceof Player) { - Player player = (Player)sender; + Player player = (Player) sender; EntityDamageEvent ede = new EntityDamageEvent(player, EntityDamageEvent.DamageCause.SUICIDE, 1000); Bukkit.getPluginManager().callEvent(ede); diff --git a/src/main/java/org/bukkit/command/defaults/MeCommand.java b/src/main/java/org/bukkit/command/defaults/MeCommand.java index 54184b09..f181b4fe 100644 --- a/src/main/java/org/bukkit/command/defaults/MeCommand.java +++ b/src/main/java/org/bukkit/command/defaults/MeCommand.java @@ -23,10 +23,10 @@ public class MeCommand extends VanillaCommand { StringBuilder message = new StringBuilder(); message.append(sender.getName()); if (args.length > 0) { - for (int i = 0; i < args.length; i++) { - message.append(" "); - message.append(args[i]); - } + for (String arg : args) { + message.append(" "); + message.append(arg); + } } Bukkit.broadcastMessage("* " + message.toString()); diff --git a/src/main/java/org/bukkit/command/defaults/OpCommand.java b/src/main/java/org/bukkit/command/defaults/OpCommand.java index b8329de7..2b41dfc9 100644 --- a/src/main/java/org/bukkit/command/defaults/OpCommand.java +++ b/src/main/java/org/bukkit/command/defaults/OpCommand.java @@ -29,7 +29,7 @@ public class OpCommand extends VanillaCommand { player.setOp(true); if (player instanceof Player) { - ((Player)player).sendMessage(ChatColor.YELLOW + "You are now op!"); + ((Player) player).sendMessage(ChatColor.YELLOW + "You are now op!"); } return true; diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java index ec03cfb3..2efe30e8 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -19,7 +19,7 @@ public class PluginsCommand extends Command { @Override public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; - + sender.sendMessage("Plugins: " + getPluginList()); return true; } @@ -27,13 +27,13 @@ public class PluginsCommand extends Command { private String getPluginList() { StringBuilder pluginList = new StringBuilder(); Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); - + for (Plugin plugin : plugins) { if (pluginList.length() > 0) { pluginList.append(ChatColor.WHITE); pluginList.append(", "); } - + pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED); pluginList.append(plugin.getDescription().getName()); } diff --git a/src/main/java/org/bukkit/command/defaults/SayCommand.java b/src/main/java/org/bukkit/command/defaults/SayCommand.java index 37fdac76..41ce50ef 100644 --- a/src/main/java/org/bukkit/command/defaults/SayCommand.java +++ b/src/main/java/org/bukkit/command/defaults/SayCommand.java @@ -23,11 +23,11 @@ public class SayCommand extends VanillaCommand { StringBuilder message = new StringBuilder(); if (args.length > 0) { - message.append(args[0]); - for (int i = 1; i < args.length; i++) { - message.append(" "); - message.append(args[i]); - } + message.append(args[0]); + for (int i = 1; i < args.length; i++) { + message.append(" "); + message.append(args[i]); + } } if (!(sender instanceof ConsoleCommandSender)) { diff --git a/src/main/java/org/bukkit/command/defaults/TimeCommand.java b/src/main/java/org/bukkit/command/defaults/TimeCommand.java index a9e6a9fe..347c3489 100644 --- a/src/main/java/org/bukkit/command/defaults/TimeCommand.java +++ b/src/main/java/org/bukkit/command/defaults/TimeCommand.java @@ -15,7 +15,7 @@ public class TimeCommand extends VanillaCommand { @Override public boolean execute(CommandSender sender, String currentAlias, String[] args) { - if (args.length != 2) { + if (args.length != 2) { sender.sendMessage(ChatColor.RED + "Incorrect usage. Correct usage:\n" + usageMessage); return false; } diff --git a/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java b/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java index d03ccecb..f5f8c217 100644 --- a/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ToggleDownfallCommand.java @@ -29,7 +29,7 @@ public class ToggleDownfallCommand extends VanillaCommand { return true; } } else if (sender instanceof Player) { - world = ((Player)sender).getWorld(); + world = ((Player) sender).getWorld(); } else { world = Bukkit.getWorlds().get(0); } diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java index 91231a06..3a582359 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -12,7 +12,7 @@ import org.bukkit.plugin.PluginDescriptionFile; public class VersionCommand extends Command { public VersionCommand(String name) { super(name); - + this.description = "Gets the version of this server including any plugins in use"; this.usageMessage = "/version [plugin name]"; this.setPermission("bukkit.command.version"); @@ -22,7 +22,7 @@ public class VersionCommand extends Command { @Override public boolean execute(CommandSender sender, String currentAlias, String[] args) { if (!testPermission(sender)) return true; - + if (args.length == 0) { sender.sendMessage("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")"); } else { @@ -32,7 +32,7 @@ public class VersionCommand extends Command { if (name.length() > 0) { name.append(' '); } - + name.append(arg); } @@ -83,7 +83,7 @@ public class VersionCommand extends Command { result.append(ChatColor.GREEN); result.append(authors.get(i)); } - + return result.toString(); } } diff --git a/src/main/java/org/bukkit/configuration/Configuration.java b/src/main/java/org/bukkit/configuration/Configuration.java index ed66d1b8..6fa80186 100644 --- a/src/main/java/org/bukkit/configuration/Configuration.java +++ b/src/main/java/org/bukkit/configuration/Configuration.java @@ -70,12 +70,12 @@ public interface Configuration extends ConfigurationSection { * @return Configuration source for default values, or null if none exist. */ public Configuration getDefaults(); - + /** * Gets the {@link ConfigurationOptions} for this {@link Configuration}. *

* All setters through this method are chainable. - * + * * @return Options for this configuration */ public ConfigurationOptions options(); diff --git a/src/main/java/org/bukkit/configuration/ConfigurationOptions.java b/src/main/java/org/bukkit/configuration/ConfigurationOptions.java index 5392700f..73ca421c 100644 --- a/src/main/java/org/bukkit/configuration/ConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/ConfigurationOptions.java @@ -7,38 +7,38 @@ public class ConfigurationOptions { private char pathSeparator = '.'; private boolean copyDefaults = false; private final Configuration configuration; - + protected ConfigurationOptions(Configuration configuration) { this.configuration = configuration; } - + /** * Returns the {@link Configuration} that this object is responsible for. - * + * * @return Parent configuration */ public Configuration configuration() { return configuration; } - + /** * Gets the char that will be used to separate {@link ConfigurationSection}s *

* This value does not affect how the {@link Configuration} is stored, only in * how you access the data. The default value is '.'. - * + * * @return Path separator */ public char pathSeparator() { return pathSeparator; } - + /** * Sets the char that will be used to separate {@link ConfigurationSection}s *

* This value does not affect how the {@link Configuration} is stored, only in * how you access the data. The default value is '.'. - * + * * @param value Path separator * @return This object, for chaining */ @@ -46,7 +46,7 @@ public class ConfigurationOptions { this.pathSeparator = value; return this; } - + /** * Checks if the {@link Configuration} should copy values from its default {@link Configuration} directly. *

@@ -55,13 +55,13 @@ public class ConfigurationOptions { * are provided by default. As a result, {@link ConfigurationSection#contains(java.lang.String)} will always * return the same value as {@link ConfigurationSection#isSet(java.lang.String)}. * The default value is false. - * + * * @return Whether or not defaults are directly copied */ public boolean copyDefaults() { return copyDefaults; } - + /** * Sets if the {@link Configuration} should copy values from its default {@link Configuration} directly. *

@@ -70,7 +70,7 @@ public class ConfigurationOptions { * are provided by default. As a result, {@link ConfigurationSection#contains(java.lang.String)} will always * return the same value as {@link ConfigurationSection#isSet(java.lang.String)}. * The default value is false. - * + * * @param value Whether or not defaults are directly copied * @return This object, for chaining */ diff --git a/src/main/java/org/bukkit/configuration/ConfigurationSection.java b/src/main/java/org/bukkit/configuration/ConfigurationSection.java index 3bd6fe37..7083ccc2 100644 --- a/src/main/java/org/bukkit/configuration/ConfigurationSection.java +++ b/src/main/java/org/bukkit/configuration/ConfigurationSection.java @@ -79,13 +79,13 @@ public interface ConfigurationSection { * @return Path of this section relative to its root */ public String getCurrentPath(); - + /** * Gets the name of this individual {@link ConfigurationSection}, in the path. *

* This will always be the final part of {@link #getCurrentPath()}, unless the * section is orphaned. - * + * * @return Name of this section */ public String getName(); @@ -146,7 +146,7 @@ public interface ConfigurationSection { *

* Some implementations may have limitations on what you may store. See their * individual javadocs for details. No implementations should allow you to store - * {@link Configuration}s or {@link ConfigurationSection}s, please use + * {@link Configuration}s or {@link ConfigurationSection}s, please use * {@link #createSection(java.lang.String)} for that. * * @param path Path of the object to set. @@ -164,7 +164,7 @@ public interface ConfigurationSection { * @return Newly created section */ public ConfigurationSection createSection(String path); - + /** * Creates a {@link ConfigurationSection} at the specified path, with specified values. *

@@ -213,7 +213,6 @@ public interface ConfigurationSection { */ public boolean isString(String path); - /** * Gets the requested int by path. *

@@ -250,7 +249,6 @@ public interface ConfigurationSection { */ public boolean isInt(String path); - /** * Gets the requested boolean by path. *

@@ -287,7 +285,6 @@ public interface ConfigurationSection { */ public boolean isBoolean(String path); - /** * Gets the requested double by path. *

@@ -324,7 +321,6 @@ public interface ConfigurationSection { */ public boolean isDouble(String path); - /** * Gets the requested long by path. *

@@ -361,8 +357,6 @@ public interface ConfigurationSection { */ public boolean isLong(String path); - - // Java /** * Gets the requested List by path. @@ -374,6 +368,7 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List. */ + @SuppressWarnings("rawtypes") public List getList(String path); /** @@ -385,7 +380,8 @@ public interface ConfigurationSection { * @param path Path of the List to get. * @return Requested List. */ - public List getList(String path, List def); + @SuppressWarnings("rawtypes") + public List getList(String path, List def); /** * Checks if the specified path is a List. @@ -400,7 +396,6 @@ public interface ConfigurationSection { */ public boolean isList(String path); - /** * Gets the requested List of String by path. *

@@ -551,7 +546,6 @@ public interface ConfigurationSection { */ public List> getMapList(String path); - // Bukkit /** * Gets the requested Vector by path. @@ -589,7 +583,6 @@ public interface ConfigurationSection { */ public boolean isVector(String path); - /** * Gets the requested OfflinePlayer by path. *

@@ -626,7 +619,6 @@ public interface ConfigurationSection { */ public boolean isOfflinePlayer(String path); - /** * Gets the requested ItemStack by path. *

@@ -663,7 +655,6 @@ public interface ConfigurationSection { */ public boolean isItemStack(String path); - /** * Gets the requested ConfigurationSection by path. *

@@ -688,18 +679,18 @@ public interface ConfigurationSection { * @return Whether or not the specified path is a ConfigurationSection. */ public boolean isConfigurationSection(String path); - + /** * Gets the equivalent {@link ConfigurationSection} from the default {@link Configuration} defined in {@link #getRoot()}. *

* If the root contains no defaults, or the defaults doesn't contain a value * for this path, or the value at this path is not a {@link ConfigurationSection} then * this will return null. - * + * * @return Equivalent section in root configuration */ public ConfigurationSection getDefaultSection(); - + /** * Sets the default value in the root at the given path as provided. *

diff --git a/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java b/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java index 3057712f..c60ff56e 100644 --- a/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java +++ b/src/main/java/org/bukkit/configuration/InvalidConfigurationException.java @@ -3,6 +3,7 @@ package org.bukkit.configuration; /** * Exception thrown when attempting to load an invalid {@link Configuration} */ +@SuppressWarnings("serial") public class InvalidConfigurationException extends Exception { /** * Creates a new instance of InvalidConfigurationException without a message or cause. diff --git a/src/main/java/org/bukkit/configuration/MemoryConfiguration.java b/src/main/java/org/bukkit/configuration/MemoryConfiguration.java index 5fffc593..d26a2984 100644 --- a/src/main/java/org/bukkit/configuration/MemoryConfiguration.java +++ b/src/main/java/org/bukkit/configuration/MemoryConfiguration.java @@ -32,7 +32,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration if (path == null) { throw new IllegalArgumentException("Path may not be null"); } - + if (defaults == null) { defaults = new MemoryConfiguration(); } @@ -79,7 +79,7 @@ public class MemoryConfiguration extends MemorySection implements Configuration if (options == null) { options = new MemoryConfigurationOptions(this); } - + return options; } } diff --git a/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java b/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java index 93d3e50c..16b10514 100644 --- a/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/MemoryConfigurationOptions.java @@ -10,7 +10,7 @@ public class MemoryConfigurationOptions extends ConfigurationOptions { @Override public MemoryConfiguration configuration() { - return (MemoryConfiguration)super.configuration(); + return (MemoryConfiguration) super.configuration(); } @Override diff --git a/src/main/java/org/bukkit/configuration/MemorySection.java b/src/main/java/org/bukkit/configuration/MemorySection.java index 3cae2295..eb84b4a6 100644 --- a/src/main/java/org/bukkit/configuration/MemorySection.java +++ b/src/main/java/org/bukkit/configuration/MemorySection.java @@ -40,7 +40,7 @@ public class MemorySection implements ConfigurationSection { this.path = ""; this.fullPath = ""; this.parent = null; - this.root = (Configuration)this; + this.root = (Configuration) this; } /** @@ -65,16 +65,16 @@ public class MemorySection implements ConfigurationSection { if (root == null) { throw new IllegalArgumentException("Path cannot be orphaned"); } - + this.fullPath = createPath(parent, path); } public Set getKeys(boolean deep) { Set result = new LinkedHashSet(); - + if (getRoot().options().copyDefaults()) { ConfigurationSection defaults = getDefaultSection(); - + if (defaults != null) { result.addAll(defaults.getKeys(deep)); } @@ -87,10 +87,10 @@ public class MemorySection implements ConfigurationSection { public Map getValues(boolean deep) { Map result = new LinkedHashMap(); - + if (getRoot().options().copyDefaults()) { ConfigurationSection defaults = getDefaultSection(); - + if (defaults != null) { result.putAll(defaults.getValues(deep)); } @@ -124,7 +124,7 @@ public class MemorySection implements ConfigurationSection { public String getCurrentPath() { return fullPath; } - + public String getName() { return path; } @@ -136,32 +136,32 @@ public class MemorySection implements ConfigurationSection { public ConfigurationSection getParent() { return parent; } - + public void addDefault(String path, Object value) { if (path == null) { throw new IllegalArgumentException("Path cannot be null"); } - + if (root == null) { throw new IllegalStateException("Cannot set default on orphaned section"); } else { root.addDefault(createPath(this, path), value); } } - + public ConfigurationSection getDefaultSection() { if (getRoot() == null) { return null; } - + Configuration defaults = getRoot().getDefaults(); - + if (defaults != null) { if (defaults.isConfigurationSection(getCurrentPath())) { return defaults.getConfigurationSection(getCurrentPath()); } } - + return null; } @@ -169,9 +169,7 @@ public class MemorySection implements ConfigurationSection { String[] split = path.split(Pattern.quote(Character.toString(getRoot().options().pathSeparator()))); ConfigurationSection section = this; - if (path == null) { - throw new IllegalArgumentException("Path cannot be null"); - } else if (path.length() == 0) { + if (path.length() == 0) { throw new IllegalArgumentException("Cannot set to an empty path"); } @@ -219,7 +217,7 @@ public class MemorySection implements ConfigurationSection { for (int i = 0; i < split.length - 1; i++) { section = section.getConfigurationSection(split[i]); - + if (section == null) { return def; } @@ -230,11 +228,8 @@ public class MemorySection implements ConfigurationSection { if (section == this) { result = map.get(key); return (result == null) ? def : result; - } else if (section != null) { - return section.get(key, def); - } else { - return def; } + return section.get(key, def); } public ConfigurationSection createSection(String path) { @@ -267,13 +262,14 @@ public class MemorySection implements ConfigurationSection { return section.createSection(key); } } - + + @SuppressWarnings("unchecked") public ConfigurationSection createSection(String path, Map map) { ConfigurationSection section = createSection(path); - for(Map.Entry entry : map.entrySet()) { - if(entry.getValue() instanceof Map) { - section.createSection(entry.getKey(), (Map)entry.getValue()); + for (Map.Entry entry : map.entrySet()) { + if (entry.getValue() instanceof Map) { + section.createSection(entry.getKey(), (Map) entry.getValue()); } else { section.set(entry.getKey(), entry.getValue()); } @@ -343,7 +339,7 @@ public class MemorySection implements ConfigurationSection { } Object def = getDefault(path); - return getBoolean(path, (def instanceof Boolean) ? (Boolean)def : false); + return getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false); } public boolean getBoolean(String path, boolean def) { @@ -352,7 +348,7 @@ public class MemorySection implements ConfigurationSection { } Object val = get(path, def); - return (val instanceof Boolean) ? (Boolean)val : def; + return (val instanceof Boolean) ? (Boolean) val : def; } public boolean isBoolean(String path) { @@ -418,23 +414,25 @@ public class MemorySection implements ConfigurationSection { return val instanceof Long; } -// Java - public List getList(String path) { + // Java + @SuppressWarnings("unchecked") + public List getList(String path) { if (path == null) { throw new IllegalArgumentException("Path cannot be null"); } Object def = getDefault(path); - return getList(path, (def instanceof List) ? (List)def : null); + return getList(path, (def instanceof List) ? (List) def : null); } - public List getList(String path, List def) { + @SuppressWarnings("unchecked") + public List getList(String path, List def) { if (path == null) { throw new IllegalArgumentException("Path cannot be null"); } Object val = get(path, def); - return (val instanceof List) ? (List)val : def; + return (List) ((val instanceof List) ? val : def); } public boolean isList(String path) { @@ -452,19 +450,19 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if ((object instanceof String) || (isPrimitiveWrapper(object))) { result.add(String.valueOf(object)); } } - + return result; } @@ -474,37 +472,38 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Integer) { - result.add((Integer)object); + result.add((Integer) object); } else if (object instanceof String) { try { - result.add(Integer.valueOf((String)object)); - } catch (Exception ex) {} + result.add(Integer.valueOf((String) object)); + } catch (Exception ex) { + } } else if (object instanceof Byte) { - result.add((Integer)(int)(byte)(Byte)object); + result.add((Integer) (int) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Integer)(int)(char)(Character)object); + result.add((Integer) (int) (char) (Character) object); } else if (object instanceof Short) { - result.add((Integer)(int)(short)(Short)object); + result.add((Integer) (int) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Integer)(int)(int)(Integer)object); + result.add((Integer) (int) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Integer)(int)(long)(Long)object); + result.add((Integer) (int) (long) (Long) object); } else if (object instanceof Float) { - result.add((Integer)(int)(float)(Float)object); + result.add((Integer) (int) (float) (Float) object); } else if (object instanceof Double) { - result.add((Integer)(int)(double)(Double)object); + result.add((Integer) (int) (double) (Double) object); } } - + return result; } @@ -514,16 +513,16 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Boolean) { - result.add((Boolean)object); + result.add((Boolean) object); } else if (object instanceof String) { if (Boolean.TRUE.toString().equals(object)) { result.add(true); @@ -532,7 +531,7 @@ public class MemorySection implements ConfigurationSection { } } } - + return result; } @@ -542,37 +541,38 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Double) { - result.add((Double)object); + result.add((Double) object); } else if (object instanceof String) { try { - result.add(Double.valueOf((String)object)); - } catch (Exception ex) {} + result.add(Double.valueOf((String) object)); + } catch (Exception ex) { + } } else if (object instanceof Byte) { - result.add((Double)(double)(byte)(Byte)object); + result.add((Double) (double) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Double)(double)(char)(Character)object); + result.add((Double) (double) (char) (Character) object); } else if (object instanceof Short) { - result.add((Double)(double)(short)(Short)object); + result.add((Double) (double) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Double)(double)(int)(Integer)object); + result.add((Double) (double) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Double)(double)(long)(Long)object); + result.add((Double) (double) (long) (Long) object); } else if (object instanceof Float) { - result.add((Double)(double)(float)(Float)object); + result.add((Double) (double) (float) (Float) object); } else if (object instanceof Double) { - result.add((Double)(double)(double)(Double)object); + result.add((Double) (double) (double) (Double) object); } } - + return result; } @@ -582,37 +582,38 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Float) { - result.add((Float)object); + result.add((Float) object); } else if (object instanceof String) { try { - result.add(Float.valueOf((String)object)); - } catch (Exception ex) {} + result.add(Float.valueOf((String) object)); + } catch (Exception ex) { + } } else if (object instanceof Byte) { - result.add((Float)(float)(byte)(Byte)object); + result.add((Float) (float) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Float)(float)(char)(Character)object); + result.add((Float) (float) (char) (Character) object); } else if (object instanceof Short) { - result.add((Float)(float)(short)(Short)object); + result.add((Float) (float) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Float)(float)(int)(Integer)object); + result.add((Float) (float) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Float)(float)(long)(Long)object); + result.add((Float) (float) (long) (Long) object); } else if (object instanceof Float) { - result.add((Float)(float)(float)(Float)object); + result.add((Float) (float) (float) (Float) object); } else if (object instanceof Double) { - result.add((Float)(float)(double)(Double)object); + result.add((Float) (float) (double) (Double) object); } } - + return result; } @@ -622,37 +623,38 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Long) { - result.add((Long)object); + result.add((Long) object); } else if (object instanceof String) { try { - result.add(Long.valueOf((String)object)); - } catch (Exception ex) {} + result.add(Long.valueOf((String) object)); + } catch (Exception ex) { + } } else if (object instanceof Byte) { - result.add((Long)(long)(byte)(Byte)object); + result.add((Long) (long) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Long)(long)(char)(Character)object); + result.add((Long) (long) (char) (Character) object); } else if (object instanceof Short) { - result.add((Long)(long)(short)(Short)object); + result.add((Long) (long) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Long)(long)(int)(Integer)object); + result.add((Long) (long) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Long)(long)(long)(Long)object); + result.add((Long) (long) (long) (Long) object); } else if (object instanceof Float) { - result.add((Long)(long)(float)(Float)object); + result.add((Long) (long) (float) (Float) object); } else if (object instanceof Double) { - result.add((Long)(long)(double)(Double)object); + result.add((Long) (long) (double) (Double) object); } } - + return result; } @@ -662,37 +664,38 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Byte) { - result.add((Byte)object); + result.add((Byte) object); } else if (object instanceof String) { try { - result.add(Byte.valueOf((String)object)); - } catch (Exception ex) {} + result.add(Byte.valueOf((String) object)); + } catch (Exception ex) { + } } else if (object instanceof Byte) { - result.add((Byte)(byte)(byte)(Byte)object); + result.add((Byte) (byte) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Byte)(byte)(char)(Character)object); + result.add((Byte) (byte) (char) (Character) object); } else if (object instanceof Short) { - result.add((Byte)(byte)(short)(Short)object); + result.add((Byte) (byte) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Byte)(byte)(int)(Integer)object); + result.add((Byte) (byte) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Byte)(byte)(long)(Long)object); + result.add((Byte) (byte) (long) (Long) object); } else if (object instanceof Float) { - result.add((Byte)(byte)(float)(Float)object); + result.add((Byte) (byte) (float) (Float) object); } else if (object instanceof Double) { - result.add((Byte)(byte)(double)(Double)object); + result.add((Byte) (byte) (double) (Double) object); } } - + return result; } @@ -702,39 +705,39 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Character) { - result.add((Character)object); + result.add((Character) object); } else if (object instanceof String) { - String str = (String)object; - + String str = (String) object; + if (str.length() == 1) { result.add(str.charAt(0)); } } else if (object instanceof Byte) { - result.add((Character)(char)(byte)(Byte)object); + result.add((Character) (char) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Character)(char)(char)(Character)object); + result.add((Character) (char) (char) (Character) object); } else if (object instanceof Short) { - result.add((Character)(char)(short)(Short)object); + result.add((Character) (char) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Character)(char)(int)(Integer)object); + result.add((Character) (char) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Character)(char)(long)(Long)object); + result.add((Character) (char) (long) (Long) object); } else if (object instanceof Float) { - result.add((Character)(char)(float)(Float)object); + result.add((Character) (char) (float) (Float) object); } else if (object instanceof Double) { - result.add((Character)(char)(double)(Double)object); + result.add((Character) (char) (double) (Double) object); } } - + return result; } @@ -744,65 +747,67 @@ public class MemorySection implements ConfigurationSection { } List list = getList(path); - + if (list == null) { return null; } - - List result = new ArrayList(); - + + List result = new ArrayList(); + for (Object object : list) { if (object instanceof Short) { - result.add((Short)object); + result.add((Short) object); } else if (object instanceof String) { try { - result.add(Short.valueOf((String)object)); - } catch (Exception ex) {} + result.add(Short.valueOf((String) object)); + } catch (Exception ex) { + } } else if (object instanceof Byte) { - result.add((Short)(short)(byte)(Byte)object); + result.add((Short) (short) (byte) (Byte) object); } else if (object instanceof Character) { - result.add((Short)(short)(char)(Character)object); + result.add((Short) (short) (char) (Character) object); } else if (object instanceof Short) { - result.add((Short)(short)(short)(Short)object); + result.add((Short) (short) (short) (Short) object); } else if (object instanceof Integer) { - result.add((Short)(short)(int)(Integer)object); + result.add((Short) (short) (int) (Integer) object); } else if (object instanceof Long) { - result.add((Short)(short)(long)(Long)object); + result.add((Short) (short) (long) (Long) object); } else if (object instanceof Float) { - result.add((Short)(short)(float)(Float)object); + result.add((Short) (short) (float) (Float) object); } else if (object instanceof Double) { - result.add((Short)(short)(double)(Double)object); + result.add((Short) (short) (double) (Double) object); } } - + return result; } + @SuppressWarnings("unchecked") public List> getMapList(String path) { if (path == null) { throw new IllegalArgumentException("Path cannot be null"); } List list = getList(path); - List> result = new ArrayList(); - + List> result = new ArrayList>(); + for (Object object : list) { if (object instanceof Map) { - result.add((Map)object); + result.add((Map) object); } } - + return result; } -// Bukkit + // Bukkit public Vector getVector(String path) { if (path == null) { throw new IllegalArgumentException("Path cannot be null"); } Object def = getDefault(path); - return getVector(path, (def instanceof Vector) ? (Vector)def : null); + return getVector(path, (def instanceof Vector) ? (Vector) def : null); } public Vector getVector(String path, Vector def) { @@ -811,7 +816,7 @@ public class MemorySection implements ConfigurationSection { } Object val = get(path, def); - return (val instanceof Vector) ? (Vector)val : def; + return (val instanceof Vector) ? (Vector) val : def; } public boolean isVector(String path) { @@ -829,7 +834,7 @@ public class MemorySection implements ConfigurationSection { } Object def = getDefault(path); - return getOfflinePlayer(path, (def instanceof OfflinePlayer) ? (OfflinePlayer)def : null); + return getOfflinePlayer(path, (def instanceof OfflinePlayer) ? (OfflinePlayer) def : null); } public OfflinePlayer getOfflinePlayer(String path, OfflinePlayer def) { @@ -838,7 +843,7 @@ public class MemorySection implements ConfigurationSection { } Object val = get(path, def); - return (val instanceof OfflinePlayer) ? (OfflinePlayer)val : def; + return (val instanceof OfflinePlayer) ? (OfflinePlayer) val : def; } public boolean isOfflinePlayer(String path) { @@ -856,7 +861,7 @@ public class MemorySection implements ConfigurationSection { } Object def = getDefault(path); - return getItemStack(path, (def instanceof ItemStack) ? (ItemStack)def : null); + return getItemStack(path, (def instanceof ItemStack) ? (ItemStack) def : null); } public ItemStack getItemStack(String path, ItemStack def) { @@ -865,7 +870,7 @@ public class MemorySection implements ConfigurationSection { } Object val = get(path, def); - return (val instanceof ItemStack) ? (ItemStack)val : def; + return (val instanceof ItemStack) ? (ItemStack) val : def; } public boolean isItemStack(String path) { @@ -881,11 +886,12 @@ public class MemorySection implements ConfigurationSection { if (path == null) { throw new IllegalArgumentException("Path cannot be null"); } - + Object val = get(path, null); - if (val != null) - return (val instanceof ConfigurationSection) ? (ConfigurationSection)val : null; - + if (val != null) { + return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null; + } + val = get(path, getDefault(path)); return (val instanceof ConfigurationSection) ? createSection(path) : null; } @@ -903,7 +909,7 @@ public class MemorySection implements ConfigurationSection { if (input == null) { throw new IllegalArgumentException("Cannot store null"); } - + if (isPrimitiveWrapper(input) || isNaturallyStorable(input)) { return input; } else if (input instanceof ConfigurationSerializable) { @@ -912,14 +918,14 @@ public class MemorySection implements ConfigurationSection { throw new IllegalArgumentException("Cannot store " + input + " into " + this + ", unsupported class"); } - + protected boolean isPrimitiveWrapper(Object input) { return input instanceof Integer || input instanceof Boolean || input instanceof Character || input instanceof Byte || input instanceof Short || input instanceof Double || input instanceof Long || input instanceof Float; } - + protected boolean isNaturallyStorable(Object input) { return input instanceof List || input instanceof Iterable || input instanceof String || input instanceof File || @@ -937,13 +943,13 @@ public class MemorySection implements ConfigurationSection { protected void mapChildrenKeys(Set output, ConfigurationSection section, boolean deep) { if (section instanceof MemorySection) { - MemorySection sec = (MemorySection)section; + MemorySection sec = (MemorySection) section; for (Map.Entry entry : sec.map.entrySet()) { output.add(createPath(section, entry.getKey(), this)); if ((deep) && (entry.getValue() instanceof ConfigurationSection)) { - ConfigurationSection subsection = (ConfigurationSection)entry.getValue(); + ConfigurationSection subsection = (ConfigurationSection) entry.getValue(); mapChildrenKeys(output, subsection, deep); } } @@ -958,14 +964,14 @@ public class MemorySection implements ConfigurationSection { protected void mapChildrenValues(Map output, ConfigurationSection section, boolean deep) { if (section instanceof MemorySection) { - MemorySection sec = (MemorySection)section; + MemorySection sec = (MemorySection) section; for (Map.Entry entry : sec.map.entrySet()) { output.put(createPath(section, entry.getKey(), this), entry.getValue()); - + if (entry.getValue() instanceof ConfigurationSection) { if (deep) { - mapChildrenValues(output, (ConfigurationSection)entry.getValue(), deep); + mapChildrenValues(output, (ConfigurationSection) entry.getValue(), deep); } } } @@ -982,7 +988,7 @@ public class MemorySection implements ConfigurationSection { * Creates a full path to the given {@link ConfigurationSection} from its root {@link Configuration}. *

* You may use this method for any given {@link ConfigurationSection}, not only {@link MemorySection}. - * + * * @param section Section to create a path for. * @param key Name of the specified section. * @return Full path of the section from its root. @@ -991,12 +997,11 @@ public class MemorySection implements ConfigurationSection { return createPath(section, key, (section == null) ? null : section.getRoot()); } - /** * Creates a relative path to the given {@link ConfigurationSection} from the given relative section. *

* You may use this method for any given {@link ConfigurationSection}, not only {@link MemorySection}. - * + * * @param section Section to create a path for. * @param key Name of the specified section. * @param relativeTo Section to create the path relative to. @@ -1022,21 +1027,21 @@ public class MemorySection implements ConfigurationSection { builder.append(key); } - + return builder.toString(); } @Override public String toString() { StringBuilder builder = new StringBuilder(); - + builder.append(getClass().getSimpleName()); builder.append("[path='"); builder.append(getCurrentPath()); builder.append("', root='"); builder.append(root.getClass().getSimpleName()); builder.append("']"); - + return builder.toString(); } } diff --git a/src/main/java/org/bukkit/configuration/file/FileConfiguration.java b/src/main/java/org/bukkit/configuration/file/FileConfiguration.java index 409e3921..4c192639 100644 --- a/src/main/java/org/bukkit/configuration/file/FileConfiguration.java +++ b/src/main/java/org/bukkit/configuration/file/FileConfiguration.java @@ -48,7 +48,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { if (file == null) { throw new IllegalArgumentException("File cannot be null"); } - + Files.createParentDirs(file); String data = saveToString(); @@ -76,7 +76,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { if (file == null) { throw new IllegalArgumentException("File cannot be null"); } - + save(new File(file)); } @@ -108,7 +108,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { load(new FileInputStream(file)); } - + /** * Loads this {@link FileConfiguration} from the specified stream. *

@@ -124,7 +124,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { if (stream == null) { throw new IllegalArgumentException("Stream cannot be null"); } - + InputStreamReader reader = new InputStreamReader(stream); StringBuilder builder = new StringBuilder(); BufferedReader input = new BufferedReader(reader); @@ -178,13 +178,13 @@ public abstract class FileConfiguration extends MemoryConfiguration { * @throws IllegalArgumentException Thrown if contents is null. */ public abstract void loadFromString(String contents) throws InvalidConfigurationException; - + /** * Compiles the header for this {@link FileConfiguration} and returns the result. *

* This will use the header from {@link #options()} -> {@link FileConfigurationOptions#header()}, * respecting the rules of {@link FileConfigurationOptions#copyHeader()} if set. - * + * * @return Compiled header */ protected abstract String buildHeader(); @@ -194,7 +194,7 @@ public abstract class FileConfiguration extends MemoryConfiguration { if (options == null) { options = new FileConfigurationOptions(this); } - - return (FileConfigurationOptions)options; + + return (FileConfigurationOptions) options; } } \ No newline at end of file diff --git a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java index 1da24047..e99c4cfa 100644 --- a/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/file/FileConfigurationOptions.java @@ -8,14 +8,14 @@ import org.bukkit.configuration.*; public class FileConfigurationOptions extends MemoryConfigurationOptions { private String header = null; private boolean copyHeader = true; - + protected FileConfigurationOptions(MemoryConfiguration configuration) { super(configuration); } @Override public FileConfiguration configuration() { - return (FileConfiguration)super.configuration(); + return (FileConfiguration) super.configuration(); } @Override @@ -29,7 +29,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { super.pathSeparator(value); return this; } - + /** * Gets the header that will be applied to the top of the saved output. *

@@ -40,13 +40,13 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { *

* Null is a valid value which will indicate that no header is to be applied. * The default value is null. - * + * * @return Header */ public String header() { return header; } - + /** * Sets the header that will be applied to the top of the saved output. *

@@ -56,8 +56,8 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * but you may include one if you wish for extra spacing. *

* Null is a valid value which will indicate that no header is to be applied. - * The default value is null. * + * * @param value New header * @return This object, for chaining */ @@ -65,7 +65,7 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { this.header = value; return this; } - + /** * Gets whether or not the header should be copied from a default source. *

@@ -78,13 +78,13 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * specified in this configuration will be used. *

* Defaults to true. - * + * * @return Whether or not to copy the header */ public boolean copyHeader() { return copyHeader; } - + /** * Sets whether or not the header should be copied from a default source. *

@@ -97,13 +97,13 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions { * specified in this configuration will be used. *

* Defaults to true. - * + * * @param value Whether or not to copy the header * @return This object, for chaining */ public FileConfigurationOptions copyHeader(boolean value) { copyHeader = value; - + return this; } } diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java index aaf8ce7f..237018e3 100644 --- a/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java +++ b/src/main/java/org/bukkit/configuration/file/YamlConfiguration.java @@ -4,14 +4,14 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; import java.util.logging.Level; + import org.bukkit.Bukkit; -import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.Configuration; import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.bukkit.configuration.serialization.ConfigurationSerialization; import org.yaml.snakeyaml.DumperOptions; @@ -33,20 +33,20 @@ public class YamlConfiguration extends FileConfiguration { @Override public String saveToString() { Map output = new LinkedHashMap(); - + yamlOptions.setIndent(options().indent()); yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - + serializeValues(output, getValues(false)); - + String header = buildHeader(); String dump = yaml.dump(output); - + if (dump.equals(BLANK_CONFIG)) { dump = ""; } - + return header + dump; } @@ -55,45 +55,47 @@ public class YamlConfiguration extends FileConfiguration { if (contents == null) { throw new IllegalArgumentException("Contents cannot be null"); } - - Map input = (Map)yaml.load(contents); + + @SuppressWarnings("unchecked") + Map input = (Map) yaml.load(contents); int size = (input == null) ? 0 : input.size(); Map result = new LinkedHashMap(size); - + if (size > 0) { for (Map.Entry entry : input.entrySet()) { result.put(entry.getKey().toString(), entry.getValue()); } } - + String header = parseHeader(contents); - + if (header.length() > 0) { options().header(header); } - + deserializeValues(result, this); } - + protected void deserializeValues(Map input, ConfigurationSection section) throws InvalidConfigurationException { if (input == null) { return; } - + for (Map.Entry entry : input.entrySet()) { Object value = entry.getValue(); - + if (value instanceof Map) { - Map subinput = (Map)value; + @SuppressWarnings("unchecked") + Map subinput = (Map) value; int size = (subinput == null) ? 0 : subinput.size(); Map subvalues = new LinkedHashMap(size); - + if (size > 0) { for (Map.Entry subentry : subinput.entrySet()) { subvalues.put(subentry.getKey().toString(), subentry.getValue()); } } - + if (subvalues.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) { try { ConfigurationSerializable serializable = ConfigurationSerialization.deserializeObject(subvalues); @@ -110,51 +112,51 @@ public class YamlConfiguration extends FileConfiguration { } } } - + protected void serializeValues(Map output, Map input) { if (input == null) { return; } - + for (Map.Entry entry : input.entrySet()) { Object value = entry.getValue(); - + if (value instanceof ConfigurationSection) { - ConfigurationSection subsection = (ConfigurationSection)entry.getValue(); + ConfigurationSection subsection = (ConfigurationSection) entry.getValue(); Map subvalues = new LinkedHashMap(); - + serializeValues(subvalues, subsection.getValues(false)); value = subvalues; } else if (value instanceof ConfigurationSerializable) { - ConfigurationSerializable serializable = (ConfigurationSerializable)value; + ConfigurationSerializable serializable = (ConfigurationSerializable) value; Map subvalues = new LinkedHashMap(); subvalues.put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(serializable.getClass())); - + serializeValues(subvalues, serializable.serialize()); value = subvalues; } else if ((!isPrimitiveWrapper(value)) && (!isNaturallyStorable(value))) { throw new IllegalStateException("Configuration contains non-serializable values, cannot process"); } - + if (value != null) { output.put(entry.getKey(), value); } } } - + protected String parseHeader(String input) { String[] lines = input.split("\r?\n", -1); StringBuilder result = new StringBuilder(); boolean readingHeader = true; - + for (int i = 0; (i < lines.length) && (readingHeader); i++) { String line = lines[i]; - + if (line.startsWith(COMMENT_PREFIX)) { if (i > 0) { result.append("\n"); } - + if (line.length() > COMMENT_PREFIX.length()) { result.append(line.substring(COMMENT_PREFIX.length())); } @@ -164,44 +166,45 @@ public class YamlConfiguration extends FileConfiguration { readingHeader = false; } } - + return result.toString(); } - + + @Override protected String buildHeader() { String header = options().header(); - + if (options().copyHeader()) { Configuration def = getDefaults(); - + if ((def != null) && (def instanceof FileConfiguration)) { - FileConfiguration filedefaults = (FileConfiguration)def; + FileConfiguration filedefaults = (FileConfiguration) def; String defaultsHeader = filedefaults.buildHeader(); - + if ((defaultsHeader != null) && (defaultsHeader.length() > 0)) { return defaultsHeader; } } } - + if (header == null) { return ""; } - + StringBuilder builder = new StringBuilder(); String[] lines = header.split("\r?\n", -1); boolean startedHeader = false; - + for (int i = lines.length - 1; i >= 0; i--) { builder.insert(0, "\n"); - + if ((startedHeader) || (lines[i].length() != 0)) { builder.insert(0, lines[i]); builder.insert(0, COMMENT_PREFIX); startedHeader = true; } } - + return builder.toString(); } @@ -210,16 +213,16 @@ public class YamlConfiguration extends FileConfiguration { if (options == null) { options = new YamlConfigurationOptions(this); } - - return (YamlConfigurationOptions)options; + + return (YamlConfigurationOptions) options; } - + /** * Creates a new {@link YamlConfiguration}, loading from the given file. *

* Any errors loading the Configuration will be logged and then ignored. * If the specified input is not a valid config, a blank config will be returned. - * + * * @param file Input file * @return Resulting configuration * @throws IllegalArgumentException Thrown is file is null @@ -228,9 +231,9 @@ public class YamlConfiguration extends FileConfiguration { if (file == null) { throw new IllegalArgumentException("File cannot be null"); } - + YamlConfiguration config = new YamlConfiguration(); - + try { config.load(file); } catch (FileNotFoundException ex) { @@ -245,16 +248,16 @@ public class YamlConfiguration extends FileConfiguration { Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file + ": " + ex.getCause().getClass(), ex); } } - + return config; } - + /** * Creates a new {@link YamlConfiguration}, loading from the given stream. *

* Any errors loading the Configuration will be logged and then ignored. * If the specified input is not a valid config, a blank config will be returned. - * + * * @param stream Input stream * @return Resulting configuration * @throws IllegalArgumentException Thrown is stream is null @@ -263,9 +266,9 @@ public class YamlConfiguration extends FileConfiguration { if (stream == null) { throw new IllegalArgumentException("Stream cannot be null"); } - + YamlConfiguration config = new YamlConfiguration(); - + try { config.load(stream); } catch (IOException ex) { @@ -279,7 +282,7 @@ public class YamlConfiguration extends FileConfiguration { Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration: " + ex.getCause().getClass(), ex); } } - + return config; } } diff --git a/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java b/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java index 25fd6266..46e4d6f9 100644 --- a/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java +++ b/src/main/java/org/bukkit/configuration/file/YamlConfigurationOptions.java @@ -5,14 +5,14 @@ package org.bukkit.configuration.file; */ public class YamlConfigurationOptions extends FileConfigurationOptions { private int indent = 2; - + protected YamlConfigurationOptions(YamlConfiguration configuration) { super(configuration); } @Override public YamlConfiguration configuration() { - return (YamlConfiguration)super.configuration(); + return (YamlConfiguration) super.configuration(); } @Override @@ -38,23 +38,23 @@ public class YamlConfigurationOptions extends FileConfigurationOptions { super.copyHeader(value); return this; } - + /** * Gets how much spaces should be used to indent each line. *

* The minimum value this may be is 2, and the maximum is 9. - * + * * @return How much to indent by */ public int indent() { return indent; } - + /** * Sets how much spaces should be used to indent each line. *

* The minimum value this may be is 2, and the maximum is 9. - * + * * @param value New indent * @return This object, for chaining */ @@ -62,7 +62,7 @@ public class YamlConfigurationOptions extends FileConfigurationOptions { if ((indent < 2) || (value > 9)) { throw new IllegalArgumentException("Indent must be between 1 and 10 characters"); } - + this.indent = value; return this; } diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java index 6e2af873..53b4fb2f 100644 --- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java +++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerializable.java @@ -7,9 +7,11 @@ import java.util.Map; *

* These objects MUST implement one of the following, in addition to the methods * as defined by this interface: - * - A static method "deserialize" that accepts a single {@link Map} and returns the class. - * - A static method "valueOf" that accepts a single {@link Map} and returns the class. - * - A constructor that accepts a single {@link Map}. + *

    + *
  • A static method "deserialize" that accepts a single {@link Map} and returns the class.
  • + *
  • A static method "valueOf" that accepts a single {@link Map} and returns the class.
  • + *
  • A constructor that accepts a single {@link Map}.
  • + *
*/ public interface ConfigurationSerializable { /** @@ -17,7 +19,7 @@ public interface ConfigurationSerializable { *

* This class must provide a method to restore this class, as defined in the * {@link ConfigurationSerializable} interface javadocs. - * + * * @return Map containing the current state of this class */ public Map serialize(); diff --git a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java index ce594136..8bf50b95 100644 --- a/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java +++ b/src/main/java/org/bukkit/configuration/serialization/ConfigurationSerialization.java @@ -17,27 +17,27 @@ public class ConfigurationSerialization { public static final String SERIALIZED_TYPE_KEY = "=="; private final Class clazz; private static Map> aliases = new HashMap>(); - + static { registerClass(Vector.class); registerClass(BlockVector.class); } - + protected ConfigurationSerialization(Class clazz) { this.clazz = clazz; } - + protected Method getMethod(String name, boolean isStatic) { try { Method method = clazz.getDeclaredMethod(name, Map.class); - + if (!ConfigurationSerializable.class.isAssignableFrom(method.getReturnType())) { return null; } if (Modifier.isStatic(method.getModifiers()) != isStatic) { return null; } - + return method; } catch (NoSuchMethodException ex) { return null; @@ -45,7 +45,7 @@ public class ConfigurationSerialization { return null; } } - + protected Constructor getConstructor() { try { return clazz.getConstructor(Map.class); @@ -55,11 +55,11 @@ public class ConfigurationSerialization { return null; } } - + protected ConfigurationSerializable deserializeViaMethod(Method method, Map args) { try { - ConfigurationSerializable result = (ConfigurationSerializable)method.invoke(null, args); - + ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args); + if (result == null) { Logger.getLogger(ConfigurationSerialization.class.getName()).log(Level.SEVERE, "Could not call method '" + method.toString() + "' of " + clazz + " for deserialization: method returned null"); } else { @@ -68,55 +68,55 @@ public class ConfigurationSerialization { } catch (Throwable ex) { Logger.getLogger(ConfigurationSerialization.class.getName()).log(Level.SEVERE, "Could not call method '" + method.toString() + "' of " + clazz + " for deserialization", ex); } - + return null; } - + protected ConfigurationSerializable deserializeViaCtor(Constructor ctor, Map args) { try { return ctor.newInstance(args); } catch (Throwable ex) { Logger.getLogger(ConfigurationSerialization.class.getName()).log(Level.SEVERE, "Could not call constructor '" + ctor.toString() + "' of " + clazz + " for deserialization", ex); } - + return null; } - + public ConfigurationSerializable deserialize(Map args) { if (args == null) { throw new IllegalArgumentException("Args must not be null"); } - + ConfigurationSerializable result = null; Method method = null; - + if (result == null) { method = getMethod("deserialize", true); - + if (method != null) { result = deserializeViaMethod(method, args); } } - + if (result == null) { method = getMethod("valueOf", true); - + if (method != null) { result = deserializeViaMethod(method, args); } } - + if (result == null) { Constructor constructor = getConstructor(); - + if (constructor != null) { result = deserializeViaCtor(constructor, args); } } - + return result; } - + /** * Attempts to deserialize the given arguments into a new instance of the given class. *

@@ -125,7 +125,7 @@ public class ConfigurationSerialization { *

* If a new instance could not be made, an example being the class not fully implementing * the interface, null will be returned. - * + * * @param args Arguments for deserialization * @param clazz Class to deserialize into * @return New instance of the specified class @@ -133,7 +133,7 @@ public class ConfigurationSerialization { public static ConfigurationSerializable deserializeObject(Map args, Class clazz) { return new ConfigurationSerialization(clazz).deserialize(args); } - + /** * Attempts to deserialize the given arguments into a new instance of the given class. *

@@ -142,17 +142,17 @@ public class ConfigurationSerialization { *

* If a new instance could not be made, an example being the class not fully implementing * the interface, null will be returned. - * + * * @param args Arguments for deserialization * @return New instance of the specified class */ public static ConfigurationSerializable deserializeObject(Map args) { Class clazz = null; - + if (args.containsKey(SERIALIZED_TYPE_KEY)) { try { - String alias = (String)args.get(SERIALIZED_TYPE_KEY); - + String alias = (String) args.get(SERIALIZED_TYPE_KEY); + if (alias == null) { throw new IllegalArgumentException("Specified class does not exist ('" + alias + ")'"); } else { @@ -165,71 +165,73 @@ public class ConfigurationSerialization { } else { throw new IllegalArgumentException("Args doesn't contain type key ('" + SERIALIZED_TYPE_KEY + "')"); } - + return new ConfigurationSerialization(clazz).deserialize(args); } - + /** * Registers the given {@link ConfigurationSerializable} class by its alias - * + * * @param clazz Class to register */ public static void registerClass(Class clazz) { DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); - - if (delegate == null ) { + + if (delegate == null) { registerClass(clazz, getAlias(clazz)); registerClass(clazz, clazz.getName()); } } - + /** * Registers the given alias to the specified {@link ConfigurationSerializable} class - * + * * @param clazz Class to register * @param alias Alias to register as */ public static void registerClass(Class clazz, String alias) { aliases.put(alias, clazz); } - + /** * Unregisters the specified alias to a {@link ConfigurationSerializable} - * + * * @param alias Alias to unregister */ public static void unregisterClass(String alias) { aliases.remove(alias); } - + /** * Unregisters any aliases for the specified {@link ConfigurationSerializable} class - * + * * @param clazz Class to unregister */ public static void unregisterClass(Class clazz) { - while (aliases.values().remove(clazz)); + while (aliases.values().remove(clazz)) { + ; + } } - + /** * Attempts to get a registered {@link ConfigurationSerializable} class by its alias - * + * * @param alias Alias of the serializable * @return Registered class, or null if not found */ public static Class getClassByAlias(String alias) { return aliases.get(alias); } - + /** * Gets the correct alias for the given {@link ConfigurationSerializable} class - * + * * @param clazz Class to get alias for * @return Alias to use for the class */ public static String getAlias(Class clazz) { DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); - + if (delegate != null) { if ((delegate.value() == null) || (delegate.value() == clazz)) { delegate = null; @@ -237,7 +239,7 @@ public class ConfigurationSerialization { return getAlias(delegate.value()); } } - + if (delegate == null) { SerializableAs alias = clazz.getAnnotation(SerializableAs.class); @@ -245,7 +247,7 @@ public class ConfigurationSerialization { return alias.value(); } } - + return clazz.getName(); } } \ No newline at end of file diff --git a/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java b/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java index 9e38f1a0..81a8852a 100644 --- a/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java +++ b/src/main/java/org/bukkit/configuration/serialization/DelegateDeserialization.java @@ -14,7 +14,7 @@ import java.lang.annotation.Target; public @interface DelegateDeserialization { /** * Which class should be used as a delegate for this classes deserialization - * + * * @return Delegate class */ public Class value(); diff --git a/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java b/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java index adfc0aac..361c6092 100644 --- a/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java +++ b/src/main/java/org/bukkit/configuration/serialization/SerializableAs.java @@ -21,7 +21,7 @@ public @interface SerializableAs { *

* This name MUST be unique. We recommend using names such as "MyPluginThing" instead of * "Thing". - * + * * @return Name to serialize the class as. */ public String value(); diff --git a/src/main/java/org/bukkit/entity/Animals.java b/src/main/java/org/bukkit/entity/Animals.java index f23db9bc..960c441f 100644 --- a/src/main/java/org/bukkit/entity/Animals.java +++ b/src/main/java/org/bukkit/entity/Animals.java @@ -7,7 +7,7 @@ package org.bukkit.entity; public interface Animals extends Creature { /** * Gets the age of this animal. - * + * * @return Age */ public int getAge(); diff --git a/src/main/java/org/bukkit/entity/Blaze.java b/src/main/java/org/bukkit/entity/Blaze.java index 0033acd0..7a5505b7 100644 --- a/src/main/java/org/bukkit/entity/Blaze.java +++ b/src/main/java/org/bukkit/entity/Blaze.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a Blaze monster */ public interface Blaze extends Monster { - + } diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java index bbd772fe..c4f98400 100644 --- a/src/main/java/org/bukkit/entity/Boat.java +++ b/src/main/java/org/bukkit/entity/Boat.java @@ -18,11 +18,11 @@ public interface Boat extends Vehicle { * @param speed The max speed. */ public void setMaxSpeed(double speed); - + /** * Gets the deceleration rate (newSpeed = curSpeed * rate) of occupied * boats. The default is 0.2. - * + * * @return */ public double getOccupiedDeceleration(); @@ -31,7 +31,7 @@ public interface Boat extends Vehicle { * Sets the deceleration rate (newSpeed = curSpeed * rate) of occupied * boats. Setting this to a higher value allows for quicker acceleration. * The default is 0.2. - * + * * @param speed deceleration rate */ public void setOccupiedDeceleration(double rate); @@ -40,7 +40,7 @@ public interface Boat extends Vehicle { * Gets the deceleration rate (newSpeed = curSpeed * rate) of unoccupied * boats. The default is -1. Values below 0 indicate that no additional * deceleration is imposed. - * + * * @return */ public double getUnoccupiedDeceleration(); @@ -50,21 +50,21 @@ public interface Boat extends Vehicle { * boats. Setting this to a higher value allows for quicker deceleration * of boats when a player disembarks. The default is -1. Values below 0 * indicate that no additional deceleration is imposed. - * + * * @param rate deceleration rate */ public void setUnoccupiedDeceleration(double rate); /** * Get whether boats can work on land. - * + * * @return whether boats can work on land */ public boolean getWorkOnLand(); /** * Set whether boats can work on land. - * + * * @param workOnLand whether boats can work on land */ public void setWorkOnLand(boolean workOnLand); diff --git a/src/main/java/org/bukkit/entity/ComplexEntityPart.java b/src/main/java/org/bukkit/entity/ComplexEntityPart.java index ced09c4b..5db43e0a 100644 --- a/src/main/java/org/bukkit/entity/ComplexEntityPart.java +++ b/src/main/java/org/bukkit/entity/ComplexEntityPart.java @@ -6,7 +6,7 @@ package org.bukkit.entity; public interface ComplexEntityPart extends Entity { /** * Gets the parent {@link ComplexLivingEntity} of this part. - * + * * @return Parent complex entity */ public ComplexLivingEntity getParent(); diff --git a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java index 6de2c561..2670d17b 100644 --- a/src/main/java/org/bukkit/entity/ComplexLivingEntity.java +++ b/src/main/java/org/bukkit/entity/ComplexLivingEntity.java @@ -8,7 +8,7 @@ import java.util.Set; public interface ComplexLivingEntity extends LivingEntity { /** * Gets a list of parts that belong to this complex entity - * + * * @return List of parts */ public Set getParts(); diff --git a/src/main/java/org/bukkit/entity/CreatureType.java b/src/main/java/org/bukkit/entity/CreatureType.java index 40c037da..2f1ab5a5 100644 --- a/src/main/java/org/bukkit/entity/CreatureType.java +++ b/src/main/java/org/bukkit/entity/CreatureType.java @@ -50,7 +50,7 @@ public enum CreatureType { public String getName() { return name; } - + public Class getEntityClass() { return clazz; } diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java index 18e8bca6..609f3ba5 100644 --- a/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/src/main/java/org/bukkit/entity/EnderDragon.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents an Ender Dragon */ public interface EnderDragon extends ComplexLivingEntity { - + } diff --git a/src/main/java/org/bukkit/entity/EnderPearl.java b/src/main/java/org/bukkit/entity/EnderPearl.java index 77c81ec1..51e4f907 100644 --- a/src/main/java/org/bukkit/entity/EnderPearl.java +++ b/src/main/java/org/bukkit/entity/EnderPearl.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents an Ender Pearl entity */ public interface EnderPearl extends Projectile { - + } diff --git a/src/main/java/org/bukkit/entity/EnderSignal.java b/src/main/java/org/bukkit/entity/EnderSignal.java index 94a2f947..49a21ad3 100644 --- a/src/main/java/org/bukkit/entity/EnderSignal.java +++ b/src/main/java/org/bukkit/entity/EnderSignal.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents an Ender Signal, which is often created upon throwing an ender eye */ public interface EnderSignal extends Entity { - + } diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java index eca0a8a2..b47a7ddb 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -122,6 +122,7 @@ public interface Entity { /** * Returns true if this entity has been marked for removal. + * * @return True if it is dead. */ public boolean isDead(); @@ -165,49 +166,53 @@ public interface Entity { /** * Returns the distance this entity has fallen + * * @return The distance. */ public float getFallDistance(); /** * Sets the fall distance for this entity + * * @param distance The new distance. */ public void setFallDistance(float distance); /** * Record the last {@link EntityDamageEvent} inflicted on this entity + * * @param event a {@link EntityDamageEvent} */ public void setLastDamageCause(EntityDamageEvent event); /** * Retrieve the last {@link EntityDamageEvent} inflicted on this entity. This event may have been cancelled. + * * @return the last known {@link EntityDamageEvent} or null if hitherto unharmed */ public EntityDamageEvent getLastDamageCause(); /** * Returns a unique and persistent id for this entity + * * @return unique id */ public UUID getUniqueId(); - + /** * Gets the amount of ticks this entity has lived for. *

* This is the equivalent to "age" in entities. - * + * * @return Age of entity */ public int getTicksLived(); - + /** * Sets the amount of ticks this entity has lived for. *

- * This is the equivalent to "age" in entities. May not be - * less than one tick. - * + * This is the equivalent to "age" in entities. May not be less than one tick. + * * @param value Age of entity */ public void setTicksLived(int value); diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java index 4093e998..40783b89 100644 --- a/src/main/java/org/bukkit/entity/ExperienceOrb.java +++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java @@ -10,10 +10,10 @@ public interface ExperienceOrb extends Entity { * @return Amount of experience */ public int getExperience(); - + /** * Sets how much experience is contained within this orb - * + * * @param value Amount of experience */ public void setExperience(int value); diff --git a/src/main/java/org/bukkit/entity/Explosive.java b/src/main/java/org/bukkit/entity/Explosive.java index 0a737855..bc68190c 100644 --- a/src/main/java/org/bukkit/entity/Explosive.java +++ b/src/main/java/org/bukkit/entity/Explosive.java @@ -6,24 +6,28 @@ package org.bukkit.entity; public interface Explosive extends Entity { /** * Set the radius affected by this explosive's explosion + * * @param yield The explosive yield */ public void setYield(float yield); /** * Return the radius or yield of this explosive's explosion + * * @return the radius of blocks affected */ public float getYield(); /** * Set whether or not this explosive's explosion causes fire + * * @param isIncendiary Whether it should cause fire */ public void setIsIncendiary(boolean isIncendiary); /** * Return whether or not this explosive creates a fire when exploding + * * @return true if the explosive creates fire, false otherwise */ public boolean isIncendiary(); diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java index 09bcf8ff..654a7475 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -39,14 +39,6 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible { */ public void setItemInHand(ItemStack item); - /** - * Changes the item in hand to another of your 'action slots'. - * - * @param index The new index to use, only valid ones are 0-8. - * - public void selectItemInHand(int index); - */ - /** * Returns whether this player is slumbering. * diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 94504bcf..c57b84d1 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -25,10 +25,10 @@ public interface LivingEntity extends Entity { * @throws IllegalArgumentException Thrown if the health is < 0 or > max */ public void setHealth(int health); - + /** * Gets the maximum health this entity may have - * + * * @return Maximum health */ public int getMaxHealth(); @@ -86,12 +86,14 @@ public interface LivingEntity extends Entity { /** * Throws an egg from the entity. + * * @return The egg thrown. */ public Egg throwEgg(); /** * Throws a snowball from the entity. + * * @return The snowball thrown. */ public Snowball throwSnowball(); diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java index 4a748a92..554c3fdb 100644 --- a/src/main/java/org/bukkit/entity/Minecart.java +++ b/src/main/java/org/bukkit/entity/Minecart.java @@ -23,7 +23,7 @@ public interface Minecart extends Vehicle { /** * Gets the maximum speed of a minecart. The speed is unrelated to the velocity. - * + * * @return The max speed */ public double getMaxSpeed(); @@ -69,6 +69,7 @@ public interface Minecart extends Vehicle { * Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails. * * A derailed minecart's velocity is multiplied by this factor each tick. + * * @return derailed visible speed */ public Vector getDerailedVelocityMod(); diff --git a/src/main/java/org/bukkit/entity/MushroomCow.java b/src/main/java/org/bukkit/entity/MushroomCow.java index 56439497..84154de1 100644 --- a/src/main/java/org/bukkit/entity/MushroomCow.java +++ b/src/main/java/org/bukkit/entity/MushroomCow.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a mushroom {@link Cow} */ public interface MushroomCow extends Cow { - + } diff --git a/src/main/java/org/bukkit/entity/NPC.java b/src/main/java/org/bukkit/entity/NPC.java index 2c651a5b..0c6b175b 100644 --- a/src/main/java/org/bukkit/entity/NPC.java +++ b/src/main/java/org/bukkit/entity/NPC.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a non-player character */ public interface NPC extends Creature { - + } diff --git a/src/main/java/org/bukkit/entity/Painting.java b/src/main/java/org/bukkit/entity/Painting.java index 94e0e36e..a6473ea6 100644 --- a/src/main/java/org/bukkit/entity/Painting.java +++ b/src/main/java/org/bukkit/entity/Painting.java @@ -10,12 +10,14 @@ import org.bukkit.material.Attachable; public interface Painting extends Entity, Attachable { /** * Get the art on this painting + * * @return The art */ public Art getArt(); /** * Set the art on this painting + * * @param art The new art * @return False if the new art won't fit at the painting's current location */ @@ -23,10 +25,11 @@ public interface Painting extends Entity, Attachable { /** * Set the art on this painting + * * @param art The new art * @param force If true, force the new art regardless of whether it fits at the current location - * Note that forcing it where it can't fit normally causes it to drop as an item unless you override - * this by catching the PAINTING_BREAK event. + * Note that forcing it where it can't fit normally causes it to drop as an item unless you override + * this by catching the PAINTING_BREAK event. * @return False if force was false and the new art won't fit at the painting's current location */ public boolean setArt(Art art, boolean force); @@ -34,6 +37,7 @@ public interface Painting extends Entity, Attachable { /** * Sets the direction of the painting, potentially overriding rules of placement. Note that if the result * is not valid the painting would normally drop as an item. + * * @param face The new direction. * @param force Whether to force it. * @return False if force was false and there was no block for it to attach to in order to face the given direction. diff --git a/src/main/java/org/bukkit/entity/Pig.java b/src/main/java/org/bukkit/entity/Pig.java index fe1b0f4c..28f59f2c 100644 --- a/src/main/java/org/bukkit/entity/Pig.java +++ b/src/main/java/org/bukkit/entity/Pig.java @@ -6,7 +6,7 @@ package org.bukkit.entity; public interface Pig extends Animals, Vehicle { /** - * Check if the pig has a saddle. + * Check if the pig has a saddle. * * @return if the pig has been saddled. */ diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 71a6e980..8fbb9509 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -37,7 +37,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer { * @param name The new display name. */ public void setDisplayName(String name); - + /** * Gets the name that is shown on the player list. * @@ -82,6 +82,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer { /** * Gets the socket address of this player + * * @return the player's address */ public InetSocketAddress getAddress(); @@ -117,12 +118,14 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer { /** * Returns if the player is in sneak mode + * * @return true if player is in sneak mode */ public boolean isSneaking(); /** * Sets the sneak mode the player + * * @param sneak true if player should appear sneaking */ public void setSneaking(boolean sneak); @@ -214,7 +217,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer { /** * Send a chunk change. This fakes a chunk change packet for a user at * a certain location. The updated cuboid must be entirely within a single - * chunk. This will not actually change the world in any way. + * chunk. This will not actually change the world in any way. * * At least one of the dimensions of the cuboid must be even. The size of the * data buffer must be 2.5*sx*sy*sz and formatted in accordance with the Packet51 diff --git a/src/main/java/org/bukkit/entity/SmallFireball.java b/src/main/java/org/bukkit/entity/SmallFireball.java index 870b8a26..33f54d3e 100644 --- a/src/main/java/org/bukkit/entity/SmallFireball.java +++ b/src/main/java/org/bukkit/entity/SmallFireball.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a small {@link Fireball} */ public interface SmallFireball extends Fireball { - + } diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java index 84c31e9e..49005ed2 100644 --- a/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a snowman entity */ public interface Snowman extends Creature { - + } diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java index e463e453..bf4ea515 100644 --- a/src/main/java/org/bukkit/entity/TNTPrimed.java +++ b/src/main/java/org/bukkit/entity/TNTPrimed.java @@ -6,12 +6,14 @@ package org.bukkit.entity; public interface TNTPrimed extends Explosive { /** * Set the number of ticks until the TNT blows up after being primed. + * * @param fuseTicks The fuse ticks */ public void setFuseTicks(int fuseTicks); /** * Retrieve the number of ticks until the explosion of this TNTPrimed entity + * * @return the number of ticks until this TNTPrimed explodes */ public int getFuseTicks(); diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java index 1daffced..789ade54 100644 --- a/src/main/java/org/bukkit/entity/ThrownPotion.java +++ b/src/main/java/org/bukkit/entity/ThrownPotion.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a thrown potion bottle */ public interface ThrownPotion extends Projectile { - + } diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java index 6d8dc763..1fa8392f 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java @@ -4,5 +4,5 @@ package org.bukkit.entity; * Represents a villager NPC */ public interface Villager extends NPC { - + } diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java index 7f4c51c8..095c19c6 100644 --- a/src/main/java/org/bukkit/event/Event.java +++ b/src/main/java/org/bukkit/event/Event.java @@ -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; diff --git a/src/main/java/org/bukkit/event/EventException.java b/src/main/java/org/bukkit/event/EventException.java index f9991c88..84638e85 100644 --- a/src/main/java/org/bukkit/event/EventException.java +++ b/src/main/java/org/bukkit/event/EventException.java @@ -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) { diff --git a/src/main/java/org/bukkit/event/block/BlockBreakEvent.java b/src/main/java/org/bukkit/event/block/BlockBreakEvent.java index 5563f403..972b8b63 100644 --- a/src/main/java/org/bukkit/event/block/BlockBreakEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockBreakEvent.java @@ -6,13 +6,14 @@ import org.bukkit.event.Cancellable; /** * Called when a block is broken by a player. - *

+ *

* 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. - *

+ *

* If a Block Break event is cancelled, the block will not break. */ +@SuppressWarnings("serial") public class BlockBreakEvent extends BlockEvent implements Cancellable { private Player player; diff --git a/src/main/java/org/bukkit/event/block/BlockBurnEvent.java b/src/main/java/org/bukkit/event/block/BlockBurnEvent.java index f0567e11..fc53334c 100644 --- a/src/main/java/org/bukkit/event/block/BlockBurnEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockBurnEvent.java @@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable; /** * Called when a block is destroyed as a result of being burnt by fire. - *

+ *

* 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; diff --git a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java index f1c7eeb8..191bf9f8 100644 --- a/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockCanBuildEvent.java @@ -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. - *

+ *

* Note: *

    - *
  • The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.
  • - *
  • If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.
  • + *
  • The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.
  • + *
  • If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.
  • *
*/ +@SuppressWarnings("serial") public class BlockCanBuildEvent extends BlockEvent { protected boolean buildable; protected int material; diff --git a/src/main/java/org/bukkit/event/block/BlockDamageEvent.java b/src/main/java/org/bukkit/event/block/BlockDamageEvent.java index e2d8cd80..6100d9ad 100644 --- a/src/main/java/org/bukkit/event/block/BlockDamageEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockDamageEvent.java @@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack; *

* 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; diff --git a/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java b/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java index 84ffc7db..b4279efa 100644 --- a/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockDispenseEvent.java @@ -7,9 +7,10 @@ import org.bukkit.util.Vector; /** * Called when an item is dispensed from a block. - *

+ *

* 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. - *

+ *

* 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 diff --git a/src/main/java/org/bukkit/event/block/BlockEvent.java b/src/main/java/org/bukkit/event/block/BlockEvent.java index ab7de90f..2ebb6a28 100644 --- a/src/main/java/org/bukkit/event/block/BlockEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents a block related event. */ +@SuppressWarnings("serial") public class BlockEvent extends Event { protected Block block; diff --git a/src/main/java/org/bukkit/event/block/BlockFadeEvent.java b/src/main/java/org/bukkit/event/block/BlockFadeEvent.java index 21d97ba0..cfd26e95 100644 --- a/src/main/java/org/bukkit/event/block/BlockFadeEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockFadeEvent.java @@ -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 *

* Examples: *

    - *
  • Snow melting due to being near a light source.
  • - *
  • Ice melting due to being near a light source.
  • + *
  • Snow melting due to being near a light source.
  • + *
  • Ice melting due to being near a light source.
  • *
*

* 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; diff --git a/src/main/java/org/bukkit/event/block/BlockFormEvent.java b/src/main/java/org/bukkit/event/block/BlockFormEvent.java index f2403670..209a5659 100644 --- a/src/main/java/org/bukkit/event/block/BlockFormEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockFormEvent.java @@ -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. - *

+ *

* Examples: - *

    - *
  • Snow forming due to a snow storm.
  • - *
  • Ice forming in a snowy Biome like Taiga or Tundra.
  • + *
      + *
    • Snow forming due to a snow storm.
    • + *
    • Ice forming in a snowy Biome like Taiga or Tundra.
    • *
    - *

    + *

    * 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; diff --git a/src/main/java/org/bukkit/event/block/BlockFromToEvent.java b/src/main/java/org/bukkit/event/block/BlockFromToEvent.java index 36710834..0f43c931 100644 --- a/src/main/java/org/bukkit/event/block/BlockFromToEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockFromToEvent.java @@ -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). - *

    + *

    * 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; diff --git a/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java b/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java index 6bcf2e8a..a98b15f8 100644 --- a/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockIgniteEvent.java @@ -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}. - *

    + *

    * 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; diff --git a/src/main/java/org/bukkit/event/block/BlockListener.java b/src/main/java/org/bukkit/event/block/BlockListener.java index 237ec8f3..383b34e2 100644 --- a/src/main/java/org/bukkit/event/block/BlockListener.java +++ b/src/main/java/org/bukkit/event/block/BlockListener.java @@ -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. - *

    + *

    * Note: *

      - *
    • The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.
    • - *
    • If you want to figure out what is being placed, use {@link BlockCanBuildEvent#getMaterial()} or {@link BlockCanBuildEvent#getMaterialId()} instead.
    • + *
    • The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.
    • + *
    • If you want to figure out what is being placed, use {@link BlockCanBuildEvent#getMaterial()} or {@link BlockCanBuildEvent#getMaterialId()} instead.
    • *
    * * @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). - *

    + *

    * 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}. - *

    + *

    * 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. - *

    + *

    * 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. - *

    + *

    * 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. - *

    + *

    * 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. - *

    + *

    * 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. - *

    + *

    * 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. - *

    + *

    * Examples: - *

      - *
    • Snow forming due to a snow storm.
    • - *
    • Ice forming in a snowy Biome like Tiga or Tundra.
    • + *
        + *
      • Snow forming due to a snow storm.
      • + *
      • Ice forming in a snowy Biome like Tiga or Tundra.
      • *
      - *

      + *

      * 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. - *

      + *

      * Examples: - *

        - *
      • Mushrooms spreading.
      • - *
      • Fire spreading.
      • + *
          + *
        • Mushrooms spreading.
        • + *
        • Fire spreading.
        • *
        - *

        + *

        * 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 { *

        * Examples: *

          - *
        • Snow melting due to being near a light source.
        • - *
        • Ice melting due to being near a light source.
        • + *
        • Snow melting due to being near a light source.
        • + *
        • Ice melting due to being near a light source.
        • *
        *

        * 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. - *

        + *

        * If a Block Dispense event is cancelled, the block will not dispense the item. * * @param event Relevant event details diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java index d56df635..f35be74f 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/block/BlockPistonEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonEvent.java index 4c2560aa..93f66fee 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java index dff70f0b..d4cadb22 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonExtendEvent.java @@ -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 blocks; diff --git a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java index 7534cbe0..0fec1e04 100644 --- a/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPistonRetractEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java index ea143ca9..0a9f122f 100644 --- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java @@ -8,9 +8,10 @@ import org.bukkit.inventory.ItemStack; /** * Called when a block is placed by a player. - *

        + *

        * 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; diff --git a/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java b/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java index 9691a6be..be0a530a 100644 --- a/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockRedstoneEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java b/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java index 9e56ae78..6001d0ad 100644 --- a/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockSpreadEvent.java @@ -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. - *

        + *

        * Examples: - *

          - *
        • Mushrooms spreading.
        • - *
        • Fire spreading.
        • + *
            + *
          • Mushrooms spreading.
          • + *
          • Fire spreading.
          • *
          - *

          + *

          * If a Block Spread event is cancelled, the block will not spread. + * * @see BlockFormEvent */ +@SuppressWarnings("serial") public class BlockSpreadEvent extends BlockFormEvent { private Block source; diff --git a/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java b/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java index 4757bb0e..07dd2e5f 100644 --- a/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java +++ b/src/main/java/org/bukkit/event/block/LeavesDecayEvent.java @@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable; /** * Called when leaves are decaying naturally. - *

          + *

          * 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; diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java index 03b69586..28e69b94 100644 --- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java +++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java @@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable; *

          * 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; diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java index 394dd580..0dbcbf3b 100644 --- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java @@ -7,9 +7,10 @@ import org.bukkit.event.Cancellable; /** * Called when a creature is spawned into a world. - *

          + *

          * If a Creature Spawn event is cancelled, the creature will not spawn. */ +@SuppressWarnings("serial") public class CreatureSpawnEvent extends EntityEvent implements Cancellable { private Location location; diff --git a/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java b/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java index a670696c..7386f401 100644 --- a/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java +++ b/src/main/java/org/bukkit/event/entity/CreeperPowerEvent.java @@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable; /** * Called when a Creeper is struck by lightning. - *

          + *

          * 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; diff --git a/src/main/java/org/bukkit/event/entity/EndermanPickupEvent.java b/src/main/java/org/bukkit/event/entity/EndermanPickupEvent.java index 9624000d..ee5a5f35 100644 --- a/src/main/java/org/bukkit/event/entity/EndermanPickupEvent.java +++ b/src/main/java/org/bukkit/event/entity/EndermanPickupEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EndermanPlaceEvent.java b/src/main/java/org/bukkit/event/entity/EndermanPlaceEvent.java index aca6228a..1c85eb78 100644 --- a/src/main/java/org/bukkit/event/entity/EndermanPlaceEvent.java +++ b/src/main/java/org/bukkit/event/entity/EndermanPlaceEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java index addb42fd..c6175cd2 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustByBlockEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java index 15ab75f1..af3d245a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustByEntityEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java b/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java index 9b3f38f3..156fa637 100644 --- a/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityCombustEvent.java @@ -5,9 +5,10 @@ import org.bukkit.event.Cancellable; /** * Called when an entity combusts. - *

          + *

          * 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) { diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java index f141c009..f18b7049 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java index 62b4df94..8efc3cbc 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByProjectileEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByProjectileEvent.java index 5419b019..e4fe40e0 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByProjectileEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByProjectileEvent.java @@ -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 { diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 1d871fc8..95e1682e 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java index a7e47ee2..96d0ef70 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java @@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack; /** * Thrown whenever a LivingEntity dies */ +@SuppressWarnings("serial") public class EntityDeathEvent extends EntityEvent { private List drops; private int dropExp = 0; diff --git a/src/main/java/org/bukkit/event/entity/EntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityEvent.java index ef35d00b..af93e074 100644 --- a/src/main/java/org/bukkit/event/entity/EntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents an Entity-related event */ +@SuppressWarnings("serial") public class EntityEvent extends Event { protected Entity entity; diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java index 9701a8a0..7eed8f4a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java @@ -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 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) { diff --git a/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java b/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java index 0fec15b6..b1b58a5c 100644 --- a/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityInteractEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityListener.java b/src/main/java/org/bukkit/event/entity/EntityListener.java index 3e8db64e..b4399736 100644 --- a/src/main/java/org/bukkit/event/entity/EntityListener.java +++ b/src/main/java/org/bukkit/event/entity/EntityListener.java @@ -12,7 +12,7 @@ public class EntityListener implements Listener { /** * Called when a creature is spawned into a world. - *

          + *

          * 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. - *

          + *

          * 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. - *

          + *

          * If a Creeper Power event is cancelled, the Creeper will not be powered. * * @param event Relevant event details diff --git a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java index 137d6fbb..44f506b1 100644 --- a/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityPortalEnterEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java index 16352403..dd167912 100644 --- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityTameEvent.java b/src/main/java/org/bukkit/event/entity/EntityTameEvent.java index af7363d4..5b0759f8 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTameEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTameEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java index ad2392a6..e4a45f6d 100644 --- a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java b/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java index 2fd38537..850aa8de 100644 --- a/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java +++ b/src/main/java/org/bukkit/event/entity/ExplosionPrimeEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java b/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java index 4adacfef..f6854ce7 100644 --- a/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java +++ b/src/main/java/org/bukkit/event/entity/FoodLevelChangeEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java index 8d6e4876..19544295 100644 --- a/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java +++ b/src/main/java/org/bukkit/event/entity/ItemSpawnEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/PigZapEvent.java b/src/main/java/org/bukkit/event/entity/PigZapEvent.java index bd9a61a5..174a2d08 100644 --- a/src/main/java/org/bukkit/event/entity/PigZapEvent.java +++ b/src/main/java/org/bukkit/event/entity/PigZapEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java index 4fa78fd0..46c650d7 100644 --- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java @@ -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 { *

          * 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) { diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java index b1e21f9b..e5b2e60a 100644 --- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java +++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java @@ -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) { diff --git a/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java b/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java index 3ca784a9..57d52bac 100644 --- a/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java +++ b/src/main/java/org/bukkit/event/entity/SlimeSplitEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java index d455864f..d1849f96 100644 --- a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java +++ b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java index 4b42b46c..9b00384d 100644 --- a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java +++ b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/inventory/InventoryListener.java b/src/main/java/org/bukkit/event/inventory/InventoryListener.java index 83e7e6d5..f34fa2ba 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryListener.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryListener.java @@ -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() {} diff --git a/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java b/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java index 2826d8fa..00d6533a 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingBreakByEntityEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java b/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java index 98420666..8268b00d 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingBreakEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/painting/PaintingEvent.java b/src/main/java/org/bukkit/event/painting/PaintingEvent.java index bf576c67..c2c606ba 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents a painting-related event. */ +@SuppressWarnings("serial") public class PaintingEvent extends Event { protected Painting painting; diff --git a/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java b/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java index c56ec239..7e460c83 100644 --- a/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java +++ b/src/main/java/org/bukkit/event/painting/PaintingPlaceEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java b/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java index 93a3f757..4f703f3a 100644 --- a/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerAnimationEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java index 0ba13eb6..53aeac38 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBedEnterEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java index 8e91f2aa..2cc36edd 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBedLeaveEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java index b7ddc92d..b44155e4 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java @@ -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); } } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java index ec45668c..c8f830e0 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -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 * diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java index 5f1ff0df..4a5dbe48 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java b/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java index badbc13f..e718dc0a 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChangedWorldEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerChatEvent.java b/src/main/java/org/bukkit/event/player/PlayerChatEvent.java index 5c71f3ea..67067d87 100644 --- a/src/main/java/org/bukkit/event/player/PlayerChatEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerChatEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java index 2979edba..67addfe9 100644 --- a/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerCommandPreprocessEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java index 926d09d9..50928987 100644 --- a/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerDropItemEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java b/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java index 6b2a8ea7..9a8cda48 100644 --- a/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerEggThrowEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerEvent.java b/src/main/java/org/bukkit/event/player/PlayerEvent.java index f426bc1e..c567a0e8 100644 --- a/src/main/java/org/bukkit/event/player/PlayerEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents a player related event */ +@SuppressWarnings("serial") public class PlayerEvent extends Event { protected Player player; diff --git a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java index 8cbcb741..285e8ab8 100644 --- a/src/main/java/org/bukkit/event/player/PlayerFishEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerFishEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java index bc160161..e1dc0da3 100644 --- a/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerGameModeChangeEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java b/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java index 07663db3..3a8d3d44 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInteractEntityEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java index e0b357a5..9db1f0de 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java b/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java index f75e2b58..b425fe22 100644 --- a/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerInventoryEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java index 3f5adba9..8a7fad3c 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemHeldEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java index 179abc2c..a0672940 100644 --- a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java index 927594f3..97559f3e 100644 --- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java index 9ef98aac..2bda0ec3 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java index de421a0b..1de15fb6 100644 --- a/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerMoveEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java index 3148e148..ac1b27b0 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java index 01f64362..ad500f4d 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPortalEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java index ac833e33..cfdc2fc2 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java index fa012ad1..28598e70 100644 --- a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java b/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java index 819e3798..6b82420d 100644 --- a/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerRespawnEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java b/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java index 667cb33e..468f9e57 100644 --- a/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerTeleportEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java b/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java index 1e645f1c..1c6eb418 100644 --- a/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerToggleSneakEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java b/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java index ef86ae48..be8d53fa 100644 --- a/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerToggleSprintEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java b/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java index f658ec05..45575cf0 100644 --- a/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerVelocityEvent.java @@ -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 { /** diff --git a/src/main/java/org/bukkit/event/server/MapInitializeEvent.java b/src/main/java/org/bukkit/event/server/MapInitializeEvent.java index 12ef1781..003bff4f 100644 --- a/src/main/java/org/bukkit/event/server/MapInitializeEvent.java +++ b/src/main/java/org/bukkit/event/server/MapInitializeEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/server/PluginDisableEvent.java b/src/main/java/org/bukkit/event/server/PluginDisableEvent.java index 6e9a21e1..195c93bf 100644 --- a/src/main/java/org/bukkit/event/server/PluginDisableEvent.java +++ b/src/main/java/org/bukkit/event/server/PluginDisableEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/server/PluginEnableEvent.java b/src/main/java/org/bukkit/event/server/PluginEnableEvent.java index f3eaa6eb..089b679e 100644 --- a/src/main/java/org/bukkit/event/server/PluginEnableEvent.java +++ b/src/main/java/org/bukkit/event/server/PluginEnableEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/server/PluginEvent.java b/src/main/java/org/bukkit/event/server/PluginEvent.java index 937cf495..13c26195 100644 --- a/src/main/java/org/bukkit/event/server/PluginEvent.java +++ b/src/main/java/org/bukkit/event/server/PluginEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java index b33044ed..c4c41ba2 100644 --- a/src/main/java/org/bukkit/event/server/ServerCommandEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerCommandEvent.java @@ -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() { diff --git a/src/main/java/org/bukkit/event/server/ServerEvent.java b/src/main/java/org/bukkit/event/server/ServerEvent.java index 6c2b3749..8c2ed26c 100644 --- a/src/main/java/org/bukkit/event/server/ServerEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java index ea170e21..d5162faa 100644 --- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java @@ -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) { diff --git a/src/main/java/org/bukkit/event/server/ServerListener.java b/src/main/java/org/bukkit/event/server/ServerListener.java index d49b1e0a..24a550a3 100644 --- a/src/main/java/org/bukkit/event/server/ServerListener.java +++ b/src/main/java/org/bukkit/event/server/ServerListener.java @@ -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) {} diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java index d29c5ead..5d53ec29 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleBlockCollisionEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java index 5eea95c2..526adeef 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleCollisionEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java index dd0d54ac..f9ea7958 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleCreateEvent.java @@ -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); diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java index 6bdb70cb..3811049d 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java index 461f89f2..ac087e34 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleDestroyEvent.java @@ -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; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java index b7600f7f..04b3e069 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleEnterEvent.java @@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable; /** * Raised when an entity enters a vehicle. */ +@SuppressWarnings("serial") public class VehicleEnterEvent extends VehicleEvent implements Cancellable { private boolean cancelled; private Entity entered; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java index a475c99d..a2b285a4 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleEntityCollisionEvent.java @@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable; /** * Raised when a vehicle collides with an entity. */ +@SuppressWarnings("serial") public class VehicleEntityCollisionEvent extends VehicleCollisionEvent implements Cancellable { private Entity entity; private boolean cancelled = false; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java index dd271438..5e2a1fd9 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents a vehicle-related event. */ +@SuppressWarnings("serial") public class VehicleEvent extends Event { protected Vehicle vehicle; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java index 909192a2..e6a44e02 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java @@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable; /** * Raised when a living entity exits a vehicle. */ +@SuppressWarnings("serial") public class VehicleExitEvent extends VehicleEvent implements Cancellable { private boolean cancelled; private LivingEntity exited; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java index 7cea78eb..9365d7be 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleMoveEvent.java @@ -6,6 +6,7 @@ import org.bukkit.entity.Vehicle; /** * Raised when a vehicle moves. */ +@SuppressWarnings("serial") public class VehicleMoveEvent extends VehicleEvent { private Location from; private Location to; diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java index 814e14e9..5fc193f3 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleUpdateEvent.java @@ -2,6 +2,7 @@ package org.bukkit.event.vehicle; import org.bukkit.entity.Vehicle; +@SuppressWarnings("serial") public class VehicleUpdateEvent extends VehicleEvent { public VehicleUpdateEvent(Vehicle vehicle) { super(Type.VEHICLE_UPDATE, vehicle); diff --git a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java index cced3ef7..2bcd37a0 100644 --- a/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java +++ b/src/main/java/org/bukkit/event/weather/LightningStrikeEvent.java @@ -7,6 +7,7 @@ import org.bukkit.event.Cancellable; /** * Stores data for lightning striking */ +@SuppressWarnings("serial") public class LightningStrikeEvent extends WeatherEvent implements Cancellable { private boolean canceled; diff --git a/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java b/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java index c53f7ff4..89153766 100644 --- a/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java +++ b/src/main/java/org/bukkit/event/weather/ThunderChangeEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable; /** * Stores data for thunder state changing in a world */ +@SuppressWarnings("serial") public class ThunderChangeEvent extends WeatherEvent implements Cancellable { private boolean canceled; diff --git a/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java b/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java index f6e9e2ec..955be2ee 100644 --- a/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java +++ b/src/main/java/org/bukkit/event/weather/WeatherChangeEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable; /** * Stores data for weather changing in a world */ +@SuppressWarnings("serial") public class WeatherChangeEvent extends WeatherEvent implements Cancellable { private boolean canceled; diff --git a/src/main/java/org/bukkit/event/weather/WeatherEvent.java b/src/main/java/org/bukkit/event/weather/WeatherEvent.java index 8c78f86c..5036a3e0 100644 --- a/src/main/java/org/bukkit/event/weather/WeatherEvent.java +++ b/src/main/java/org/bukkit/event/weather/WeatherEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents a Weather-related event */ +@SuppressWarnings("serial") public class WeatherEvent extends Event { protected World world; diff --git a/src/main/java/org/bukkit/event/world/ChunkEvent.java b/src/main/java/org/bukkit/event/world/ChunkEvent.java index 3e789b73..c36fe670 100644 --- a/src/main/java/org/bukkit/event/world/ChunkEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkEvent.java @@ -5,6 +5,7 @@ import org.bukkit.Chunk; /** * Represents a Chunk related event */ +@SuppressWarnings("serial") public class ChunkEvent extends WorldEvent { protected Chunk chunk; diff --git a/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java b/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java index 9eb6cc42..870de349 100644 --- a/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkLoadEvent.java @@ -5,6 +5,7 @@ import org.bukkit.Chunk; /** * Called when a chunk is loaded */ +@SuppressWarnings("serial") public class ChunkLoadEvent extends ChunkEvent { private final boolean newChunk; diff --git a/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java b/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java index aa10a63b..02affec2 100644 --- a/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkPopulateEvent.java @@ -8,6 +8,7 @@ import org.bukkit.generator.BlockPopulator; * * If your intent is to populate the chunk using this event, please see {@link BlockPopulator} */ +@SuppressWarnings("serial") public class ChunkPopulateEvent extends ChunkEvent { public ChunkPopulateEvent(final Chunk chunk) { super(Type.CHUNK_POPULATED, chunk); diff --git a/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java b/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java index dd030eb6..8c4e7667 100644 --- a/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable; /** * Called when a chunk is unloaded */ +@SuppressWarnings("serial") public class ChunkUnloadEvent extends ChunkEvent implements Cancellable { private boolean cancel = false; diff --git a/src/main/java/org/bukkit/event/world/PortalCreateEvent.java b/src/main/java/org/bukkit/event/world/PortalCreateEvent.java index 8a04128a..26f35735 100644 --- a/src/main/java/org/bukkit/event/world/PortalCreateEvent.java +++ b/src/main/java/org/bukkit/event/world/PortalCreateEvent.java @@ -9,6 +9,7 @@ import java.util.Collection; /** * Called when the world attempts to create a matching end to a portal */ +@SuppressWarnings("serial") public class PortalCreateEvent extends WorldEvent implements Cancellable { private boolean cancel = false; private ArrayList blocks = new ArrayList(); diff --git a/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java b/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java index 10576b01..4ea14dc6 100644 --- a/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java +++ b/src/main/java/org/bukkit/event/world/SpawnChangeEvent.java @@ -7,6 +7,7 @@ import org.bukkit.Location; * An event that is called when a world's spawn changes. The * world's previous spawn location is included. */ +@SuppressWarnings("serial") public class SpawnChangeEvent extends WorldEvent { private Location previousLocation; diff --git a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java index 7743ae9d..b3e33822 100644 --- a/src/main/java/org/bukkit/event/world/StructureGrowEvent.java +++ b/src/main/java/org/bukkit/event/world/StructureGrowEvent.java @@ -47,7 +47,7 @@ public class StructureGrowEvent extends WorldEvent implements Cancellable { } /** - * Checks if structure was grown using bonemeal. + * Checks if structure was grown using bonemeal. * * @return True if the structure was grown using bonemeal. */ diff --git a/src/main/java/org/bukkit/event/world/WorldEvent.java b/src/main/java/org/bukkit/event/world/WorldEvent.java index 5f42fb76..e822dae4 100644 --- a/src/main/java/org/bukkit/event/world/WorldEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Event; /** * Represents events within a world */ +@SuppressWarnings("serial") public class WorldEvent extends Event { private final World world; diff --git a/src/main/java/org/bukkit/event/world/WorldInitEvent.java b/src/main/java/org/bukkit/event/world/WorldInitEvent.java index e14e05b1..79fbcd33 100644 --- a/src/main/java/org/bukkit/event/world/WorldInitEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldInitEvent.java @@ -5,6 +5,7 @@ import org.bukkit.World; /** * Called when a World is initializing */ +@SuppressWarnings("serial") public class WorldInitEvent extends WorldEvent { public WorldInitEvent(World world) { super(Type.WORLD_INIT, world); diff --git a/src/main/java/org/bukkit/event/world/WorldLoadEvent.java b/src/main/java/org/bukkit/event/world/WorldLoadEvent.java index 7214ae04..3519d338 100644 --- a/src/main/java/org/bukkit/event/world/WorldLoadEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldLoadEvent.java @@ -5,6 +5,7 @@ import org.bukkit.World; /** * Called when a World is loaded */ +@SuppressWarnings("serial") public class WorldLoadEvent extends WorldEvent { public WorldLoadEvent(World world) { super(Type.WORLD_LOAD, world); diff --git a/src/main/java/org/bukkit/event/world/WorldSaveEvent.java b/src/main/java/org/bukkit/event/world/WorldSaveEvent.java index fec1e002..414bd296 100644 --- a/src/main/java/org/bukkit/event/world/WorldSaveEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldSaveEvent.java @@ -2,6 +2,7 @@ package org.bukkit.event.world; import org.bukkit.World; +@SuppressWarnings("serial") public class WorldSaveEvent extends WorldEvent { public WorldSaveEvent(World world) { super(Type.WORLD_SAVE, world); diff --git a/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java b/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java index 30c0f15a..821d6ef7 100644 --- a/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java +++ b/src/main/java/org/bukkit/event/world/WorldUnloadEvent.java @@ -6,6 +6,7 @@ import org.bukkit.event.Cancellable; /** * Called when a World is unloaded */ +@SuppressWarnings("serial") public class WorldUnloadEvent extends WorldEvent implements Cancellable { private boolean isCancelled; diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java index be630927..fda6a83f 100644 --- a/src/main/java/org/bukkit/generator/ChunkGenerator.java +++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java @@ -17,10 +17,11 @@ public abstract class ChunkGenerator { * Shapes the chunk for the given coordinates.
          *
          * This method should return a byte[32768] in the following format: + * *

          -     * for (int x = 0; x < 16; x++) {
          -     *     for (int z = 0; z < 16; z++) {
          -     *         for (int y = 0; y < 128; y++) {
          +     * for (int x = 0; x < 16; x++) {
          +     *     for (int z = 0; z < 16; z++) {
          +     *         for (int y = 0; y < 128; y++) {
                *             // result[(x * 16 + z) * 128 + y] = ??;
                *         }
                *     }
          @@ -50,16 +51,13 @@ public abstract class ChunkGenerator {
                   Block highest = world.getBlockAt(x, world.getHighestBlockYAt(x, z), z);
           
                   switch (world.getEnvironment()) {
          -            case NETHER:
          -                return true;
          -            case THE_END:
          -                return highest.getType() != Material.AIR
          -                        && highest.getType() != Material.WATER
          -                        && highest.getType() != Material.LAVA;
          -            case NORMAL:
          -            default:
          -                return highest.getType() == Material.SAND
          -                        || highest.getType() == Material.GRAVEL;
          +        case NETHER:
          +            return true;
          +        case THE_END:
          +            return highest.getType() != Material.AIR && highest.getType() != Material.WATER && highest.getType() != Material.LAVA;
          +        case NORMAL:
          +        default:
          +            return highest.getType() == Material.SAND || highest.getType() == Material.GRAVEL;
                   }
               }
           
          diff --git a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
          index adff8e27..fe45e705 100644
          --- a/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
          +++ b/src/main/java/org/bukkit/inventory/FurnaceRecipe.java
          @@ -12,6 +12,7 @@ public class FurnaceRecipe implements Recipe {
           
               /**
                * Create a furnace recipe to craft the specified ItemStack.
          +     *
                * @param result The item you want the recipe to create.
                * @param source The input material.
                */
          @@ -24,6 +25,7 @@ public class FurnaceRecipe implements Recipe {
           
               /**
                * Create a furnace recipe to craft the specified ItemStack.
          +     *
                * @param result The item you want the recipe to create.
                * @param source The input material.
                */
          @@ -34,6 +36,7 @@ public class FurnaceRecipe implements Recipe {
           
               /**
                * Sets the input of this furnace recipe.
          +     *
                * @param input The input material.
                * @return The changed recipe, so you can chain calls.
                */
          @@ -44,6 +47,7 @@ public class FurnaceRecipe implements Recipe {
           
               /**
                * Sets the input of this furnace recipe.
          +     *
                * @param input The input material.
                * @return The changed recipe, so you can chain calls.
                */
          @@ -57,6 +61,7 @@ public class FurnaceRecipe implements Recipe {
           
               /**
                * Get the input material.
          +     *
                * @return The input material.
                */
               public MaterialData getInput() {
          @@ -65,6 +70,7 @@ public class FurnaceRecipe implements Recipe {
           
               /**
                * Get the result of this recipe.
          +     *
                * @return The resulting stack.
                */
               public ItemStack getResult() {
          diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
          index 73316827..87cd9ca6 100644
          --- a/src/main/java/org/bukkit/inventory/ItemStack.java
          +++ b/src/main/java/org/bukkit/inventory/ItemStack.java
          @@ -349,16 +349,16 @@ public class ItemStack implements ConfigurationSerializable {
               }
           
               public static ItemStack deserialize(Map args) {
          -        Material type = Material.getMaterial((String)args.get("type"));
          +        Material type = Material.getMaterial((String) args.get("type"));
                   short damage = 0;
                   int amount = 1;
           
                   if (args.containsKey("damage")) {
          -            damage = (Short)args.get("damage");
          +            damage = (Short) args.get("damage");
                   }
           
                   if (args.containsKey("amount")) {
          -            amount = (Integer)args.get("amount");
          +            amount = (Integer) args.get("amount");
                   }
           
                   ItemStack result = new ItemStack(type, amount, damage);
          @@ -367,13 +367,14 @@ public class ItemStack implements ConfigurationSerializable {
                       Object raw = args.get("enchantments");
           
                       if (raw instanceof Map) {
          -                Map map = (Map)raw;
          +                @SuppressWarnings("unchecked")
          +                Map map = (Map) raw;
           
                           for (Map.Entry entry : map.entrySet()) {
                               Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
           
                               if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
          -                        result.addEnchantment(enchantment, (Integer)entry.getValue());
          +                        result.addEnchantment(enchantment, (Integer) entry.getValue());
                               }
                           }
                       }
          diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
          index db655bce..e5f797a0 100644
          --- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
          +++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
          @@ -43,7 +43,7 @@ public interface PlayerInventory extends Inventory {
               /**
                * Put the given ItemStacks into the armor slots
                *
          -     *  @param items The ItemStacks to use as armour
          +     * @param items The ItemStacks to use as armour
                */
               public void setArmorContents(ItemStack[] items);
           
          diff --git a/src/main/java/org/bukkit/inventory/Recipe.java b/src/main/java/org/bukkit/inventory/Recipe.java
          index 7a019853..7977ce2d 100644
          --- a/src/main/java/org/bukkit/inventory/Recipe.java
          +++ b/src/main/java/org/bukkit/inventory/Recipe.java
          @@ -7,6 +7,7 @@ public interface Recipe {
           
               /**
                * Get the result of this recipe.
          +     *
                * @return The result stack
                */
               ItemStack getResult();
          diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
          index 9df52a87..d099ca5b 100644
          --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
          +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
          @@ -16,6 +16,7 @@ public class ShapedRecipe implements Recipe {
               /**
                * Create a shaped recipe to craft the specified ItemStack. The constructor merely determines the
                * result and type; to set the actual recipe, you'll need to call the appropriate methods.
          +     *
                * @param result The item you want the recipe to create.
                * @see ShapedRecipe#shape(String...)
                * @see ShapedRecipe#setIngredient(char, Material)
          @@ -29,6 +30,7 @@ public class ShapedRecipe implements Recipe {
               /**
                * Set the shape of this recipe to the specified rows. Each character represents a different
                * ingredient; exactly what each character represents is set separately.
          +     *
                * @param shape The rows of the recipe (up to 3 rows).
                * @return The changed recipe, so you can chain calls.
                */
          @@ -57,6 +59,7 @@ public class ShapedRecipe implements Recipe {
           
               /**
                * Sets the material that a character in the recipe shape refers to.
          +     *
                * @param key The character that represents the ingredient in the shape.
                * @param ingredient The ingredient.
                * @return The changed recipe, so you can chain calls.
          @@ -71,6 +74,7 @@ public class ShapedRecipe implements Recipe {
           
               /**
                * Sets the material that a character in the recipe shape refers to.
          +     *
                * @param key The character that represents the ingredient in the shape.
                * @param ingredient The ingredient.
                * @return The changed recipe, so you can chain calls.
          @@ -81,6 +85,7 @@ public class ShapedRecipe implements Recipe {
           
               /**
                * Sets the material that a character in the recipe shape refers to.
          +     *
                * @param key The character that represents the ingredient in the shape.
                * @param ingredient The ingredient.
                * @param raw The raw material data as an integer.
          @@ -108,6 +113,7 @@ public class ShapedRecipe implements Recipe {
           
               /**
                * Get the ingredients map.
          +     *
                * @return The mapping of character to ingredients.
                */
               public HashMap getIngredientMap() {
          @@ -116,6 +122,7 @@ public class ShapedRecipe implements Recipe {
           
               /**
                * Get the shape.
          +     *
                * @return The recipe's shape.
                */
               public String[] getShape() {
          @@ -124,6 +131,7 @@ public class ShapedRecipe implements Recipe {
           
               /**
                * Get the result.
          +     *
                * @return The result stack.
                */
               public ItemStack getResult() {
          diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
          index 4cb92668..1ed559e8 100644
          --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
          +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
          @@ -16,6 +16,7 @@ public class ShapelessRecipe implements Recipe {
               /**
                * Create a shapeless recipe to craft the specified ItemStack. The constructor merely determines the
                * result and type; to set the actual recipe, you'll need to call the appropriate methods.
          +     *
                * @param result The item you want the recipe to create.
                * @see ShapelessRecipe#addIngredient(Material)
                * @see ShapelessRecipe#addIngredient(MaterialData)
          @@ -26,6 +27,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Adds the specified ingredient.
          +     *
                * @param ingredient The ingredient to add.
                * @return The changed recipe, so you can chain calls.
                */
          @@ -35,6 +37,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Adds the specified ingredient.
          +     *
                * @param ingredient The ingredient to add.
                * @return The changed recipe, so you can chain calls.
                */
          @@ -44,6 +47,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Adds the specified ingredient.
          +     *
                * @param ingredient The ingredient to add.
                * @param rawdata The data value.
                * @return The changed recipe, so you can chain calls.
          @@ -54,6 +58,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Adds multiples of the specified ingredient.
          +     *
                * @param count How many to add (can't be more than 9!)
                * @param ingredient The ingredient to add.
                * @return The changed recipe, so you can chain calls.
          @@ -70,6 +75,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Adds multiples of the specified ingredient.
          +     *
                * @param count How many to add (can't be more than 9!)
                * @param ingredient The ingredient to add.
                * @return The changed recipe, so you can chain calls.
          @@ -80,6 +86,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Adds multiples of the specified ingredient.
          +     *
                * @param count How many to add (can't be more than 9!)
                * @param ingredient The ingredient to add.
                * @param rawdata The data value.
          @@ -97,6 +104,7 @@ public class ShapelessRecipe implements Recipe {
               /**
                * Removes an ingredient from the list. If the ingredient occurs multiple times,
                * only one instance of it is removed.
          +     *
                * @param ingredient The ingredient to remove
                * @return The changed recipe.
                */
          @@ -107,6 +115,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Get the result of this recipe.
          +     *
                * @return The result stack.
                */
               public ItemStack getResult() {
          @@ -115,6 +124,7 @@ public class ShapelessRecipe implements Recipe {
           
               /**
                * Get the list of ingredients used for this recipe.
          +     *
                * @return The input list
                */
               public ArrayList getIngredientList() {
          diff --git a/src/main/java/org/bukkit/map/MapCanvas.java b/src/main/java/org/bukkit/map/MapCanvas.java
          index 1681366a..f75e2093 100644
          --- a/src/main/java/org/bukkit/map/MapCanvas.java
          +++ b/src/main/java/org/bukkit/map/MapCanvas.java
          @@ -7,69 +7,77 @@ import java.awt.Image;
            * specific {@link MapRenderer} and represents that renderer's layer on the map.
            */
           public interface MapCanvas {
          -    
          +
               /**
                * Get the map this canvas is attached to.
          +     *
                * @return The MapView this canvas is attached to.
                */
               public MapView getMapView();
          -    
          +
               /**
                * Get the cursor collection associated with this canvas.
          +     *
                * @return The MapCursorCollection associated with this canvas.
                */
               public MapCursorCollection getCursors();
          -    
          +
               /**
                * Set the cursor collection associated with this canvas. This does not
                * usually need to be called since a MapCursorCollection is already
                * provided.
          +     *
                * @param cursors The MapCursorCollection to associate with this canvas.
                */
               public void setCursors(MapCursorCollection cursors);
          -    
          +
               /**
                * Draw a pixel to the canvas.
          +     *
                * @param x The x coordinate, from 0 to 127.
                * @param y The y coordinate, from 0 to 127.
                * @param color The color. See {@link MapPalette}.
                */
               public void setPixel(int x, int y, byte color);
          -    
          +
               /**
                * Get a pixel from the canvas.
          +     *
                * @param x The x coordinate, from 0 to 127.
                * @param y The y coordinate, from 0 to 127.
                * @return The color. See {@link MapPalette}.
                */
               public byte getPixel(int x, int y);
          -    
          +
               /**
                * Get a pixel from the layers below this canvas.
          -     * @param x The x coordinate, from 0 to 127. 
          +     *
          +     * @param x The x coordinate, from 0 to 127.
                * @param y The y coordinate, from 0 to 127.
                * @return The color. See {@link MapPalette}.
                */
               public byte getBasePixel(int x, int y);
          -    
          +
               /**
                * Draw an image to the map. The image will be clipped if necessary.
          +     *
                * @param x The x coordinate of the image.
                * @param y The y coordinate of the image.
                * @param image The Image to draw.
                */
               public void drawImage(int x, int y, Image image);
          -    
          +
               /**
                * Render text to the map using fancy formatting. Newline (\n) characters
                * will move down one line and return to the original column, and the text
                * color can be changed using sequences such as "§12;", replacing 12 with
                * the palette index of the color (see {@link MapPalette}).
          +     *
                * @param x The column to start rendering on.
                * @param y The row to start rendering on.
                * @param font The font to use.
                * @param text The formatted text to render.
                */
               public void drawText(int x, int y, MapFont font, String text);
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
          index 957db93b..6ef06597 100644
          --- a/src/main/java/org/bukkit/map/MapCursor.java
          +++ b/src/main/java/org/bukkit/map/MapCursor.java
          @@ -4,13 +4,14 @@ package org.bukkit.map;
            * Represents a cursor on a map.
            */
           public final class MapCursor {
          -    
          +
               private byte x, y;
               private byte direction, type;
               private boolean visible;
           
               /**
                * Initialize the map cursor.
          +     *
                * @param x The x coordinate, from -128 to 127.
                * @param y The y coordinate, from -128 to 127.
                * @param direction The facing of the cursor, from 0 to 15.
          @@ -24,73 +25,82 @@ public final class MapCursor {
                   setRawType(type);
                   this.visible = visible;
               }
          -    
          +
               /**
                * Get the X position of this cursor.
          +     *
                * @return The X coordinate.
                */
               public byte getX() {
                   return x;
               }
          -    
          +
               /**
                * Get the Y position of this cursor.
          +     *
                * @return The Y coordinate.
                */
               public byte getY() {
                   return y;
               }
          -    
          +
               /**
                * Get the direction of this cursor.
          +     *
                * @return The facing of the cursor, from 0 to 15.
                */
               public byte getDirection() {
                   return direction;
               }
          -    
          +
               /**
                * Get the type of this cursor.
          +     *
                * @return The type (color/style) of the map cursor.
                */
               public Type getType() {
                   return Type.byValue(type);
               }
          -    
          +
               /**
                * Get the type of this cursor.
          +     *
                * @return The type (color/style) of the map cursor.
                */
               public byte getRawType() {
                   return type;
               }
          -    
          +
               /**
                * Get the visibility status of this cursor.
          +     *
                * @return True if visible, false otherwise.
                */
               public boolean isVisible() {
                   return visible;
               }
          -    
          +
               /**
                * Set the X position of this cursor.
          +     *
                * @param x The X coordinate.
                */
               public void setX(byte x) {
                   this.x = x;
               }
          -    
          +
               /**
                * Set the Y position of this cursor.
          +     *
                * @param y The Y coordinate.
                */
               public void setY(byte y) {
                   this.y = y;
               }
          -    
          +
               /**
                * Set the direction of this cursor.
          +     *
                * @param direction The facing of the cursor, from 0 to 15.
                */
               public void setDirection(byte direction) {
          @@ -99,17 +109,19 @@ public final class MapCursor {
                   }
                   this.direction = direction;
               }
          -    
          +
               /**
                * Set the type of this cursor.
          +     *
                * @param type The type (color/style) of the map cursor.
                */
               public void setType(Type type) {
                   setRawType(type.value);
               }
          -    
          +
               /**
                * Set the type of this cursor.
          +     *
                * @param type The type (color/style) of the map cursor.
                */
               public void setRawType(byte type) {
          @@ -118,17 +130,18 @@ public final class MapCursor {
                   }
                   this.type = type;
               }
          -    
          +
               /**
                * Set the visibility status of this cursor.
          +     *
                * @param visible True if visible.
                */
               public void setVisible(boolean visible) {
                   this.visible = visible;
               }
          -    
          +
               /**
          -     * Represents the standard types of map cursors. More may be made available 
          +     * Represents the standard types of map cursors. More may be made available
                * by texture packs - the value is used by the client as an index in the
                * file './misc/mapicons.png' from minecraft.jar or from a texture pack.
                */
          @@ -138,17 +151,17 @@ public final class MapCursor {
                   RED_POINTER(2),
                   BLUE_POINTER(3),
                   WHITE_CROSS(4);
          -        
          +
                   private byte value;
          -        
          +
                   private Type(int value) {
                       this.value = (byte) value;
                   }
          -        
          +
                   public byte getValue() {
                       return value;
                   }
          -        
          +
                   public static Type byValue(byte value) {
                       for (Type t : values()) {
                           if (t.value == value) return t;
          @@ -156,5 +169,5 @@ public final class MapCursor {
                       return null;
                   }
               }
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MapCursorCollection.java b/src/main/java/org/bukkit/map/MapCursorCollection.java
          index ac5d3e30..1e234a14 100644
          --- a/src/main/java/org/bukkit/map/MapCursorCollection.java
          +++ b/src/main/java/org/bukkit/map/MapCursorCollection.java
          @@ -8,37 +8,41 @@ import java.util.List;
            * MapCursorCollection is linked to a specific {@link MapRenderer}.
            */
           public final class MapCursorCollection {
          -    
          +
               private List cursors = new ArrayList();
          -    
          +
               /**
                * Get the amount of cursors in this collection.
          +     *
                * @return The size of this collection.
                */
               public int size() {
                   return cursors.size();
               }
          -    
          +
               /**
                * Get a cursor from this collection.
          +     *
                * @param index The index of the cursor.
                * @return The MapCursor.
                */
               public MapCursor getCursor(int index) {
                   return cursors.get(index);
               }
          -    
          +
               /**
                * Remove a cursor from the collection.
          +     *
                * @param cursor The MapCursor to remove.
                * @return Whether the cursor was removed successfully.
                */
               public boolean removeCursor(MapCursor cursor) {
                   return cursors.remove(cursor);
               }
          -    
          +
               /**
                * Add a cursor to the collection.
          +     *
                * @param cursor The MapCursor to add.
                * @return The MapCursor that was passed.
                */
          @@ -46,9 +50,10 @@ public final class MapCursorCollection {
                   cursors.add(cursor);
                   return cursor;
               }
          -    
          +
               /**
                * Add a cursor to the collection.
          +     *
                * @param x The x coordinate, from -128 to 127.
                * @param y The y coordinate, from -128 to 127.
                * @param direction The facing of the cursor, from 0 to 15.
          @@ -57,9 +62,10 @@ public final class MapCursorCollection {
               public MapCursor addCursor(int x, int y, byte direction) {
                   return addCursor(x, y, direction, (byte) 0, true);
               }
          -    
          +
               /**
                * Add a cursor to the collection.
          +     *
                * @param x The x coordinate, from -128 to 127.
                * @param y The y coordinate, from -128 to 127.
                * @param direction The facing of the cursor, from 0 to 15.
          @@ -69,9 +75,10 @@ public final class MapCursorCollection {
               public MapCursor addCursor(int x, int y, byte direction, byte type) {
                   return addCursor(x, y, direction, type, true);
               }
          -    
          +
               /**
                * Add a cursor to the collection.
          +     *
                * @param x The x coordinate, from -128 to 127.
                * @param y The y coordinate, from -128 to 127.
                * @param direction The facing of the cursor, from 0 to 15.
          @@ -82,5 +89,5 @@ public final class MapCursorCollection {
               public MapCursor addCursor(int x, int y, byte direction, byte type, boolean visible) {
                   return addCursor(new MapCursor((byte) x, (byte) y, direction, type, visible));
               }
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MapFont.java b/src/main/java/org/bukkit/map/MapFont.java
          index 6d38d525..a6016ffc 100644
          --- a/src/main/java/org/bukkit/map/MapFont.java
          +++ b/src/main/java/org/bukkit/map/MapFont.java
          @@ -6,13 +6,14 @@ import java.util.HashMap;
            * Represents a bitmap font drawable to a map.
            */
           public class MapFont {
          -    
          +
               private final HashMap chars = new HashMap();
               private int height = 0;
               protected boolean malleable = true;
          -    
          +
               /**
                * Set the sprite for a given character.
          +     *
                * @param ch The character to set the sprite for.
                * @param sprite The CharacterSprite to set.
                * @throws IllegalStateException if this font is static.
          @@ -21,24 +22,26 @@ public class MapFont {
                   if (!malleable) {
                       throw new IllegalStateException("this font is not malleable");
                   }
          -        
          +
                   chars.put(ch, sprite);
                   if (sprite.getHeight() > height) {
                       height = sprite.getHeight();
                   }
               }
          -    
          +
               /**
                * Get the sprite for a given character.
          +     *
                * @param ch The character to get the sprite for.
                * @return The CharacterSprite associated with the character, or null if there is none.
                */
               public CharacterSprite getChar(char ch) {
                   return chars.get(ch);
               }
          -    
          +
               /**
                * Get the width of the given text as it would be rendered using this font.
          +     *
                * @param text The text.
                * @return The width in pixels.
                */
          @@ -46,24 +49,26 @@ public class MapFont {
                   if (!isValid(text)) {
                       throw new IllegalArgumentException("text contains invalid characters");
                   }
          -        
          +
                   int result = 0;
                   for (int i = 0; i < text.length(); ++i) {
                       result += chars.get(text.charAt(i)).getWidth();
                   }
                   return result;
               }
          -    
          +
               /**
                * Get the height of this font.
          +     *
                * @return The height of the font.
                */
               public int getHeight() {
                   return height;
               }
          -    
          +
               /**
                * Check whether the given text is valid.
          +     *
                * @param text The text.
                * @return True if the string contains only defined characters, false otherwise.
                */
          @@ -75,28 +80,29 @@ public class MapFont {
                   }
                   return true;
               }
          -    
          +
               /**
                * Represents the graphics for a single character in a MapFont.
                */
               public static class CharacterSprite {
          -        
          +
                   private final int width;
                   private final int height;
                   private final boolean[] data;
          -        
          +
                   public CharacterSprite(int width, int height, boolean[] data) {
                       this.width = width;
                       this.height = height;
                       this.data = data;
          -            
          +
                       if (data.length != width * height) {
                           throw new IllegalArgumentException("size of data does not match dimensions");
                       }
                   }
          -        
          +
                   /**
                    * Get the value of a pixel of the character.
          +         *
                    * @param row The row, in the range [0,8).
                    * @param col The column, in the range [0,8).
                    * @return True if the pixel is solid, false if transparent.
          @@ -105,23 +111,25 @@ public class MapFont {
                       if (row < 0 || col < 0 || row >= height || col >= width) return false;
                       return data[row * width + col];
                   }
          -        
          +
                   /**
                    * Get the width of the character sprite.
          +         *
                    * @return The width of the character.
                    */
                   public int getWidth() {
                       return width;
                   }
          -        
          +
                   /**
                    * Get the height of the character sprite.
          +         *
                    * @return The height of the character.
                    */
                   public int getHeight() {
                       return height;
                   }
          -        
          +
               }
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
          index dcc254ea..b9935b7d 100644
          --- a/src/main/java/org/bukkit/map/MapPalette.java
          +++ b/src/main/java/org/bukkit/map/MapPalette.java
          @@ -9,15 +9,14 @@ import java.awt.image.BufferedImage;
            * Represents the palette that map items use.
            */
           public final class MapPalette {
          -    
          +
               // Internal mechanisms
          -    
               private MapPalette() {}
          -    
          +
               private static Color c(int r, int g, int b) {
                   return new Color(r, g, b);
               }
          -    
          +
               private static double getDistance(Color c1, Color c2) {
                   double rmean = (c1.getRed() + c2.getRed()) / 2.0;
                   double r = c1.getRed() - c2.getRed();
          @@ -28,7 +27,7 @@ public final class MapPalette {
                   double weightB = 2 + (255 - rmean) / 256.0;
                   return weightR * r * r + weightG * g * g + weightB * b * b;
               }
          -    
          +
               private static final Color[] colors = {
                   new Color(0, 0, 0, 0), new Color(0, 0, 0, 0),
                   new Color(0, 0, 0, 0), new Color(0, 0, 0, 0),
          @@ -46,9 +45,8 @@ public final class MapPalette {
                   c(45,45,180), c(55,55,220), c(64,64,255), c(55,55,220),
                   c(73,58,35), c(89,71,43), c(104,83,50), c(89,71,43)
               };
          -    
          +
               // Interface
          -    
               /**
                * The base color ranges. Each entry corresponds to four colors of varying
                * shades with values entry to entry + 3.
          @@ -67,8 +65,10 @@ public final class MapPalette {
               public static final byte DARK_GRAY = 44;
               public static final byte BLUE = 48;
               public static final byte DARK_BROWN = 52;
          +
               /**
                * Resize an image to 128x128.
          +     *
                * @param image The image to resize.
                * @return The resized image.
                */
          @@ -82,6 +82,7 @@ public final class MapPalette {
           
               /**
                * Convert an Image to a byte[] using the palette.
          +     *
                * @param image The image to convert.
                * @return A byte[] containing the pixels of the image.
                */
          @@ -90,10 +91,10 @@ public final class MapPalette {
                   Graphics2D graphics = temp.createGraphics();
                   graphics.drawImage(image, 0, 0, null);
                   graphics.dispose();
          -        
          +
                   int[] pixels = new int[temp.getWidth() * temp.getHeight()];
                   temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
          -        
          +
                   byte[] result = new byte[temp.getWidth() * temp.getHeight()];
                   for (int i = 0; i < pixels.length; i++) {
                       result[i] = matchColor(new Color(pixels[i]));
          @@ -103,6 +104,7 @@ public final class MapPalette {
           
               /**
                * Get the index of the closest matching color in the palette to the given color.
          +     *
                * @param r The red component of the color.
                * @param b The blue component of the color.
                * @param g The green component of the color.
          @@ -111,18 +113,19 @@ public final class MapPalette {
               public static byte matchColor(int r, int g, int b) {
                   return matchColor(new Color(r, g, b));
               }
          -    
          +
               /**
                * Get the index of the closest matching color in the palette to the given color.
          +     *
                * @param color The Color to match.
                * @return The index in the palette.
                */
               public static byte matchColor(Color color) {
                   if (color.getAlpha() < 128) return 0;
          -        
          +
                   int index = 0;
                   double best = -1;
          -        
          +
                   for (int i = 4; i < colors.length; i++) {
                       double distance = getDistance(color, colors[i]);
                       if (distance < best || best == -1) {
          @@ -133,9 +136,10 @@ public final class MapPalette {
           
                   return (byte) index;
               }
          -    
          +
               /**
                * Get the value of the given color in the palette.
          +     *
                * @param index The index in the palette.
                * @return The Color of the palette entry.
                */
          @@ -146,5 +150,5 @@ public final class MapPalette {
                       return colors[index];
                   }
               }
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MapRenderer.java b/src/main/java/org/bukkit/map/MapRenderer.java
          index 2c1d00a6..342c9f8b 100644
          --- a/src/main/java/org/bukkit/map/MapRenderer.java
          +++ b/src/main/java/org/bukkit/map/MapRenderer.java
          @@ -6,45 +6,49 @@ import org.bukkit.entity.Player;
            * Represents a renderer for a map.
            */
           public abstract class MapRenderer {
          -    
          +
               private boolean contextual;
          -    
          +
               /**
                * Initialize the map renderer base to be non-contextual. See {@link #isContextual()}.
                */
               public MapRenderer() {
                   this(false);
               }
          -    
          +
               /**
                * Initialize the map renderer base with the given contextual status.
          +     *
                * @param contextual Whether the renderer is contextual. See {@link #isContextual()}.
                */
               public MapRenderer(boolean contextual) {
                   this.contextual = contextual;
               }
          -    
          +
               /**
                * Get whether the renderer is contextual, i.e. has different canvases for
                * different players.
          +     *
                * @return True if contextual, false otherwise.
                */
               final public boolean isContextual() {
                   return contextual;
               }
          -    
          +
               /**
                * Initialize this MapRenderer for the given map.
          +     *
                * @param map The MapView being initialized.
                */
               public void initialize(MapView map) { }
          -    
          +
               /**
                * Render to the given map.
          +     *
                * @param map The MapView being rendered to.
                * @param canvas The canvas to use for rendering.
                * @param player The player who triggered the rendering.
                */
               abstract public void render(MapView map, MapCanvas canvas, Player player);
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java
          index b0811f80..821afd69 100644
          --- a/src/main/java/org/bukkit/map/MapView.java
          +++ b/src/main/java/org/bukkit/map/MapView.java
          @@ -7,7 +7,7 @@ import org.bukkit.World;
            * Represents a map item.
            */
           public interface MapView {
          -    
          +
               /**
                * An enum representing all possible scales a map can be set to.
                */
          @@ -17,120 +17,135 @@ public interface MapView {
                   NORMAL(2),
                   FAR(3),
                   FARTHEST(4);
          -        
          +
                   private byte value;
          -        
          +
                   private Scale(int value) {
                       this.value = (byte) value;
                   }
          -        
          +
                   /**
                    * Get the scale given the raw value.
          +         *
                    * @param value The raw scale
                    * @return The enum scale, or null for an invalid input
                    */
                   public static Scale valueOf(byte value) {
          -            switch(value) {
          -                case 0: return CLOSEST;
          -                case 1: return CLOSE;
          -                case 2: return NORMAL;
          -                case 3: return FAR;
          -                case 4: return FARTHEST;
          -                default: return null;
          +            switch (value) {
          +            case 0: return CLOSEST;
          +            case 1: return CLOSE;
          +            case 2: return NORMAL;
          +            case 3: return FAR;
          +            case 4: return FARTHEST;
          +            default: return null;
                       }
                   }
          -        
          +
                   /**
                    * Get the raw value of this scale level.
          +         *
                    * @return The scale value
                    */
                   public byte getValue() {
                       return value;
                   }
               }
          -    
          +
               /**
                * Get the ID of this map item. Corresponds to the damage value of a map
                * in an inventory.
          +     *
                * @return The ID of the map.
                */
               public short getId();
          -    
          +
               /**
                * Check whether this map is virtual. A map is virtual if its lowermost
                * MapRenderer is plugin-provided.
          +     *
                * @return Whether the map is virtual.
                */
               public boolean isVirtual();
          -    
          +
               /**
                * Get the scale of this map.
          +     *
                * @return The scale of the map.
                */
               public Scale getScale();
          -    
          +
               /**
                * Set the scale of this map.
          +     *
                * @param scale The scale to set.
                */
               public void setScale(Scale scale);
          -    
          +
               /**
                * Get the center X position of this map.
          +     *
                * @return The center X position.
                */
               public int getCenterX();
          -    
          +
               /**
                * Get the center Z position of this map.
          +     *
                * @return The center Z position.
                */
               public int getCenterZ();
          -    
          +
               /**
                * Set the center X position of this map.
          +     *
                * @param x The center X position.
                */
               public void setCenterX(int x);
          -    
          +
               /**
                * Set the center Z position of this map.
          +     *
                * @param z The center Z position.
                */
               public void setCenterZ(int z);
          -    
          +
               /**
                * Get the world that this map is associated with. Primarily used by the
                * internal renderer, but may be used by external renderers. May return
                * null if the world the map is associated with is not loaded.
          +     *
                * @return The World this map is associated with.
                */
               public World getWorld();
          -    
          +
               /**
                * Set the world that this map is associated with. The world is used by
                * the internal renderer, and may also be used by external renderers.
          +     *
                * @param world The World to associate this map with.
                */
               public void setWorld(World world);
          -    
          +
               /**
                * Get a list of MapRenderers currently in effect.
          +     *
                * @return A List containing each map renderer.
                */
               public List getRenderers();
          -    
          +
               /**
                * Add a renderer to this map.
          +     *
                * @param renderer The MapRenderer to add.
                */
               public void addRenderer(MapRenderer renderer);
          -    
          +
               /**
                * Remove a renderer from this map.
          +     *
                * @param renderer The MapRenderer to remove.
                * @return True if the renderer was successfully removed.
                */
               public boolean removeRenderer(MapRenderer renderer);
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/map/MinecraftFont.java b/src/main/java/org/bukkit/map/MinecraftFont.java
          index d84d5c2f..9ec8d10f 100644
          --- a/src/main/java/org/bukkit/map/MinecraftFont.java
          +++ b/src/main/java/org/bukkit/map/MinecraftFont.java
          @@ -4,9 +4,9 @@ package org.bukkit.map;
            * Represents the built-in Minecraft font.
            */
           public class MinecraftFont extends MapFont {
          -    
          +
               private static final int spaceSize = 2;
          -    
          +
               private static final String fontChars =
                   " !\"#$%&'()*+,-./0123456789:;<=>?" +
                   "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" +
          @@ -17,7 +17,7 @@ public class MinecraftFont extends MapFont {
                   "\u00FF\u00D6\u00DC\u00F8\u00A3\u00D8\u00D7\u0191" + // ÿÖÜø£Ø׃
                   "\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA" + // áíóúñѪº
                   "\u00BF\u00AE\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB";  // ¿®¬½¼¡«»
          -    
          +
               private static final int[][] fontData = new int[][] {
                   /* null */  {0,0,0,0,0,0,0,0},
                   /* 1 */  {126,129,165,129,189,153,129,126},
          @@ -276,31 +276,31 @@ public class MinecraftFont extends MapFont {
                   /* 254 */  {0,0,60,60,60,60,0,0},
                   /* 255 */  {0,0,0,0,0,0,0,0},
               };
          -    
          +
               /**
                * A static non-malleable MinecraftFont.
                */
               public static final MinecraftFont Font = new MinecraftFont(false);
          -    
          +
               /**
                * Initialize a new MinecraftFont.
                */
               public MinecraftFont() {
                   this(true);
               }
          -    
          +
               private MinecraftFont(boolean malleable) {
                   for (int i = 1; i < fontData.length; ++i) {
                       char ch = (char) i;
                       if (i >= 32 && i < 32 + fontChars.length()) {
                           ch = fontChars.charAt(i - 32);
                       }
          -            
          +
                       if (ch == ' ') {
                           setChar(ch, new CharacterSprite(spaceSize, 8, new boolean[spaceSize * 8]));
                           continue;
                       }
          -            
          +
                       int[] rows = fontData[i];
                       int width = 0;
                       for (int r = 0; r < 8; ++r) {
          @@ -311,18 +311,18 @@ public class MinecraftFont extends MapFont {
                           }
                       }
                       ++width;
          -            
          +
                       boolean[] data = new boolean[width * 8];
                       for (int r = 0; r < 8; ++r) {
                           for (int c = 0; c < width; ++c) {
                               data[r * width + c] = (rows[r] & (1 << c)) != 0;
                           }
                       }
          -            
          +
                       setChar(ch, new CharacterSprite(width, 8, data));
                   }
          -        
          +
                   this.malleable = malleable;
               }
          -    
          +
           }
          diff --git a/src/main/java/org/bukkit/material/Bed.java b/src/main/java/org/bukkit/material/Bed.java
          index fe40c100..f763ac26 100644
          --- a/src/main/java/org/bukkit/material/Bed.java
          +++ b/src/main/java/org/bukkit/material/Bed.java
          @@ -17,6 +17,7 @@ public class Bed extends MaterialData implements Directional {
           
               /**
                * Instantiate a bed facing in a particular direction.
          +     *
                * @param direction the direction the bed's head is facing
                */
               public Bed(BlockFace direction) {
          @@ -51,6 +52,7 @@ public class Bed extends MaterialData implements Directional {
           
               /**
                * Configure this to be either the head or the foot of the bed
          +     *
                * @param isHeadOfBed True to make it the head.
                */
               public void setHeadOfBed(boolean isHeadOfBed) {
          diff --git a/src/main/java/org/bukkit/material/Directional.java b/src/main/java/org/bukkit/material/Directional.java
          index 2d44baa1..25624d26 100644
          --- a/src/main/java/org/bukkit/material/Directional.java
          +++ b/src/main/java/org/bukkit/material/Directional.java
          @@ -6,6 +6,7 @@ public interface Directional {
           
               /**
                * Sets the direction that this block is facing in
          +     *
                * @param face The facing direction
                */
               public void setFacingDirection(BlockFace face);
          diff --git a/src/main/java/org/bukkit/material/Door.java b/src/main/java/org/bukkit/material/Door.java
          index 2938ac36..5086555e 100644
          --- a/src/main/java/org/bukkit/material/Door.java
          +++ b/src/main/java/org/bukkit/material/Door.java
          @@ -29,6 +29,7 @@ public class Door extends MaterialData implements Directional {
           
               /**
                * Check to see if the door is open.
          +     *
                * @return true if the door has swung counterclockwise around its hinge.
                */
               public boolean isOpen() {
          @@ -37,6 +38,7 @@ public class Door extends MaterialData implements Directional {
           
               /**
                * Configure this door to be either open or closed;
          +     *
                * @param isOpen True to open the door.
                */
               public void setOpen(boolean isOpen) {
          @@ -52,6 +54,7 @@ public class Door extends MaterialData implements Directional {
           
               /**
                * Configure this part of the door to be either the top or the bottom half;
          +     *
                * @param isTopHalf True to make it the top half.
                */
               public void setTopHalf(boolean isTopHalf) {
          @@ -82,6 +85,7 @@ public class Door extends MaterialData implements Directional {
           
               /**
                * Set the direction that this door should is facing.
          +     *
                * @param face the direction
                */
               public void setFacingDirection(BlockFace face) {
          @@ -104,6 +108,7 @@ public class Door extends MaterialData implements Directional {
           
               /**
                * Get the direction that this door is facing.
          +     *
                * @return the direction
                */
               public BlockFace getFacing() {
          diff --git a/src/main/java/org/bukkit/material/Furnace.java b/src/main/java/org/bukkit/material/Furnace.java
          index b80fe53a..dad56bc4 100644
          --- a/src/main/java/org/bukkit/material/Furnace.java
          +++ b/src/main/java/org/bukkit/material/Furnace.java
          @@ -14,6 +14,7 @@ public class Furnace extends FurnaceAndDispenser {
           
               /**
                * Instantiate a furnace facing in a particular direction.
          +     *
                * @param direction the direction the furnace's "opening" is facing
                */
               public Furnace(BlockFace direction) {
          diff --git a/src/main/java/org/bukkit/material/Lever.java b/src/main/java/org/bukkit/material/Lever.java
          index 6101fa4e..369d16de 100644
          --- a/src/main/java/org/bukkit/material/Lever.java
          +++ b/src/main/java/org/bukkit/material/Lever.java
          @@ -39,6 +39,7 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
           
               /**
                * Set this lever to be powered or not.
          +     *
                * @param isPowered whether the lever should be powered or not
                */
               public void setPowered(boolean isPowered) {
          diff --git a/src/main/java/org/bukkit/material/PistonBaseMaterial.java b/src/main/java/org/bukkit/material/PistonBaseMaterial.java
          index 4a219bb4..c2a30e1a 100644
          --- a/src/main/java/org/bukkit/material/PistonBaseMaterial.java
          +++ b/src/main/java/org/bukkit/material/PistonBaseMaterial.java
          @@ -1,4 +1,3 @@
          -
           package org.bukkit.material;
           
           import org.bukkit.Material;
          @@ -25,46 +24,46 @@ public class PistonBaseMaterial extends MaterialData implements Directional, Red
               }
           
               public void setFacingDirection(BlockFace face) {
          -        byte data = (byte)(getData() & 0x8);
          +        byte data = (byte) (getData() & 0x8);
           
                   switch (face) {
          -            case UP:
          -                data |= 1;
          -                break;
          -            case EAST:
          -                data |= 2;
          -                break;
          -            case WEST:
          -                data |= 3;
          -                break;
          -            case NORTH:
          -                data |= 4;
          -                break;
          -            case SOUTH:
          -                data |= 5;
          -                break;
          +        case UP:
          +            data |= 1;
          +            break;
          +        case EAST:
          +            data |= 2;
          +            break;
          +        case WEST:
          +            data |= 3;
          +            break;
          +        case NORTH:
          +            data |= 4;
          +            break;
          +        case SOUTH:
          +            data |= 5;
          +            break;
                   }
                   setData(data);
               }
           
               public BlockFace getFacing() {
          -        byte dir = (byte)(getData() & 7);
          +        byte dir = (byte) (getData() & 7);
           
                   switch (dir) {
          -            case 0:
          -                return BlockFace.DOWN;
          -            case 1:
          -                return BlockFace.UP;
          -            case 2:
          -                return BlockFace.EAST;
          -            case 3:
          -                return BlockFace.WEST;
          -            case 4:
          -                return BlockFace.NORTH;
          -            case 5:
          -                return BlockFace.SOUTH;
          -            default:
          -                return BlockFace.SELF;
          +        case 0:
          +            return BlockFace.DOWN;
          +        case 1:
          +            return BlockFace.UP;
          +        case 2:
          +            return BlockFace.EAST;
          +        case 3:
          +            return BlockFace.WEST;
          +        case 4:
          +            return BlockFace.NORTH;
          +        case 5:
          +            return BlockFace.SOUTH;
          +        default:
          +            return BlockFace.SELF;
                   }
               }
           
          diff --git a/src/main/java/org/bukkit/material/PistonExtensionMaterial.java b/src/main/java/org/bukkit/material/PistonExtensionMaterial.java
          index 2d727a94..47edc5cd 100644
          --- a/src/main/java/org/bukkit/material/PistonExtensionMaterial.java
          +++ b/src/main/java/org/bukkit/material/PistonExtensionMaterial.java
          @@ -1,4 +1,3 @@
          -
           package org.bukkit.material;
           
           import org.bukkit.Material;
          @@ -25,46 +24,46 @@ public class PistonExtensionMaterial extends MaterialData implements Attachable
               }
           
               public void setFacingDirection(BlockFace face) {
          -        byte data = (byte)(getData() & 0x8);
          +        byte data = (byte) (getData() & 0x8);
           
                   switch (face) {
          -            case UP:
          -                data |= 1;
          -                break;
          -            case EAST:
          -                data |= 2;
          -                break;
          -            case WEST:
          -                data |= 3;
          -                break;
          -            case NORTH:
          -                data |= 4;
          -                break;
          -            case SOUTH:
          -                data |= 5;
          -                break;
          +        case UP:
          +            data |= 1;
          +            break;
          +        case EAST:
          +            data |= 2;
          +            break;
          +        case WEST:
          +            data |= 3;
          +            break;
          +        case NORTH:
          +            data |= 4;
          +            break;
          +        case SOUTH:
          +            data |= 5;
          +            break;
                   }
                   setData(data);
               }
           
               public BlockFace getFacing() {
          -        byte dir = (byte)(getData() & 7);
          +        byte dir = (byte) (getData() & 7);
           
                   switch (dir) {
          -            case 0:
          -                return BlockFace.DOWN;
          -            case 1:
          -                return BlockFace.UP;
          -            case 2:
          -                return BlockFace.EAST;
          -            case 3:
          -                return BlockFace.WEST;
          -            case 4:
          -                return BlockFace.NORTH;
          -            case 5:
          -                return BlockFace.SOUTH;
          -            default:
          -                return BlockFace.SELF;
          +        case 0:
          +            return BlockFace.DOWN;
          +        case 1:
          +            return BlockFace.UP;
          +        case 2:
          +            return BlockFace.EAST;
          +        case 3:
          +            return BlockFace.WEST;
          +        case 4:
          +            return BlockFace.NORTH;
          +        case 5:
          +            return BlockFace.SOUTH;
          +        default:
          +            return BlockFace.SELF;
                   }
               }
           
          diff --git a/src/main/java/org/bukkit/material/PoweredRail.java b/src/main/java/org/bukkit/material/PoweredRail.java
          index 27c19c89..857c4499 100644
          --- a/src/main/java/org/bukkit/material/PoweredRail.java
          +++ b/src/main/java/org/bukkit/material/PoweredRail.java
          @@ -32,6 +32,7 @@ public class PoweredRail extends ExtendedRails implements Redstone {
           
               /**
                * Set whether this PoweredRail should be powered or not.
          +     *
                * @param isPowered whether or not the rail is powered
                */
               public void setPowered(boolean isPowered) {
          diff --git a/src/main/java/org/bukkit/material/Pumpkin.java b/src/main/java/org/bukkit/material/Pumpkin.java
          index 4e08becf..78ec3aa0 100644
          --- a/src/main/java/org/bukkit/material/Pumpkin.java
          +++ b/src/main/java/org/bukkit/material/Pumpkin.java
          @@ -14,6 +14,7 @@ public class Pumpkin extends MaterialData implements Directional {
           
               /**
                * Instantiate a pumpkin facing in a particular direction.
          +     *
                * @param direction the direction the pumkin's face is facing
                */
               public Pumpkin(BlockFace direction) {
          diff --git a/src/main/java/org/bukkit/material/Rails.java b/src/main/java/org/bukkit/material/Rails.java
          index 3d6a959e..cfe812fc 100644
          --- a/src/main/java/org/bukkit/material/Rails.java
          +++ b/src/main/java/org/bukkit/material/Rails.java
          @@ -97,6 +97,7 @@ public class Rails extends MaterialData {
           
               /**
                * Return the data without the extended properties used by {@link PoweredRail} and {@link DetectorRail}. Overridden in {@link ExtendedRails}
          +     *
                * @return the data without the extended part
                */
               protected byte getConvertedData() {
          @@ -105,10 +106,11 @@ public class Rails extends MaterialData {
           
               /**
                * Set the direction of these tracks
          - * Note that tracks are bidirectional and that the direction - * returned is the ascending direction if the track is set on a - * slope. If it is set as a curve, the corner of the track should - * be supplied. + * Note that tracks are bidirectional and that the direction + * returned is the ascending direction if the track is set on a + * slope. If it is set as a curve, the corner of the track should + * be supplied. + * * @param face the direction the track should be facing * @param isOnSlope whether or not the track should be on a slope */ diff --git a/src/main/java/org/bukkit/material/TexturedMaterial.java b/src/main/java/org/bukkit/material/TexturedMaterial.java index 59de8be5..93b13d72 100644 --- a/src/main/java/org/bukkit/material/TexturedMaterial.java +++ b/src/main/java/org/bukkit/material/TexturedMaterial.java @@ -27,14 +27,14 @@ public abstract class TexturedMaterial extends MaterialData { /** * Retrieve a list of possible textures. The first element of the list will be used as a default. - * + * * @return a list of possible textures for this block */ public abstract List getTextures(); /** * Gets the current Material this block is made of - * + * * @return Material of this block */ public Material getMaterial() { @@ -42,13 +42,13 @@ public abstract class TexturedMaterial extends MaterialData { if (n > getTextures().size() - 1) { n = 0; } - + return getTextures().get(n); } /** * Sets the material this block is made of - * + * * @param material * New material of this block */ diff --git a/src/main/java/org/bukkit/material/TrapDoor.java b/src/main/java/org/bukkit/material/TrapDoor.java index b16835db..2fa9b590 100644 --- a/src/main/java/org/bukkit/material/TrapDoor.java +++ b/src/main/java/org/bukkit/material/TrapDoor.java @@ -40,17 +40,17 @@ public class TrapDoor extends SimpleAttachableMaterialData { byte data = (byte) (getData() & 0x3); switch (data) { - case 0x0: - return BlockFace.WEST; + case 0x0: + return BlockFace.WEST; - case 0x1: - return BlockFace.EAST; + case 0x1: + return BlockFace.EAST; - case 0x2: - return BlockFace.SOUTH; + case 0x2: + return BlockFace.SOUTH; - case 0x3: - return BlockFace.NORTH; + case 0x3: + return BlockFace.NORTH; } return null; @@ -61,15 +61,15 @@ public class TrapDoor extends SimpleAttachableMaterialData { byte data = (byte) (getData() & 0x4); switch (face) { - case WEST: - data |= 0x1; - break; - case NORTH: - data |= 0x2; - break; - case SOUTH: - data |= 0x3; - break; + case WEST: + data |= 0x1; + break; + case NORTH: + data |= 0x2; + break; + case SOUTH: + data |= 0x3; + break; } setData(data); diff --git a/src/main/java/org/bukkit/permissions/Permissible.java b/src/main/java/org/bukkit/permissions/Permissible.java index a7f61773..cbbafe5a 100644 --- a/src/main/java/org/bukkit/permissions/Permissible.java +++ b/src/main/java/org/bukkit/permissions/Permissible.java @@ -1,4 +1,3 @@ - package org.bukkit.permissions; import java.util.Set; diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java index 6da5663b..d0b6a5a6 100644 --- a/src/main/java/org/bukkit/permissions/PermissibleBase.java +++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java @@ -23,12 +23,12 @@ public class PermissibleBase implements Permissible { this.opable = opable; if (opable instanceof Permissible) { - this.parent = (Permissible)opable; + this.parent = (Permissible) opable; } recalculatePermissions(); } - + public boolean isOp() { if (opable == null) { return false; @@ -90,11 +90,8 @@ public class PermissibleBase implements Permissible { if (isPermissionSet(name)) { return permissions.get(name).getValue(); - } else if (perm != null) { - return perm.getDefault().getValue(isOp()); - } else { - return Permission.DEFAULT_PERMISSION.getValue(isOp()); } + return perm.getDefault().getValue(isOp()); } public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { diff --git a/src/main/java/org/bukkit/permissions/Permission.java b/src/main/java/org/bukkit/permissions/Permission.java index bfb4adec..ecd6eac1 100644 --- a/src/main/java/org/bukkit/permissions/Permission.java +++ b/src/main/java/org/bukkit/permissions/Permission.java @@ -1,4 +1,3 @@ - package org.bukkit.permissions; import java.util.ArrayList; @@ -53,7 +52,7 @@ public class Permission { this.name = name; this.description = (description == null) ? "" : description; this.defaultValue = (defaultValue == null) ? PermissionDefault.FALSE : defaultValue; - + if (children != null) { this.children.putAll(children); } @@ -282,7 +281,7 @@ public class Permission { if (data.containsKey("description")) { try { - desc = (String)data.get("description"); + desc = (String) data.get("description"); } catch (ClassCastException ex) { throw new IllegalArgumentException("'description' key is of wrong type", ex); } @@ -295,7 +294,7 @@ public class Permission { Object parents = data.get("parents"); if (parents instanceof String) { - result.addParent((String)parents, true); + result.addParent((String) parents, true); } } catch (ClassCastException ex) { throw new IllegalArgumentException("'parents' key is of wrong type", ex); @@ -305,33 +304,31 @@ public class Permission { return result; } - + @SuppressWarnings("unchecked") private static Map extractChildren(Map data, String name, PermissionDefault def, List output) { - Map input = (Map)data.get("children"); - Map children = new LinkedHashMap(); + Map input = (Map) data.get("children"); + Map children = new LinkedHashMap(); for (Map.Entry entry : input.entrySet()) { if ((entry.getValue() instanceof Boolean)) { - children.put(entry.getKey(), (Boolean)entry.getValue()); + children.put(entry.getKey(), (Boolean) entry.getValue()); } else if ((entry.getValue() instanceof Map)) { try { - try - { - Permission perm = loadPermission((String)entry.getKey(), (Map)entry.getValue(), def, output); + try { + Permission perm = loadPermission((String) entry.getKey(), (Map) entry.getValue(), def, output); children.put(perm.getName(), Boolean.valueOf(true)); if (output != null) { output.add(perm); } - } - catch (Throwable ex) { - Bukkit.getServer().getLogger().log(Level.SEVERE, "Permission node '" + (String)entry.getKey() + "' in child of " + name + " is invalid", ex); + } catch (Throwable ex) { + Bukkit.getServer().getLogger().log(Level.SEVERE, "Permission node '" + (String) entry.getKey() + "' in child of " + name + " is invalid", ex); } } catch (ClassCastException ex) { - throw new IllegalArgumentException("Child '" + (String)entry.getKey() + "' contains invalid map type"); + throw new IllegalArgumentException("Child '" + (String) entry.getKey() + "' contains invalid map type"); } } else { - throw new IllegalArgumentException("Child '" + (String)entry.getKey() + "' contains invalid value"); + throw new IllegalArgumentException("Child '" + (String) entry.getKey() + "' contains invalid value"); } } diff --git a/src/main/java/org/bukkit/permissions/PermissionAttachment.java b/src/main/java/org/bukkit/permissions/PermissionAttachment.java index d5cfeb20..30ad37b8 100644 --- a/src/main/java/org/bukkit/permissions/PermissionAttachment.java +++ b/src/main/java/org/bukkit/permissions/PermissionAttachment.java @@ -1,4 +1,3 @@ - package org.bukkit.permissions; import java.util.LinkedHashMap; diff --git a/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java b/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java index b43190d4..77f49172 100644 --- a/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java +++ b/src/main/java/org/bukkit/permissions/PermissionAttachmentInfo.java @@ -1,4 +1,3 @@ - package org.bukkit.permissions; /** diff --git a/src/main/java/org/bukkit/permissions/PermissionDefault.java b/src/main/java/org/bukkit/permissions/PermissionDefault.java index 78ff2f98..eb507c4c 100644 --- a/src/main/java/org/bukkit/permissions/PermissionDefault.java +++ b/src/main/java/org/bukkit/permissions/PermissionDefault.java @@ -27,16 +27,16 @@ public enum PermissionDefault { */ public boolean getValue(boolean op) { switch (this) { - case TRUE: - return true; - case FALSE: - return false; - case OP: - return op; - case NOT_OP: - return !op; - default: - return false; + case TRUE: + return true; + case FALSE: + return false; + case OP: + return op; + case NOT_OP: + return !op; + default: + return false; } } @@ -54,7 +54,7 @@ public enum PermissionDefault { public String toString() { return names[0]; } - + static { for (PermissionDefault value : values()) { for (String name : value.names) { diff --git a/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java b/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java index 7dc09125..a9543cf8 100644 --- a/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java +++ b/src/main/java/org/bukkit/permissions/PermissionRemovedExecutor.java @@ -1,4 +1,3 @@ - package org.bukkit.permissions; /** diff --git a/src/main/java/org/bukkit/plugin/AuthorNagException.java b/src/main/java/org/bukkit/plugin/AuthorNagException.java index 838b4455..6565a441 100644 --- a/src/main/java/org/bukkit/plugin/AuthorNagException.java +++ b/src/main/java/org/bukkit/plugin/AuthorNagException.java @@ -1,5 +1,6 @@ package org.bukkit.plugin; +@SuppressWarnings("serial") public class AuthorNagException extends RuntimeException { private final String message; diff --git a/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java b/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java index 88e6cb7e..4e60e208 100644 --- a/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java +++ b/src/main/java/org/bukkit/plugin/IllegalPluginAccessException.java @@ -3,6 +3,7 @@ package org.bukkit.plugin; /** * Thrown when a plugin attempts to interact with the server when it is not enabled */ +@SuppressWarnings("serial") public class IllegalPluginAccessException extends RuntimeException { /** @@ -12,6 +13,7 @@ public class IllegalPluginAccessException extends RuntimeException { /** * Constructs an instance of IllegalPluginAccessException with the specified detail message. + * * @param msg the detail message. */ public IllegalPluginAccessException(String msg) { diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java index ff867e19..4bf8c11d 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java +++ b/src/main/java/org/bukkit/plugin/Plugin.java @@ -35,25 +35,25 @@ public interface Plugin extends CommandExecutor { * @return The configuration */ public Configuration getConfiguration(); - + /** * Gets a {@link FileConfiguration} for this plugin, read through "config.yml" *

          * If there is a default config.yml embedded in this plugin, it will be provided * as a default for this Configuration. - * + * * @return Plugin configuration */ public FileConfiguration getConfig(); - + /** * Gets an embedded resource in this plugin - * + * * @param filename Filename of the resource * @return File if found, otherwise null */ public InputStream getResource(String filename); - + /** * Saves the {@link FileConfiguration} retrievable by {@link #getConfig()}. */ @@ -69,13 +69,13 @@ public interface Plugin extends CommandExecutor { * Saves the raw contents of any resource embedded with a plugin's .jar file assuming it can be found using * {@link #getResource(String)}. The resource is saved into the plugin's data folder using the same hierarchy * as the .jar file (subdirectories are preserved). - * + * * @param resourcePath the embedded resource path to look for within the plugin's .jar file. (No preceding slash). * @param replace if true, the embedded resource will overwrite the contents of an existing file. * @throws IllegalArgumentException if the resource path is null, empty, or points to a nonexistent resource. */ public void saveResource(String resourcePath, boolean replace); - + /** * Discards any data in {@link #getConfig()} and reloads from disk. */ @@ -120,12 +120,14 @@ public interface Plugin extends CommandExecutor { /** * Simple boolean if we can still nag to the logs about things + * * @return boolean whether we can nag */ public boolean isNaggable(); /** * Set naggable state + * * @param canNag is this plugin still naggable? */ public void setNaggable(boolean canNag); diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java index f3f864d8..6469ed68 100644 --- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java @@ -38,6 +38,7 @@ public final class PluginDescriptionFile { /** * Loads a PluginDescriptionFile from the specified reader + * * @param reader The reader * @throws InvalidDescriptionException If the PluginDescriptionFile is invalid */ @@ -153,6 +154,7 @@ public final class PluginDescriptionFile { return defaultPerm; } + @SuppressWarnings("unchecked") private void loadMap(Map map) throws InvalidDescriptionException { try { name = map.get("name").toString(); @@ -235,7 +237,7 @@ public final class PluginDescriptionFile { if (map.containsKey("load")) { try { - order = PluginLoadOrder.valueOf(((String)map.get("load")).toUpperCase().replaceAll("\\W", "")); + order = PluginLoadOrder.valueOf(((String) map.get("load")).toUpperCase().replaceAll("\\W", "")); } catch (ClassCastException ex) { throw new InvalidDescriptionException(ex, "load is of wrong type"); } catch (IllegalArgumentException ex) { @@ -265,7 +267,7 @@ public final class PluginDescriptionFile { if (map.containsKey("default-permission")) { try { - defaultPerm = defaultPerm.getByName((String)map.get("default-permission")); + defaultPerm = PermissionDefault.getByName((String) map.get("default-permission")); } catch (ClassCastException ex) { throw new InvalidDescriptionException(ex, "default-permission is of wrong type"); } catch (IllegalArgumentException ex) { @@ -275,9 +277,9 @@ public final class PluginDescriptionFile { if (map.containsKey("permissions")) { try { - Map> perms = (Map>) map.get("permissions"); + Map> perms = (Map>) map.get("permissions"); - permissions = Permission.loadPermissions(perms, "Permission node '%s' in plugin description file for " + getFullName() + " is invalid", defaultPerm); + permissions = Permission.loadPermissions(perms, "Permission node '%s' in plugin description file for " + getFullName() + " is invalid", defaultPerm); } catch (ClassCastException ex) { throw new InvalidDescriptionException(ex, "permissions are of wrong type"); } diff --git a/src/main/java/org/bukkit/plugin/PluginLoadOrder.java b/src/main/java/org/bukkit/plugin/PluginLoadOrder.java index c1ae4be4..bd647230 100644 --- a/src/main/java/org/bukkit/plugin/PluginLoadOrder.java +++ b/src/main/java/org/bukkit/plugin/PluginLoadOrder.java @@ -1,4 +1,3 @@ - package org.bukkit.plugin; /** diff --git a/src/main/java/org/bukkit/plugin/PluginLoader.java b/src/main/java/org/bukkit/plugin/PluginLoader.java index 43e29fdb..5144d710 100644 --- a/src/main/java/org/bukkit/plugin/PluginLoader.java +++ b/src/main/java/org/bukkit/plugin/PluginLoader.java @@ -17,7 +17,7 @@ public interface PluginLoader { * * @param file File to attempt to load * @return Plugin that was contained in the specified file, or null if - * unsuccessful + * unsuccessful * @throws InvalidPluginException Thrown when the specified file is not a plugin * @throws InvalidDescriptionException If the plugin description file was invalid * @throws UnknownDependencyException If a required dependency could not be found @@ -30,7 +30,7 @@ public interface PluginLoader { * @param file File to attempt to load * @param ignoreSoftDependencies Loader will ignore soft dependencies if this flag is set to true * @return Plugin that was contained in the specified file, or null if - * unsuccessful + * unsuccessful * @throws InvalidPluginException Thrown when the specified file is not a plugin * @throws InvalidDescriptionException If the plugin description file was invalid * @throws UnknownDependencyException If a required dependency could not be found @@ -39,6 +39,7 @@ public interface PluginLoader { /** * Returns a list of all filename filters expected by this PluginLoader + * * @return The filters */ public Pattern[] getPluginFileFilters(); diff --git a/src/main/java/org/bukkit/plugin/RegisteredListener.java b/src/main/java/org/bukkit/plugin/RegisteredListener.java index dc74c143..4f7e7bf2 100644 --- a/src/main/java/org/bukkit/plugin/RegisteredListener.java +++ b/src/main/java/org/bukkit/plugin/RegisteredListener.java @@ -28,6 +28,7 @@ public class RegisteredListener { /** * Gets the listener for this registration + * * @return Registered Listener */ public Listener getListener() { @@ -36,6 +37,7 @@ public class RegisteredListener { /** * Gets the plugin for this registration + * * @return Registered Plugin */ public Plugin getPlugin() { @@ -44,6 +46,7 @@ public class RegisteredListener { /** * Gets the priority for this registration + * * @return Registered Priority */ public Event.Priority getPriority() { @@ -52,6 +55,7 @@ public class RegisteredListener { /** * Calls the event executor + * * @param event The event */ public void callEvent(Event event) { diff --git a/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java b/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java index 71ad64e7..ba3ff15e 100644 --- a/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java +++ b/src/main/java/org/bukkit/plugin/RegisteredServiceProvider.java @@ -2,7 +2,7 @@ package org.bukkit.plugin; /** * A registered service provider. - * + * * @param Service */ public class RegisteredServiceProvider implements Comparable> { @@ -12,8 +12,7 @@ public class RegisteredServiceProvider implements Comparable service, T provider, - ServicePriority priority, Plugin plugin) { + public RegisteredServiceProvider(Class service, T provider, ServicePriority priority, Plugin plugin) { this.service = service; this.plugin = plugin; diff --git a/src/main/java/org/bukkit/plugin/ServicesManager.java b/src/main/java/org/bukkit/plugin/ServicesManager.java index 3d853a3f..c1a5fd65 100644 --- a/src/main/java/org/bukkit/plugin/ServicesManager.java +++ b/src/main/java/org/bukkit/plugin/ServicesManager.java @@ -22,8 +22,7 @@ public interface ServicesManager { * @param plugin plugin with the provider * @param priority priority of the provider */ - public void register(Class service, T provider, Plugin plugin, - ServicePriority priority); + public void register(Class service, T provider, Plugin plugin, ServicePriority priority); /** * Unregister all the providers registered by a particular plugin. @@ -83,8 +82,7 @@ public interface ServicesManager { * @param service The service interface * @return list of registrations */ - public Collection> getRegistrations( - Class service); + public Collection> getRegistrations(Class service); /** * Get a list of known services. A service is known if it has registered diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index a79c3583..f0888554 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -118,7 +118,7 @@ public final class SimplePluginManager implements PluginManager { boolean allFailed = false; boolean finalPass = false; - LinkedList filesList = new LinkedList(Arrays.asList(files)); + LinkedList filesList = new LinkedList(Arrays.asList(files)); if (!(server.getUpdateFolder().equals(""))) { updateDirectory = new File(directory, server.getUpdateFolder()); @@ -285,7 +285,7 @@ public final class SimplePluginManager implements PluginManager { } public void disablePlugins() { - for (Plugin plugin: getPlugins()) { + for (Plugin plugin : getPlugins()) { disablePlugin(plugin); } } diff --git a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java index c699d291..c0f0a54c 100644 --- a/src/main/java/org/bukkit/plugin/SimpleServicesManager.java +++ b/src/main/java/org/bukkit/plugin/SimpleServicesManager.java @@ -28,8 +28,7 @@ public class SimpleServicesManager implements ServicesManager { * @param plugin plugin with the provider * @param priority priority of the provider */ - public void register(Class service, T provider, - Plugin plugin, ServicePriority priority) { + public void register(Class service, T provider, Plugin plugin, ServicePriority priority) { synchronized (providers) { List> registered = providers.get(service); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java index 5ffde7ac..3b2b06e3 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -108,7 +108,7 @@ public abstract class JavaPlugin implements Plugin { * the configuration file will have no values. * * @return The configuration. - * @deprecated See the new + * @deprecated See the new */ @Deprecated public Configuration getConfiguration() { @@ -118,14 +118,14 @@ public abstract class JavaPlugin implements Plugin { } return config; } - + public FileConfiguration getConfig() { if (newConfig == null) { reloadConfig(); } return newConfig; } - + public void reloadConfig() { newConfig = YamlConfiguration.loadConfiguration(configFile); @@ -136,7 +136,7 @@ public abstract class JavaPlugin implements Plugin { newConfig.setDefaults(defConfig); } } - + public void saveConfig() { try { newConfig.save(configFile); @@ -150,36 +150,31 @@ public abstract class JavaPlugin implements Plugin { } public void saveResource(String resourcePath, boolean replace) { - if(resourcePath == null || resourcePath.equals("")) { + if (resourcePath == null || resourcePath.equals("")) { throw new IllegalArgumentException("ResourcePath cannot be null or empty"); } resourcePath = resourcePath.replace('\\', '/'); InputStream in = getResource(resourcePath); - if(in == null) { + if (in == null) { throw new IllegalArgumentException("The embedded resource '" + resourcePath + "' cannot be found in " + getFile()); } - File outFile = new File(getDataFolder(), resourcePath); + File outFile = new File(getDataFolder(), resourcePath); int lastIndex = resourcePath.lastIndexOf('/'); File outDir = new File(getDataFolder(), resourcePath.substring(0, lastIndex >= 0 ? lastIndex : 0)); - - - if(!outDir.exists()) { - outDir.mkdirs(); - } - if(in == null) { - in = new ByteArrayInputStream(new byte[0]); + if (!outDir.exists()) { + outDir.mkdirs(); } try { - if(!outFile.exists() || replace) { + if (!outFile.exists() || replace) { OutputStream out = new FileOutputStream(outFile); byte[] buf = new byte[1024]; int len; - while((len=in.read(buf))>0) { - out.write(buf,0,len); + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); } out.close(); in.close(); @@ -190,7 +185,7 @@ public abstract class JavaPlugin implements Plugin { Logger.getLogger(JavaPlugin.class.getName()).log(Level.SEVERE, "Could not save " + outFile.getName() + " to " + outFile, ex); } } - + public InputStream getResource(String filename) { if (filename == null) { throw new IllegalArgumentException("Filename cannot be null"); @@ -249,9 +244,7 @@ public abstract class JavaPlugin implements Plugin { * @param file File containing this plugin * @param classLoader ClassLoader which holds this plugin */ - protected final void initialize(PluginLoader loader, Server server, - PluginDescriptionFile description, File dataFolder, File file, - ClassLoader classLoader) { + protected final void initialize(PluginLoader loader, Server server, PluginDescriptionFile description, File dataFolder, File file, ClassLoader classLoader) { if (!initialized) { this.initialized = true; this.loader = loader; diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index 0bd5ec9a..0bb16653 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -51,6 +51,7 @@ public class JavaPluginLoader implements PluginLoader { return loadPlugin(file, false); } + @SuppressWarnings("unchecked") public Plugin loadPlugin(File file, boolean ignoreSoftDependencies) throws InvalidPluginException, InvalidDescriptionException, UnknownDependencyException { JavaPlugin result = null; PluginDescriptionFile description = null; @@ -117,7 +118,7 @@ public class JavaPluginLoader implements PluginLoader { ArrayList depend; try { - depend = (ArrayList) description.getDepend(); + depend = (ArrayList) description.getDepend(); if (depend == null) { depend = new ArrayList(); } @@ -140,7 +141,7 @@ public class JavaPluginLoader implements PluginLoader { ArrayList softDepend; try { - softDepend = (ArrayList) description.getSoftDepend(); + softDepend = (ArrayList) description.getSoftDepend(); if (softDepend == null) { softDepend = new ArrayList(); } @@ -231,20 +232,22 @@ public class JavaPluginLoader implements PluginLoader { public void setClass(final String name, final Class clazz) { if (!classes.containsKey(name)) { classes.put(name, clazz); - + if (ConfigurationSerializable.class.isAssignableFrom(clazz)) { - Class serializable = (Class)clazz; + @SuppressWarnings("unchecked") + Class serializable = (Class) clazz; ConfigurationSerialization.registerClass(serializable); } } } - + public void removeClass(String name) { Class clazz = classes.remove(name); try { if ((clazz != null) && (ConfigurationSerializable.class.isAssignableFrom(clazz))) { - Class serializable = (Class)clazz; + @SuppressWarnings("unchecked") + Class serializable = (Class) clazz; ConfigurationSerialization.unregisterClass(serializable); } } catch (NullPointerException ex) { @@ -407,11 +410,11 @@ public class JavaPluginLoader implements PluginLoader { }; case PLAYER_TOGGLE_SPRINT: - return new EventExecutor() { - public void execute(Listener listener, Event event) { - ((PlayerListener) listener).onPlayerToggleSprint((PlayerToggleSprintEvent) event); - } - }; + return new EventExecutor() { + public void execute(Listener listener, Event event) { + ((PlayerListener) listener).onPlayerToggleSprint((PlayerToggleSprintEvent) event); + } + }; case PLAYER_BUCKET_EMPTY: return new EventExecutor() { @@ -554,7 +557,6 @@ public class JavaPluginLoader implements PluginLoader { } }; - case BLOCK_FADE: return new EventExecutor() { public void execute(Listener listener, Event event) { @@ -829,7 +831,7 @@ public class JavaPluginLoader implements PluginLoader { public void execute(Listener listener, Event event) { ((EntityListener) listener).onFoodLevelChange((FoodLevelChangeEvent) event); } - }; + }; case SLIME_SPLIT: return new EventExecutor() { diff --git a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java index 5d087911..637d22e0 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitScheduler.java +++ b/src/main/java/org/bukkit/scheduler/BukkitScheduler.java @@ -77,7 +77,7 @@ public interface BukkitScheduler { * Calls a method on the main thread and returns a Future object * This task will be executed by the main server thread * - * Note: The Future.get() methods must NOT be called from the main thread + * Note: The Future.get() methods must NOT be called from the main thread * Note2: There is at least an average of 10ms latency until the isDone() method returns true * * @param The callable's return type @@ -142,7 +142,7 @@ public interface BukkitScheduler { public List getActiveWorkers(); /** - * Returns a list of all pending tasks. The ordering of the tasks is not related to their order of execution. + * Returns a list of all pending tasks. The ordering of the tasks is not related to their order of execution. * * @return Active workers */ diff --git a/src/main/java/org/bukkit/scheduler/BukkitWorker.java b/src/main/java/org/bukkit/scheduler/BukkitWorker.java index b85a01cd..3783608c 100644 --- a/src/main/java/org/bukkit/scheduler/BukkitWorker.java +++ b/src/main/java/org/bukkit/scheduler/BukkitWorker.java @@ -3,7 +3,7 @@ package org.bukkit.scheduler; import org.bukkit.plugin.Plugin; /** - * Represents a worker thread for the scheduler. This gives information about + * Represents a worker thread for the scheduler. This gives information about * the Thread object for the task, owner of the task and the taskId. * * Workers are used to execute async tasks. diff --git a/src/main/java/org/bukkit/util/BlockIterator.java b/src/main/java/org/bukkit/util/BlockIterator.java index b8d10e48..9357a36c 100644 --- a/src/main/java/org/bukkit/util/BlockIterator.java +++ b/src/main/java/org/bukkit/util/BlockIterator.java @@ -15,27 +15,27 @@ import java.util.NoSuchElementException; public class BlockIterator implements Iterator { - private final World world; - private final int maxDistance; + private final World world; + private final int maxDistance; - private static final int gridSize = 1 << 24; + private static final int gridSize = 1 << 24; - private boolean end = false; + private boolean end = false; - private Block[] blockQueue = new Block[3]; - private int currentBlock = 0; - private int currentDistance = 0; - private int maxDistanceInt; + private Block[] blockQueue = new Block[3]; + private int currentBlock = 0; + private int currentDistance = 0; + private int maxDistanceInt; - private int secondError; - private int thirdError; + private int secondError; + private int thirdError; - private int secondStep; - private int thirdStep; + private int secondStep; + private int thirdStep; - private BlockFace mainFace; - private BlockFace secondFace; - private BlockFace thirdFace; + private BlockFace mainFace; + private BlockFace secondFace; + private BlockFace thirdFace; /** * Constructs the BlockIterator @@ -66,7 +66,7 @@ public class BlockIterator implements Iterator { double secondPosition = 0; double thirdPosition = 0; - Block startBlock = world.getBlockAt((int) Math.floor(startClone.getX()), (int) Math.floor(startClone.getY()), (int) Math.floor(startClone.getZ())); + Block startBlock = this.world.getBlockAt((int) Math.floor(startClone.getX()), (int) Math.floor(startClone.getY()), (int) Math.floor(startClone.getZ())); if (getXLength(direction) > mainDirection) { mainFace = getXFace(direction); @@ -214,15 +214,15 @@ public class BlockIterator implements Iterator { } private double getXLength(Vector direction) { - return(Math.abs(direction.getX())); + return Math.abs(direction.getX()); } private double getYLength(Vector direction) { - return(Math.abs(direction.getY())); + return Math.abs(direction.getY()); } private double getZLength(Vector direction) { - return(Math.abs(direction.getZ())); + return Math.abs(direction.getZ()); } private double getPosition(double direction, double position, int blockPosition) { @@ -281,7 +281,7 @@ public class BlockIterator implements Iterator { * Constructs the BlockIterator. * * @param entity Information from the entity is used to set up the trace - * @param maxDistance This is the maximum distance in blocks for the trace. Setting this value above 140 may lead to problems with unloaded chunks. A value of 0 indicates no limit + * @param maxDistance This is the maximum distance in blocks for the trace. Setting this value above 140 may lead to problems with unloaded chunks. A value of 0 indicates no limit * */ diff --git a/src/main/java/org/bukkit/util/BlockVector.java b/src/main/java/org/bukkit/util/BlockVector.java index 06d0b9cf..8cdd4280 100644 --- a/src/main/java/org/bukkit/util/BlockVector.java +++ b/src/main/java/org/bukkit/util/BlockVector.java @@ -23,6 +23,7 @@ public class BlockVector extends Vector { /** * Construct the vector with another vector. + * * @param vec The other vector. */ public BlockVector(Vector vec) { @@ -111,22 +112,22 @@ public class BlockVector extends Vector { v.z = z; return v; } - + public static BlockVector deserialize(Map args) { double x = 0; double y = 0; double z = 0; - + if (args.containsKey("x")) { - x = (Double)args.get("x"); + x = (Double) args.get("x"); } if (args.containsKey("y")) { - y = (Double)args.get("y"); + y = (Double) args.get("y"); } if (args.containsKey("z")) { - z = (Double)args.get("z"); + z = (Double) args.get("z"); } - + return new BlockVector(x, y, z); } } diff --git a/src/main/java/org/bukkit/util/NumberConversions.java b/src/main/java/org/bukkit/util/NumberConversions.java index 39bad86b..b6cf1009 100644 --- a/src/main/java/org/bukkit/util/NumberConversions.java +++ b/src/main/java/org/bukkit/util/NumberConversions.java @@ -8,12 +8,12 @@ public final class NumberConversions { public static int toInt(Object object) { if (object instanceof Number) { - return ((Number)object).intValue(); + return ((Number) object).intValue(); } else { int result = 0; try { - result = Integer.valueOf((String)object); + result = Integer.valueOf((String) object); } catch (Throwable ex) {} return result; @@ -22,12 +22,12 @@ public final class NumberConversions { public static float toFloat(Object object) { if (object instanceof Number) { - return ((Number)object).floatValue(); + return ((Number) object).floatValue(); } else { float result = 0; try { - result = Float.valueOf((String)object); + result = Float.valueOf((String) object); } catch (Throwable ex) {} return result; @@ -36,12 +36,12 @@ public final class NumberConversions { public static double toDouble(Object object) { if (object instanceof Number) { - return ((Number)object).doubleValue(); + return ((Number) object).doubleValue(); } else { double result = 0; try { - result = Double.valueOf((String)object); + result = Double.valueOf((String) object); } catch (Throwable ex) {} return result; @@ -50,12 +50,12 @@ public final class NumberConversions { public static long toLong(Object object) { if (object instanceof Number) { - return ((Number)object).longValue(); + return ((Number) object).longValue(); } else { long result = 0; try { - result = Long.valueOf((String)object); + result = Long.valueOf((String) object); } catch (Throwable ex) {} return result; @@ -64,12 +64,12 @@ public final class NumberConversions { public static short toShort(Object object) { if (object instanceof Number) { - return ((Number)object).shortValue(); + return ((Number) object).shortValue(); } else { short result = 0; try { - result = Short.valueOf((String)object); + result = Short.valueOf((String) object); } catch (Throwable ex) {} return result; @@ -78,12 +78,12 @@ public final class NumberConversions { public static byte toByte(Object object) { if (object instanceof Number) { - return ((Number)object).byteValue(); + return ((Number) object).byteValue(); } else { byte result = 0; try { - result = Byte.valueOf((String)object); + result = Byte.valueOf((String) object); } catch (Throwable ex) {} return result; diff --git a/src/main/java/org/bukkit/util/Vector.java b/src/main/java/org/bukkit/util/Vector.java index d8e2289e..215e2222 100644 --- a/src/main/java/org/bukkit/util/Vector.java +++ b/src/main/java/org/bukkit/util/Vector.java @@ -165,7 +165,7 @@ public class Vector implements Cloneable, ConfigurationSerializable { } /** - * Get the distance between this vector and another. The value + * Get the distance between this vector and another. The value * of this method is not cached and uses a costly square-root function, so * do not repeatedly call this method to get the vector's magnitude. NaN * will be returned if the inner result of the sqrt() function overflows, @@ -641,29 +641,29 @@ public class Vector implements Cloneable, ConfigurationSerializable { public Map serialize() { Map result = new LinkedHashMap(); - + result.put("x", getX()); result.put("y", getY()); result.put("z", getZ()); - + return result; } - + public static Vector deserialize(Map args) { double x = 0; double y = 0; double z = 0; - + if (args.containsKey("x")) { - x = (Double)args.get("x"); + x = (Double) args.get("x"); } if (args.containsKey("y")) { - y = (Double)args.get("y"); + y = (Double) args.get("y"); } if (args.containsKey("z")) { - z = (Double)args.get("z"); + z = (Double) args.get("z"); } - + return new Vector(x, y, z); } } diff --git a/src/main/java/org/bukkit/util/config/Configuration.java b/src/main/java/org/bukkit/util/config/Configuration.java index 2259452e..07a6bab7 100644 --- a/src/main/java/org/bukkit/util/config/Configuration.java +++ b/src/main/java/org/bukkit/util/config/Configuration.java @@ -29,9 +29,11 @@ import org.yaml.snakeyaml.representer.Representer; * select child nodes by delimiting node names with periods. * *

          - * For example, given the following configuration file:

          + * For example, given the following configuration file: + *

          * - *
          members:
          + * 
          + * members:
            *     - Hollie
            *     - Jason
            *     - Bobo
          @@ -44,13 +46,14 @@ import org.yaml.snakeyaml.representer.Representer;
            * sturmeh:
            *     cool: false
            *     eats:
          - *         babies: true
          + * babies: true + *
          * - *

          Calling code could access sturmeh's baby eating state by using - * getBoolean("sturmeh.eats.babies", false). For lists, there are - * methods such as getStringList that will return a type safe list. + *

          + * Calling code could access sturmeh's baby eating state by using getBoolean("sturmeh.eats.babies", false). For lists, there are methods such as getStringList that will return a type safe list. * - *

          This class is currently incomplete. It is not yet possible to get a node. + *

          + * This class is currently incomplete. It is not yet possible to get a node. *

          * * @deprecated See {@link YamlConfiguration} @@ -163,7 +166,8 @@ public class Configuration extends ConfigurationNode { } yaml.dump(root, writer); return true; - } catch (IOException e) {} finally { + } catch (IOException e) { + } finally { try { if (stream != null) { stream.close(); @@ -190,6 +194,7 @@ public class Configuration extends ConfigurationNode { /** * This method returns an empty ConfigurationNode for using as a * default in methods that select a node from a node list. + * * @return The empty node. */ public static ConfigurationNode getEmptyNode() { diff --git a/src/main/java/org/bukkit/util/config/ConfigurationNode.java b/src/main/java/org/bukkit/util/config/ConfigurationNode.java index 8e148030..e2f16278 100644 --- a/src/main/java/org/bukkit/util/config/ConfigurationNode.java +++ b/src/main/java/org/bukkit/util/config/ConfigurationNode.java @@ -40,17 +40,16 @@ public class ConfigurationNode { Map map = new TreeMap(); Set keys = node.keySet(); - for( String k : keys ) { + for (String k : keys) { Object tmp = node.get(k); - if( tmp instanceof Map ) { - Map rec = recursiveBuilder((Map ) tmp); + if (tmp instanceof Map) { + Map rec = recursiveBuilder((Map) tmp); Set subkeys = rec.keySet(); - for( String sk : subkeys ) { + for (String sk : subkeys) { map.put(k + "." + sk, rec.get(sk)); } - } - else { + } else { map.put(k, tmp); } } diff --git a/src/main/java/org/bukkit/util/noise/NoiseGenerator.java b/src/main/java/org/bukkit/util/noise/NoiseGenerator.java index 10a46b00..b060ed77 100644 --- a/src/main/java/org/bukkit/util/noise/NoiseGenerator.java +++ b/src/main/java/org/bukkit/util/noise/NoiseGenerator.java @@ -1,4 +1,3 @@ - package org.bukkit.util.noise; /** @@ -12,7 +11,7 @@ public abstract class NoiseGenerator { /** * Speedy floor, faster than (int)Math.floor(x) - * + * * @param x Value to floor * @return Floored value */ diff --git a/src/main/java/org/bukkit/util/noise/OctaveGenerator.java b/src/main/java/org/bukkit/util/noise/OctaveGenerator.java index b0588372..87777374 100644 --- a/src/main/java/org/bukkit/util/noise/OctaveGenerator.java +++ b/src/main/java/org/bukkit/util/noise/OctaveGenerator.java @@ -1,4 +1,3 @@ - package org.bukkit.util.noise; /** diff --git a/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java b/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java index 1c067c8a..ca6043e2 100644 --- a/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java +++ b/src/main/java/org/bukkit/util/noise/PerlinNoiseGenerator.java @@ -5,7 +5,7 @@ import org.bukkit.World; /** * Generates noise using the "classic" perlin generator - * + * * @see SimplexNoiseGenerator "Improved" and faster version with slighly different results */ public class PerlinNoiseGenerator extends NoiseGenerator { diff --git a/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java b/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java index a22e8e8a..d959dae0 100644 --- a/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java +++ b/src/main/java/org/bukkit/util/noise/PerlinOctaveGenerator.java @@ -1,4 +1,3 @@ - package org.bukkit.util.noise; import java.util.Random; diff --git a/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java b/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java index fb963871..d041fbc2 100644 --- a/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java +++ b/src/main/java/org/bukkit/util/noise/SimplexOctaveGenerator.java @@ -1,4 +1,3 @@ - package org.bukkit.util.noise; import java.util.Random; @@ -9,7 +8,7 @@ import org.bukkit.World; */ public class SimplexOctaveGenerator extends OctaveGenerator { private double wScale = 1; - + /** * Creates a simplex octave generator for the given world * @@ -102,8 +101,8 @@ public class SimplexOctaveGenerator extends OctaveGenerator { z *= zScale; w *= wScale; - for (int i = 0; i < octaves.length; i++) { - result += ((SimplexNoiseGenerator)octaves[i]).noise(x * freq, y * freq, z * freq, w * freq) * amp; + for (NoiseGenerator octave : octaves) { + result += ((SimplexNoiseGenerator) octave).noise(x * freq, y * freq, z * freq, w * freq) * amp; max += amp; freq *= frequency; amp *= amplitude; diff --git a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java index 82a41385..ebccd45c 100644 --- a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java +++ b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java @@ -7,9 +7,8 @@ import org.bukkit.permissions.PermissionDefault; public final class DefaultPermissions { private static final String ROOT = "craftbukkit"; - private static final String PREFIX = ROOT + "."; private static final String LEGACY_PREFIX = "craft"; - + private DefaultPermissions() {} public static Permission registerPermission(Permission perm) { -- cgit v1.2.3