Generic cleaning

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot 2012-01-15 14:37:30 +01:00
parent 8377ee22f8
commit 4c80a49933
61 changed files with 245 additions and 272 deletions

View File

@ -37,7 +37,7 @@ public enum Achievement {
/**
* Gets the ID for this achievement.
*
* <p />
* Note that this is offset using {@link #STATISTIC_OFFSET}
*
* @return ID of this achievement
@ -48,7 +48,7 @@ public enum Achievement {
/**
* Gets the achievement associated with the given ID.
*
* <p />
* Note that the ID must already be offset using {@link #STATISTIC_OFFSET}
*
* @param id ID of the achievement to return

View File

@ -42,7 +42,7 @@ public final class Bukkit {
/**
* Attempts to set the {@link Server} singleton.
*
* <p />
* This cannot be done if the Server is already set.
*
* @param server Server instance

View File

@ -4,51 +4,50 @@ package org.bukkit;
* A list of all Effects that can happen to entities.
*/
public enum EntityEffect {
/**
* When mobs get hurt.
*/
HURT((byte) 2),
/**
* When a mob dies.
* <p>
* <b>This will cause client-glitches!
*/
DEATH((byte) 3),
/**
* The smoke when taming a wolf fails.
* <p>
* Without client-mods this will be ignored if the entity is not a wolf.
*/
WOLF_SMOKE((byte) 6),
/**
* The hearts when taming a wolf succeeds.
* <p>
* Without client-mods this will be ignored if the entity is not a wolf.
*/
WOLF_HEARTS((byte) 7),
/**
* When a wolf shakes (after being wet).
* <p>
* Without client-mods this will be ignored if the entity is not a wolf.
*/
WOLF_SHAKE((byte) 8);
private final byte data;
/**
* When mobs get hurt.
*/
HURT((byte) 2),
EntityEffect(byte data)
{
this.data = data;
}
/**
* When a mob dies.
* <p>
* <b>This will cause client-glitches!
*/
DEATH((byte) 3),
/**
* @return The data-value that is sent to the client to play this effect.
*/
public byte getData() {
return data;
}
/**
* The smoke when taming a wolf fails.
* <p>
* Without client-mods this will be ignored if the entity is not a wolf.
*/
WOLF_SMOKE((byte) 6),
/**
* The hearts when taming a wolf succeeds.
* <p>
* Without client-mods this will be ignored if the entity is not a wolf.
*/
WOLF_HEARTS((byte) 7),
/**
* When a wolf shakes (after being wet).
* <p>
* Without client-mods this will be ignored if the entity is not a wolf.
*/
WOLF_SHAKE((byte) 8);
private final byte data;
EntityEffect(byte data) {
this.data = data;
}
/**
* @return The data-value that is sent to the client to play this effect.
*/
public byte getData() {
return data;
}
}

View File

@ -2,7 +2,6 @@ package org.bukkit;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;

View File

@ -30,14 +30,14 @@ import org.bukkit.scheduler.BukkitScheduler;
public interface Server extends PluginMessageRecipient {
/**
* Used for all administrative messages, such as an operator using a command.
*
* <p />
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
*/
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
/**
* Used for all announcement messages, such as informing users that a player has joined.
*
* <p />
* For use in {@link #broadcast(java.lang.String, java.lang.String)}
*/
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
@ -155,7 +155,7 @@ public interface Server extends PluginMessageRecipient {
/**
* Broadcast a message to all players.
*
* <p />
* This is the same as calling {@link #broadcast(java.lang.String, java.lang.String)} to {@link #BROADCAST_CHANNEL_USERS}
*
* @param message the message
@ -166,7 +166,7 @@ public interface Server extends PluginMessageRecipient {
/**
* Gets the name of the update folder. The update folder is used to safely update
* plugins at the right moment on a plugin load.
*
* <p />
* The update folder name is relative to the plugins folder.
*
* @return The name of the update folder
@ -183,7 +183,7 @@ public interface Server extends PluginMessageRecipient {
/**
* Gets a player object by the given username
*
* <p />
* This method may not return objects for offline players
*
* @param name Name to look up
@ -202,7 +202,7 @@ public interface Server extends PluginMessageRecipient {
/**
* Attempts to match any players with the given name, and returns a list
* of all possibly matches
*
* <p />
* This list is not sorted in any particular order. If an exact match is found,
* the returned list will only contain a single result.
*
@ -457,7 +457,7 @@ public interface Server extends PluginMessageRecipient {
/**
* Gets the player by the given name, regardless if they are offline or online.
*
* <p />
* This will return an object even if the player does not exist. To this method, all players will exist.
*
* @param name Name of the player to retrieve

View File

@ -47,7 +47,7 @@ public enum Statistic {
/**
* Checks if this is a substatistic.
*
* <p />
* A substatistic exists in mass for each block or item, depending on {@link #isBlock()}
*
* @return true if this is a substatistic

View File

@ -82,7 +82,6 @@ public interface World extends PluginMessageRecipient {
*
* @param x X-coordinate of the block
* @param z Z-coordinate of the block
*
* @return Highest non-empty block
*/
public Block getHighestBlockAt(int x, int z);
@ -91,7 +90,6 @@ public interface World extends PluginMessageRecipient {
* Gets the highest non-empty block at the given coordinates
*
* @param location Coordinates to get the highest block
*
* @return Highest non-empty block
*/
public Block getHighestBlockAt(Location location);
@ -154,7 +152,7 @@ public interface World extends PluginMessageRecipient {
/**
* Loads the {@link Chunk} at the specified coordinates
*
* <p />
* If the chunk does not exist, it will be generated.
* This method is analogous to {@link #loadChunk(int, int, boolean)} where generate is true.
*
@ -175,7 +173,7 @@ public interface World extends PluginMessageRecipient {
/**
* Safely unloads and saves the {@link Chunk} at the specified coordinates
*
* <p />
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where safe and saveis true
*
* @param chunk the chunk to unload
@ -185,7 +183,7 @@ public interface World extends PluginMessageRecipient {
/**
* Safely unloads and saves the {@link Chunk} at the specified coordinates
*
* <p />
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where safe and saveis true
*
* @param x X-coordinate of the chunk
@ -196,7 +194,7 @@ public interface World extends PluginMessageRecipient {
/**
* Safely unloads and optionally saves the {@link Chunk} at the specified coordinates
*
* <p />
* This method is analogous to {@link #unloadChunk(int, int, boolean, boolean)} where save is true
*
* @param x X-coordinate of the chunk
@ -219,7 +217,7 @@ public interface World extends PluginMessageRecipient {
/**
* Safely queues the {@link Chunk} at the specified coordinates for unloading
*
* <p />
* This method is analogous to {@link #unloadChunkRequest(int, int, boolean)} where safe is true
*
* @param x X-coordinate of the chunk
@ -366,7 +364,7 @@ public interface World extends PluginMessageRecipient {
/**
* Gets a semi-unique identifier for this world.
*
* <p />
* While it is highly unlikely that this may be shared with another World,
* it is not guaranteed to be unique
*
@ -395,7 +393,7 @@ public interface World extends PluginMessageRecipient {
/**
* Gets the relative in-game time of this world.
*
* <p />
* The relative time is analogous to hours * 1000
*
* @return The current relative time
@ -405,7 +403,7 @@ public interface World extends PluginMessageRecipient {
/**
* Sets the relative in-game time on the server.
*
* <p />
* The relative time is analogous to hours * 1000
* <br /><br />
* Note that setting the relative time below the current relative time will
@ -650,43 +648,40 @@ public interface World extends PluginMessageRecipient {
/**
* Gets the biome for the given block coordinates.
*
* <p />
* It is safe to run this method when the block does not exist, it will not create the block.
*
* @param x X coordinate of the block
* @param z Z coordinate of the block
*
* @return Biome of the requested block
*/
public Biome getBiome(int x, int z);
/**
* Gets the temperature for the given block coordinates.
*
* <p />
* It is safe to run this method when the block does not exist, it will not create the block.
*
* @param x X coordinate of the block
* @param z Z coordinate of the block
*
* @return Temperature of the requested block
*/
public double getTemperature(int x, int z);
/**
* Gets the humidity for the given block coordinates.
*
* <p />
* It is safe to run this method when the block does not exist, it will not create the block.
*
* @param x X coordinate of the block
* @param z Z coordinate of the block
*
* @return Humidity of the requested block
*/
public double getHumidity(int x, int z);
/**
* Gets the maximum height of this world.
*
* <p />
* If the max height is 100, there are only blocks from y=0 to y=99.
*
* @return Maximum height of the world
@ -695,7 +690,7 @@ public interface World extends PluginMessageRecipient {
/**
* Gets the sea level for this world.
*
* <p />
* This is often half of {@link #getMaxHeight()}
*
* @return Sea level

View File

@ -186,7 +186,7 @@ public interface Block {
/**
* Captures the current state of this block. You may then cast that state
* into any accepted type, such as Furnace or Sign.
*
* <p />
* The returned object will never be updated, and you are not guaranteed that
* (for example) a sign is still a sign after you capture its state.
*
@ -248,7 +248,7 @@ public interface Block {
/**
* Checks if this block is empty.
*
* <p />
* A block is considered empty when {@link #getType()} returns {@link Material#AIR}.
*
* @return true if this block is empty
@ -257,7 +257,7 @@ public interface Block {
/**
* Checks if this block is liquid.
*
* <p />
* A block is considered liquid when {@link #getType()} returns {@link Material#WATER}, {@link Material#STATIONARY_WATER}, {@link Material#LAVA} or {@link Material#STATIONARY_LAVA}.
*
* @return true if this block is liquid

View File

@ -7,7 +7,7 @@ import org.bukkit.material.MaterialData;
/**
* Represents a captured state of a block, which will not change automatically.
*
* <p />
* Unlike Block, which only one object can exist per coordinate, BlockState can
* exist multiple times for any given Block. Note that another plugin may change
* the state of the block and you will not know, or they may change the block to

View File

@ -14,7 +14,7 @@ public interface Sign extends BlockState {
/**
* Gets the line of text at the specified index.
*
* <p />
* For example, getLine(0) will return the first line of text.
*
* @param index Line number to get the text from, starting at 0
@ -25,7 +25,7 @@ public interface Sign extends BlockState {
/**
* Sets the line of text at the specified index.
*
* <p />
* For example, setLine(0, "Line One") will set the first line of text to
* "Line One".
*

View File

@ -75,7 +75,7 @@ public abstract class Command {
/**
* Tests the given {@link CommandSender} to see if they can perform this command.
*
* <p />
* If they do not have permission, they will be informed that they cannot do this.
*
* @param target User to test

View File

@ -20,7 +20,7 @@ public class BanListCommand extends VanillaCommand {
StringBuilder message = new StringBuilder().append(ChatColor.GRAY).append("Ban list:");
int count = 0;
for (OfflinePlayer p : Bukkit.getServer().getBannedPlayers()){
for (OfflinePlayer p : Bukkit.getServer().getBannedPlayers()) {
if (count++ > 0) {
message.append(", ");
}

View File

@ -29,8 +29,7 @@ public class TimingsCommand extends Command {
plugin.resetTimings();
}
sender.sendMessage("Timings reset");
}
else if("merged".equals(args[0]) || seperate) {
} else if ("merged".equals(args[0]) || seperate) {
int index = 0;
int pluginIdx = 0;

View File

@ -1,7 +1,5 @@
package org.bukkit.configuration;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;

View File

@ -56,7 +56,6 @@ public class FileConfigurationOptions extends MemoryConfigurationOptions {
* but you may include one if you wish for extra spacing.
* <p>
* Null is a valid value which will indicate that no header is to be applied.
*
*
* @param value New header
* @return This object, for chaining

View File

@ -12,11 +12,8 @@ import org.bukkit.Bukkit;
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;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.SafeConstructor;
import org.yaml.snakeyaml.error.YAMLException;
import org.yaml.snakeyaml.representer.Representer;

View File

@ -17,6 +17,7 @@ public class YamlConstructor extends SafeConstructor {
}
private class ConstructCustomObject extends ConstructYamlMap {
@Override
public Object construct(Node node) {
if (node.isTwoStepsConstruction()) {
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
@ -40,6 +41,7 @@ public class YamlConstructor extends SafeConstructor {
return raw;
}
@Override
public void construct2ndStep(Node node, Object object) {
throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
}

View File

@ -1,4 +1,3 @@
package org.bukkit.configuration.file;
import java.util.LinkedHashMap;
@ -9,7 +8,6 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.yaml.snakeyaml.nodes.Node;
import org.yaml.snakeyaml.representer.Represent;
import org.yaml.snakeyaml.representer.Representer;
public class YamlRepresenter extends Representer {
@ -20,6 +18,7 @@ public class YamlRepresenter extends Representer {
}
private class RepresentConfigurationSection extends RepresentMap {
@Override
@SuppressWarnings("unchecked")
public Node representData(Object data) {
return super.representData(((ConfigurationSection) data).getValues(false));
@ -27,6 +26,7 @@ public class YamlRepresenter extends Representer {
}
private class RepresentConfigurationSerializable extends RepresentMap {
@Override
@SuppressWarnings("unchecked")
public Node representData(Object data) {
ConfigurationSerializable serializable = (ConfigurationSerializable) data;

View File

@ -2,7 +2,6 @@ package org.bukkit.entity;
/**
* Represents an Animal.
*
*/
public interface Animals extends Creature {
/**

View File

@ -67,7 +67,7 @@ public interface Minecart extends Vehicle {
/**
* Gets the derailed velocity modifier. Used for minecarts that are on the ground, but not on rails.
*
* <p />
* A derailed minecart's velocity is multiplied by this factor each tick.
*
* @return derailed visible speed

View File

@ -16,12 +16,11 @@ import org.bukkit.plugin.messaging.PluginMessageRecipient;
/**
* Represents a player, connected or not
*
*/
public interface Player extends HumanEntity, CommandSender, OfflinePlayer, PluginMessageRecipient {
/**
* Gets the "friendly" name to display of this player. This may include color.
*
* <p />
* Note that this name will not be displayed in game, only in chat and places
* defined by plugins
*
@ -31,7 +30,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
/**
* Sets the "friendly" name to display of this player. This may include color.
*
* <p />
* Note that this name will not be displayed in game, only in chat and places
* defined by plugins
*
@ -153,7 +152,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
/**
* Loads the players current location, health, inventory, motion, and other information from the username.dat file, in the world/player folder
*
* <p />
* Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file.
*/
public void loadData();
@ -220,7 +219,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
* 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.
*
* <p />
* 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
* format.
@ -230,7 +229,6 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
* @param sy The y size of the cuboid
* @param sz The z size of the cuboid
* @param data The data to be sent
*
* @return true if the chunk change packet was sent
*/
public boolean sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data);
@ -303,7 +301,7 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
/**
* Sets the current time on the player's client. When relative is true the player's time
* will be kept synchronized to its world time with the specified offset.
*
* <p />
* When using non relative time the player's time will stay fixed at the specified time parameter. It's up to
* the caller to continue updating the player's time. To restore player time to normal use resetPlayerTime().
*
@ -471,19 +469,19 @@ public interface Player extends HumanEntity, CommandSender, OfflinePlayer, Plugi
* @return Bed Spawn Location if bed exists, otherwise null.
*/
public Location getBedSpawnLocation();
/**
* Determines if the Player is allowed to fly via jump key double-tap like in creative mode.
*
*
* @return True if the player is allowed to fly.
*/
public boolean getAllowFlight();
/**
* Sets if the Player is allowed to fly via jump key double-tap like in creative mode.
*
*
* @param flight If flight should be allowed.
*/
public void setAllowFlight(boolean flight);
}

View File

@ -24,7 +24,7 @@ public interface Projectile extends Entity {
/**
* Determine if this projectile should bounce or not when it hits.
*
* <p />
* If a small fireball does not bounce it will set the target on fire.
*
* @return true if it should bounce.

View File

@ -4,7 +4,7 @@ public interface Tameable {
/**
* Check if this is tamed
*
* <p />
* If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.
*
* @return true if this has been tamed
@ -13,7 +13,7 @@ public interface Tameable {
/**
* Sets if this has been tamed. Not necessary if the method setOwner has been used, as it tames automatically.
*
* <p />
* If something is tamed then a player can not tame it through normal methods, even if it does not belong to anyone in particular.
*
* @param tame true if tame

View File

@ -78,7 +78,7 @@ public abstract class Event implements Serializable {
Highest,
/**
* Event is listened to purely for monitoring the outcome of an event.
*
* <p />
* No modifications to the event should be made under this priority
*/
Monitor
@ -333,7 +333,7 @@ public abstract class Event implements Serializable {
/**
* Called when a block is undergoing a universe physics
* check on whether it can be built
*
* <p />
* For example, cacti cannot be built on grass unless overridden here
*
* @see org.bukkit.event.block.BlockCanBuildEvent
@ -355,7 +355,7 @@ public abstract class Event implements Serializable {
BLOCK_IGNITE(Category.BLOCK),
/**
* Called when a block undergoes a physics check
*
* <p />
* A physics check is commonly called when an adjacent block changes
* type
*
@ -531,7 +531,7 @@ public abstract class Event implements Serializable {
/**
* Called when a chunk is loaded
*
* <p />
* If a new chunk is being generated for loading, it will call
* Type.CHUNK_GENERATION and then Type.CHUNK_LOADED upon completion
*
@ -546,7 +546,7 @@ public abstract class Event implements Serializable {
CHUNK_UNLOAD(Category.WORLD),
/**
* Called when a newly created chunk has been populated.
*
* <p />
* If your intent is to populate the chunk using this event, please see {@link org.bukkit.generator.BlockPopulator}
*
* @see org.bukkit.event.world.ChunkPopulateEvent
@ -605,7 +605,7 @@ public abstract class Event implements Serializable {
*
* @see org.bukkit.event.entity.ItemDespawnEvent
*/
ITEM_DESPAWN (Category.WORLD),
ITEM_DESPAWN(Category.WORLD),
/**
* ENTITY EVENTS
@ -667,10 +667,10 @@ public abstract class Event implements Serializable {
ENTITY_EXPLODE(Category.LIVING_ENTITY),
/**
* Called when an entity has made a decision to explode.
*
* <p />
* Provides an opportunity to act on the entity, change the explosion radius,
* or to change the fire-spread flag.
*
* <p />
* Canceling the event negates the entity's decision to explode.
* For EntityCreeper, this resets the fuse but does not kill the Entity.
* For EntityFireball and EntityTNTPrimed....?

View File

@ -6,10 +6,10 @@ import org.bukkit.entity.Entity;
/**
* Called when a block is formed by entities.
*<p />
* <p />
* Examples:
*<ul>
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
* <ul>
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
* </ul>
*/
public class EntityBlockFormEvent extends BlockFormEvent {

View File

@ -15,7 +15,7 @@ public class EntityCombustByBlockEvent extends EntityCombustEvent {
/**
* The combuster can be lava or a block that is on fire.
*
* <p />
* WARNING: block may be null.
*
* @return the Block that set the combustee alight.

View File

@ -36,7 +36,7 @@ public class EntityCombustEvent extends EntityEvent implements Cancellable {
/**
* The number of seconds the combustee should be alight for.
*
* <p />
* This value will only ever increase the combustion time, not decrease existing combustion times.
*
* @param duration the time in seconds to be alight for.

View File

@ -68,97 +68,97 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
/**
* Damage caused when an entity contacts a block such as a Cactus.
*
* <p />
* Damage: 1 (Cactus)
*/
CONTACT,
/**
* Damage caused when an entity attacks another entity.
*
* <p />
* Damage: variable
*/
ENTITY_ATTACK,
/**
* Damage caused when attacked by a projectile.
*
* <p />
* Damage: variable
*/
PROJECTILE,
/**
* Damage caused by being put in a block
*
* <p />
* Damage: 1
*/
SUFFOCATION,
/**
* Damage caused when an entity falls a distance greater than 3 blocks
*
* <p />
* Damage: fall height - 3.0
*/
FALL,
/**
* Damage caused by direct exposure to fire
*
* <p />
* Damage: 1
*/
FIRE,
/**
* Damage caused due to burns caused by fire
*
* <p />
* Damage: 1
*/
FIRE_TICK,
/**
* Damage caused by direct exposure to lava
*
* <p />
* Damage: 4
*/
LAVA,
/**
* Damage caused by running out of air while in water
*
* <p />
* Damage: 2
*/
DROWNING,
/**
* Damage caused by being in the area when a block explodes.
*
* <p />
* Damage: variable
*/
BLOCK_EXPLOSION,
/**
* Damage caused by being in the area when an entity, such as a Creeper, explodes.
*
* <p />
* Damage: variable
*/
ENTITY_EXPLOSION,
/**
* Damage caused by falling into the void
*
* <p />
* Damage: 4 for players
*/
VOID,
/**
* Damage caused by being struck by lightning
*
* <p />
* Damage: 5
*/
LIGHTNING,
/**
* Damage caused by committing suicide using the command "/kill"
*
* <p />
* Damage: 1000
*/
SUICIDE,
/**
* Damage caused by starving due to having an empty hunger bar
*
* <p />
* Damage: 1
*/
STARVATION,
/**
* Custom damage.
*
* <p />
* Damage: variable
*/
CUSTOM

View File

@ -172,7 +172,7 @@ public class EntityListener implements Listener {
/**
* Called when an entity creates a portal.
*
*
* @param event Relevant event details
*/
public void onEntityCreatePortalEvent(EntityCreatePortalEvent event) {}

View File

@ -51,7 +51,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
* Set the entity that you want the mob to target instead.
* It is possible to be null, null will cause the entity to be
* target-less.
*
* <p />
* This is different from cancelling the event. Cancelling the event
* will cause the entity to keep an original target, while setting to be
* null will cause the entity to be reset

View File

@ -19,11 +19,11 @@ public class PlayerDeathEvent extends EntityDeathEvent {
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, String deathMessage) {
this(player, drops, droppedExp, 0, deathMessage);
}
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, String deathMessage) {
this(player, drops, droppedExp, newExp, 0, 0, deathMessage);
}
public PlayerDeathEvent(Player player, List<ItemStack> drops, int droppedExp, int newExp, int newTotalExp, int newLevel, String deathMessage) {
super(player, drops, droppedExp);
this.newExp = newExp;
@ -73,59 +73,59 @@ public class PlayerDeathEvent extends EntityDeathEvent {
public void setNewExp(int exp) {
newExp = exp;
}
/**
* Gets the Level the Player should have at respawn.
*
*
* @return New Level of the respawned player
*/
public int getNewLevel() {
return newLevel;
}
/**
* Sets the Level the Player should have at respawn.
*
*
* @get level New Level of the respawned player
*/
public void setNewLevel(int level) {
newLevel = level;
}
/**
* Gets the Total EXP the Player should have at respawn.
*
*
* @return New Total EXP of the respawned player
*/
public int getNewTotalExp() {
return newTotalExp;
}
/**
* Sets the Total EXP the Player should have at respawn.
*
*
* @get totalExp New Total EXP of the respawned player
*/
public void setNewTotalExp(int totalExp) {
newTotalExp = totalExp;
}
/**
* Gets if the Player should keep all EXP at respawn.
* <p>
* This flag overrides other EXP settings
*
*
* @return True if Player should keep all pre-death exp
*/
public boolean getKeepLevel() {
return keepLevel;
}
/**
* Sets if the Player should keep all EXP at respawn.
* <p>
* This overrides all other EXP settings
*
*
* @param keepLevel True to keep all current value levels
*/
public void setKeepLevel(boolean keepLevel) {

View File

@ -72,7 +72,7 @@ public class PlayerEggThrowEvent extends PlayerEvent {
/**
* Get the number of mob hatches from the egg. By default the number
* will be he number the server would've done
*
* <p />
* 7/8 chance of being 0
* 31/256 ~= 1/8 chance to be 1
* 1/256 chance to be 4
@ -85,7 +85,7 @@ public class PlayerEggThrowEvent extends PlayerEvent {
/**
* Change the number of mobs coming out of the hatched egg
*
* <p />
* The boolean hatching will override this number.
* Ie. If hatching = false, this number will not matter
*

View File

@ -54,7 +54,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
/**
* Sets the cancellation state of this event. A canceled event will not
* be executed in the server, but will still pass to other plugins
*
* <p />
* Canceling this event will prevent use of food (player won't lose the
* food item), prevent bows/snowballs/eggs from firing, etc. (player won't
* lose the ammo)

View File

@ -29,7 +29,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
/**
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* <p />
* If a move or teleport event is cancelled, the player will be moved or
* teleported back to the Location as defined by getFrom(). This will not
* fire an event
@ -43,7 +43,7 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
/**
* Sets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins
*
* <p />
* If a move or teleport event is cancelled, the player will be moved or
* teleported back to the Location as defined by getFrom(). This will not
* fire an event

View File

@ -5,7 +5,7 @@ import org.bukkit.generator.BlockPopulator;
/**
* Thrown when a new chunk has finished being populated.
*
* <p />
* If your intent is to populate the chunk using this event, please see {@link BlockPopulator}
*/
@SuppressWarnings("serial")

View File

@ -16,7 +16,7 @@ public class WorldListener implements Listener {
/**
* Called when a newly created chunk has been populated.
*
* <p />
* If your intent is to populate the chunk using this event, please see {@link org.bukkit.generator.BlockPopulator}
*
* @param event Relevant event details
@ -70,7 +70,8 @@ public class WorldListener implements Listener {
*
* @param event Relevant event details
*/
public void onWorldUnload(WorldUnloadEvent event) { }
public void onWorldUnload(WorldUnloadEvent event) {}
/**
* Event that is called when an organic structure attempts to grow (Sapling -> Tree), (Mushroom -> Huge Mushroom), naturally or using bonemeal.
*

View File

@ -11,7 +11,7 @@ import org.bukkit.World;
public abstract class BlockPopulator {
/**
* Populates an area of blocks at or around the given chunk.
*
* <p />
* The chunks on each side of the specified chunk must already exist; that is,
* there must be one north, east, south and west of the specified chunk.
* The "corner" chunks may not exist, in which scenario the populator should

View File

@ -73,7 +73,7 @@ public abstract class ChunkGenerator {
/**
* Gets a fixed spawn location to use for a given world.
*
* <p />
* A null value is returned if a world should not use a fixed spawn point,
* and will instead attempt to find one randomly.
*

View File

@ -40,7 +40,6 @@ public interface Inventory {
/**
* Stores the given ItemStacks in the inventory.
*
* This will try to fill existing stacks and empty slots as good as it can.
* It will return a HashMap of what it couldn't fit.
*
@ -51,7 +50,7 @@ public interface Inventory {
/**
* Removes the given ItemStacks from the inventory.
*
* <p />
* It will try to remove 'as much as possible' from the types and amounts you
* give as arguments. It will return a HashMap of what it couldn't remove.
*

View File

@ -40,7 +40,7 @@ public abstract class MapRenderer {
*
* @param map The MapView being initialized.
*/
public void initialize(MapView map) { }
public void initialize(MapView map) {}
/**
* Render to the given map.

View File

@ -4,7 +4,6 @@ import org.bukkit.DyeColor;
/**
* An object that can be colored.
*
*/
public interface Colorable {

View File

@ -25,7 +25,7 @@ public interface Permissible extends ServerOperator {
/**
* Gets the value of the specified permission, if set.
*
* <p />
* If a permission override is not set on this object, the default value of the permission will be returned.
*
* @param name Name of the permission
@ -35,7 +35,7 @@ public interface Permissible extends ServerOperator {
/**
* Gets the value of the specified permission, if set.
*
* <p />
* If a permission override is not set on this object, the default value of the permission will be returned
*
* @param perm Permission to get
@ -91,7 +91,7 @@ public interface Permissible extends ServerOperator {
/**
* Recalculates the permissions for this object, if the attachments have changed values.
*
* <p />
* This should very rarely need to be called from a plugin.
*/
public void recalculatePermissions();

View File

@ -91,7 +91,7 @@ public class Permission {
/**
* Sets the default value of this permission.
*
* <p />
* This will not be saved to disk, and is a temporary operation until the server reloads permissions.
* Changing this default will cause all {@link Permissible}s that contain this permission to recalculate their permissions
*
@ -117,7 +117,7 @@ public class Permission {
/**
* Sets the description of this permission.
*
* <p />
* This will not be saved to disk, and is a temporary operation until the server reloads permissions.
*
* @param value The new description to set
@ -132,7 +132,7 @@ public class Permission {
/**
* Gets a set containing every {@link Permissible} that has this permission.
*
* <p />
* This set cannot be modified.
*
* @return Set containing permissibles with this permission
@ -143,7 +143,7 @@ public class Permission {
/**
* Recalculates all {@link Permissible}s that contain this permission.
*
* <p />
* This should be called after modifying the children, and is automatically called after modifying the default value
*/
public void recalculatePermissibles() {
@ -158,7 +158,7 @@ public class Permission {
/**
* Adds this permission to the specified parent permission.
*
* <p />
* If the parent permission does not exist, it will be created and registered.
*
* @param name Name of the parent permission
@ -194,7 +194,7 @@ public class Permission {
/**
* Loads a list of Permissions from a map of data, usually used from retrieval from a yaml file.
*
* <p />
* The data may contain a list of name:data, where the data contains the following keys:
* default: Boolean true or false. If not specified, false.
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
@ -220,7 +220,7 @@ public class Permission {
/**
* Loads a Permission from a map of data, usually used from retrieval from a yaml file.
*
* <p />
* The data may contain the following keys:
* default: Boolean true or false. If not specified, false.
* children: Map<String, Boolean> of child permissions. If not specified, empty list.
@ -236,7 +236,7 @@ public class Permission {
/**
* Loads a Permission from a map of data, usually used from retrieval from a yaml file.
*
* <p />
* The data may contain the following keys:
* default: Boolean true or false. If not specified, false.
* children: Map<String, Boolean> of child permissions. If not specified, empty list.

View File

@ -62,7 +62,7 @@ public class PermissionAttachment {
/**
* Gets a copy of all set permissions and values contained within this attachment.
*
* <p />
* This map may be modified but will not affect the attachment, as it is a copy.
*
* @return Copy of all permissions and values expressed by this attachment
@ -95,7 +95,7 @@ public class PermissionAttachment {
/**
* Removes the specified permission from this attachment.
*
* <p />
* If the permission does not exist in this attachment, nothing will happen.
*
* @param name Name of the permission to remove
@ -107,7 +107,7 @@ public class PermissionAttachment {
/**
* Removes the specified permission from this attachment.
*
* <p />
* If the permission does not exist in this attachment, nothing will happen.
*
* @param perm Permission to remove

View File

@ -55,7 +55,7 @@ public interface PluginLoader {
/**
* Enables the specified plugin
*
* <p />
* Attempting to enable a plugin that is already enabled will have no effect
*
* @param plugin Plugin to enable
@ -64,7 +64,7 @@ public interface PluginLoader {
/**
* Disables the specified plugin
*
* <p />
* Attempting to disable a plugin that is not enabled will have no effect
*
* @param plugin Plugin to disable

View File

@ -8,7 +8,6 @@ import org.bukkit.event.Event.Priority;
import org.bukkit.event.Listener;
import org.bukkit.permissions.Permissible;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.messaging.PluginMessageListener;
/**
* Handles all plugin management from the Server
@ -25,7 +24,7 @@ public interface PluginManager {
/**
* Checks if the given plugin is loaded and returns it when applicable
*
* <p />
* Please note that the name of the plugin is case-sensitive
*
* @param name Name of the plugin to check
@ -42,7 +41,7 @@ public interface PluginManager {
/**
* Checks if the given plugin is enabled or not
*
* <p />
* Please note that the name of the plugin is case-sensitive.
*
* @param name Name of the plugin to check
@ -60,7 +59,7 @@ public interface PluginManager {
/**
* Loads the plugin in the specified file
*
* <p />
* File must be valid according to the current enabled Plugin interfaces
*
* @param file File containing the plugin to load
@ -119,7 +118,7 @@ public interface PluginManager {
/**
* Enables the specified plugin
*
* <p />
* Attempting to enable a plugin that is already enabled will have no effect
*
* @param plugin Plugin to enable
@ -128,7 +127,7 @@ public interface PluginManager {
/**
* Disables the specified plugin
*
* <p />
* Attempting to disable a plugin that is not enabled will have no effect
*
* @param plugin Plugin to disable
@ -145,7 +144,7 @@ public interface PluginManager {
/**
* Adds a {@link Permission} to this plugin manager.
*
* <p />
* If a permission is already defined with the given name of the new permission,
* an exception will be thrown.
*
@ -156,9 +155,9 @@ public interface PluginManager {
/**
* Removes a {@link Permission} registration from this plugin manager.
*
* <p />
* If the specified permission does not exist in this plugin manager, nothing will happen.
*
* <p />
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
*
* @param perm Permission to remove
@ -167,9 +166,9 @@ public interface PluginManager {
/**
* Removes a {@link Permission} registration from this plugin manager.
*
* <p />
* If the specified permission does not exist in this plugin manager, nothing will happen.
*
* <p />
* Removing a permission registration will <b>not</b> remove the permission from any {@link Permissible}s that have it.
*
* @param name Permission to remove
@ -186,7 +185,7 @@ public interface PluginManager {
/**
* Recalculates the defaults for the given {@link Permission}.
*
* <p />
* This will have no effect if the specified permission is not registered here.
*
* @param perm Permission to recalculate
@ -195,7 +194,7 @@ public interface PluginManager {
/**
* Subscribes the given Permissible for information about the requested Permission, by name.
*
* <p />
* If the specified Permission changes in any form, the Permissible will be asked to recalculate.
*
* @param permission Permission to subscribe to
@ -221,7 +220,7 @@ public interface PluginManager {
/**
* Subscribes to the given Default permissions by operator status
*
* <p />
* If the specified defaults change in any form, the Permissible will be asked to recalculate.
*
* @param op Default list to subscribe to
@ -247,7 +246,7 @@ public interface PluginManager {
/**
* Gets a set of all registered permissions.
*
* <p />
* This set is a copy and will not be modified live.
*
* @return Set containing all current registered permissions

View File

@ -168,7 +168,7 @@ public final class SimplePluginManager implements PluginManager {
/**
* Loads the plugin in the specified file
*
* <p />
* File must be valid according to the current enabled Plugin interfaces
*
* @param file File containing the plugin to load
@ -183,7 +183,7 @@ public final class SimplePluginManager implements PluginManager {
/**
* Loads the plugin in the specified file
*
* <p />
* File must be valid according to the current enabled Plugin interfaces
*
* @param file File containing the plugin to load
@ -226,7 +226,7 @@ public final class SimplePluginManager implements PluginManager {
/**
* Checks if the given plugin is loaded and returns it when applicable
*
* <p />
* Please note that the name of the plugin is case-sensitive
*
* @param name Name of the plugin to check
@ -242,7 +242,7 @@ public final class SimplePluginManager implements PluginManager {
/**
* Checks if the given plugin is enabled or not
*
* <p />
* Please note that the name of the plugin is case-sensitive.
*
* @param name Name of the plugin to check
@ -332,7 +332,7 @@ public final class SimplePluginManager implements PluginManager {
*/
public synchronized void callEvent(Event event) {
for (RegisteredListener registration : getEventListeners(event.getType())) {
if(!registration.getPlugin().isEnabled()) {
if (!registration.getPlugin().isEnabled()) {
continue;
}

View File

@ -236,7 +236,7 @@ public abstract class JavaPlugin implements Plugin {
/**
* Initializes this plugin with the given variables.
*
* <p />
* This method should never be called manually.
*
* @param loader PluginLoader that is responsible for this plugin

View File

@ -37,9 +37,7 @@ import org.yaml.snakeyaml.error.YAMLException;
*/
public class JavaPluginLoader implements PluginLoader {
private final Server server;
protected final Pattern[] fileFilters = new Pattern[] {
Pattern.compile("\\.jar$"),
};
protected final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), };
protected final Map<String, Class<?>> classes = new HashMap<String, Class<?>>();
protected final Map<String, PluginClassLoader> loaders = new HashMap<String, PluginClassLoader>();
@ -1006,7 +1004,7 @@ public class JavaPluginLoader implements PluginLoader {
if (plugin.isEnabled()) {
server.getPluginManager().callEvent(new PluginDisableEvent(plugin));
JavaPlugin jPlugin = (JavaPlugin) plugin;
ClassLoader cloader = jPlugin.getClassLoader();

View File

@ -33,7 +33,7 @@ public final class PluginMessageListenerRegistration {
/**
* Gets the plugin channel that this registration is about.
*
*
* @return Plugin channel.
*/
public String getChannel() {

View File

@ -362,7 +362,7 @@ public class StandardMessenger implements Messenger {
synchronized (incomingLock) {
Set<PluginMessageListenerRegistration> registrations = incomingByPlugin.get(registration.getPlugin());
if (registrations != null) {
return registrations.contains(registration);
}

View File

@ -76,7 +76,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
*
* <p />
* 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
*
@ -108,33 +108,33 @@ public interface BukkitScheduler {
/**
* Check if the task currently running.
*
* <p />
* A repeating task might not be running currently, but will be running in the future.
* A task that has finished, and does not repeat, will not be running ever again.
*
* <p />
* Explicitly, a task is running if there exists a thread for it, and that thread is alive.
*
* @param taskId The task to check.
*
* <p />
* @return If the task is currently running.
*/
public boolean isCurrentlyRunning(int taskId);
/**
* Check if the task queued to be run later.
*
* <p />
* If a repeating task is currently running, it might not be queued now but could be in the future.
* A task that is not queued, and not running, will not be queued again.
*
* @param taskId The task to check.
*
* <p />
* @return If the task is queued to be run.
*/
public boolean isQueued(int taskId);
/**
* Returns a list of all active workers.
*
* <p />
* This list contains asynch tasks that are being executed by separate threads.
*
* @return Active workers

View File

@ -5,7 +5,7 @@ import org.bukkit.plugin.Plugin;
/**
* Represents a worker thread for the scheduler. This gives information about
* the Thread object for the task, owner of the task and the taskId.
*
* </p>
* Workers are used to execute async tasks.
*/

View File

@ -259,7 +259,6 @@ public class BlockIterator implements Iterator<Block> {
*
* @param loc The location for the start of the ray trace
* @param yOffset The trace begins vertically offset from the start vector by this value
*
*/
public BlockIterator(Location loc, double yOffset) {
@ -270,7 +269,6 @@ public class BlockIterator implements Iterator<Block> {
* Constructs the BlockIterator.
*
* @param loc The location for the start of the ray trace
*
*/
public BlockIterator(Location loc) {
@ -293,7 +291,6 @@ public class BlockIterator implements Iterator<Block> {
* Constructs the BlockIterator.
*
* @param entity Information from the entity is used to set up the trace
*
*/
public BlockIterator(LivingEntity entity) {
@ -302,7 +299,6 @@ public class BlockIterator implements Iterator<Block> {
/**
* Returns true if the iteration has more elements
*
*/
public boolean hasNext() {

View File

@ -279,7 +279,7 @@ public class Vector implements Cloneable, ConfigurationSerializable {
/**
* Calculates the cross product of this vector with another. The cross
* product is defined as:
*
* <p />
* x = y1 * z2 - y2 * z1<br/>
* y = z1 * x2 - z2 * x1<br/>
* z = x1 * y2 - x2 * y1
@ -507,7 +507,7 @@ public class Vector implements Cloneable, ConfigurationSerializable {
/**
* Checks to see if two objects are equal.
*
* <p />
* Only two Vectors can ever return true. This method uses a fuzzy match
* to account for floating point errors. The epsilon can be retrieved
* with epsilon.
@ -560,7 +560,6 @@ public class Vector implements Cloneable, ConfigurationSerializable {
/**
* Returns this vector's components as x,y,z.
*
*/
@Override
public String toString() {

View File

@ -27,7 +27,6 @@ import org.yaml.snakeyaml.representer.Representer;
* a file and call its load() method. For specifying node paths in the
* various get*() methods, they support SK's path notation, allowing you to
* select child nodes by delimiting node names with periods.
*
* <p>
* For example, given the following configuration file:
* </p>
@ -48,7 +47,6 @@ import org.yaml.snakeyaml.representer.Representer;
* eats:
* babies: true
* </pre>
*
* <p>
* Calling code could access sturmeh's baby eating state by using <code>getBoolean("sturmeh.eats.babies", false)</code>. For lists, there are methods such as <code>getStringList</code> that will return a type safe list.
*

View File

@ -15,7 +15,7 @@ public abstract class OctaveGenerator {
/**
* Sets the scale used for all coordinates passed to this generator.
*
* <p />
* This is the equivalent to setting each coordinate to the specified value.
*
* @param scale New value to scale each coordinate by
@ -176,8 +176,8 @@ public abstract class OctaveGenerator {
y *= yScale;
z *= zScale;
for (int i = 0; i < octaves.length; i++) {
result += octaves[i].noise(x * freq, y * freq, z * freq) * amp;
for (NoiseGenerator octave : octaves) {
result += octave.noise(x * freq, y * freq, z * freq) * amp;
max += amp;
freq *= frequency;
amp *= amplitude;

View File

@ -5,7 +5,7 @@ import org.bukkit.World;
/**
* Generates simplex-based noise.
*
* <p />
* This is a modified version of the freely published version in the paper by
* Stefan Gustavson at http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
*/

View File

@ -16,24 +16,24 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
@Override
public abstract FileConfiguration getConfig();
public abstract String getTestValuesString();
public abstract String getTestHeaderInput();
public abstract String getTestHeaderResult();
@Test
public void testSave_File() throws Exception {
FileConfiguration config = getConfig();
File file = testFolder.newFile("test.config");
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
config.set(entry.getKey(), entry.getValue());
}
config.save(file);
assertTrue(file.isFile());
}
@ -41,27 +41,27 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
public void testSave_String() throws Exception {
FileConfiguration config = getConfig();
File file = testFolder.newFile("test.config");
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
config.set(entry.getKey(), entry.getValue());
}
config.save(file.getAbsolutePath());
assertTrue(file.isFile());
}
@Test
public void testSaveToString() {
FileConfiguration config = getConfig();
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
config.set(entry.getKey(), entry.getValue());
}
String result = config.saveToString();
String expected = getTestValuesString();
assertEquals(expected, result);
}
@ -72,19 +72,19 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
String saved = getTestValuesString();
Map<String, Object> values = getTestValues();
try {
writer.write(saved);
} finally {
writer.close();
}
config.load(file);
for (Map.Entry<String, Object> entry : values.entrySet()) {
assertEquals(entry.getValue(), config.get(entry.getKey()));
}
assertEquals(values.keySet(), config.getKeys(true));
}
@ -95,19 +95,19 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
String saved = getTestValuesString();
Map<String, Object> values = getTestValues();
try {
writer.write(saved);
} finally {
writer.close();
}
config.load(file.getAbsolutePath());
for (Map.Entry<String, Object> entry : values.entrySet()) {
assertEquals(entry.getValue(), config.get(entry.getKey()));
}
assertEquals(values.keySet(), config.getKeys(true));
}
@ -116,13 +116,13 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
FileConfiguration config = getConfig();
Map<String, Object> values = getTestValues();
String saved = getTestValuesString();
config.loadFromString(saved);
for (Map.Entry<String, Object> entry : values.entrySet()) {
assertEquals(entry.getValue(), config.get(entry.getKey()));
}
assertEquals(values.keySet(), config.getKeys(true));
assertEquals(saved, config.saveToString());
}
@ -131,14 +131,14 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
public void testSaveToStringWithHeader() {
FileConfiguration config = getConfig();
config.options().header(getTestHeaderInput());
for (Map.Entry<String, Object> entry : getTestValues().entrySet()) {
config.set(entry.getKey(), entry.getValue());
}
String result = config.saveToString();
String expected = getTestHeaderResult() + "\n" + getTestValuesString();
assertEquals(expected, result);
}
@ -149,15 +149,15 @@ public abstract class FileConfigurationTest extends MemoryConfigurationTest {
String saved = getTestValuesString();
String header = getTestHeaderResult();
String expected = getTestHeaderInput();
config.loadFromString(header + "\n" + saved);
assertEquals(expected, config.options().header());
for (Map.Entry<String, Object> entry : values.entrySet()) {
assertEquals(entry.getValue(), config.get(entry.getKey()));
}
assertEquals(values.keySet(), config.getKeys(true));
assertEquals(header + "\n" + saved, config.saveToString());
}

View File

@ -4,13 +4,12 @@ import java.util.ArrayList;
import java.util.List;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.serialization.ConfigurationSerialization;
import org.bukkit.inventory.ItemStack;
import org.junit.Test;
import static org.junit.Assert.*;
public class YamlConfigurationTest extends FileConfigurationTest {
public class YamlConfigurationTest extends FileConfigurationTest {
@Override
public YamlConfiguration getConfig() {
return new YamlConfiguration();
@ -25,7 +24,7 @@ public class YamlConfigurationTest extends FileConfigurationTest {
public String getTestHeaderResult() {
return "# This is a sample\n# header.\n# \n# Newline above should be commented.\n\n";
}
@Override
public String getTestValuesString() {
return "integer: -2147483648\n" +
@ -51,12 +50,12 @@ public class YamlConfigurationTest extends FileConfigurationTest {
public void testSaveToStringWithIndent() {
YamlConfiguration config = getConfig();
config.options().indent(9);
config.set("section.key", 1);
String result = config.saveToString();
String expected = "section:\n key: 1\n";
assertEquals(expected, result);
}

View File

@ -40,7 +40,7 @@ public class StandardMessengerTest {
assertFalse(messenger.isOutgoingChannelRegistered(plugin, "foo"));
}
@Test(expected=ReservedChannelException.class)
@Test(expected = ReservedChannelException.class)
public void testReservedOutgoingRegistration() {
Messenger messenger = getMessenger();
TestPlugin plugin = getPlugin();
@ -86,7 +86,7 @@ public class StandardMessengerTest {
assertFalse(listener.hasReceived());
}
@Test(expected=ReservedChannelException.class)
@Test(expected = ReservedChannelException.class)
public void testReservedIncomingRegistration() {
Messenger messenger = getMessenger();
TestPlugin plugin = getPlugin();
@ -94,7 +94,7 @@ public class StandardMessengerTest {
messenger.registerIncomingPluginChannel(plugin, "REGISTER", new TestMessageListener("foo", "bar".getBytes()));
}
@Test(expected=IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class)
public void testDuplicateIncomingRegistration() {
Messenger messenger = getMessenger();
TestPlugin plugin = getPlugin();