Assorted whitespace fixes

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2017-08-06 09:08:05 +10:00
parent da073e8e66
commit e3d4acc303
50 changed files with 96 additions and 107 deletions

View File

@ -54,7 +54,6 @@
<groupId>com.googlecode.json-simple</groupId> <groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId> <artifactId>json-simple</artifactId>
<version>1.1.1</version> <version>1.1.1</version>
<type>jar</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- bundled with Minecraft, should be kept in sync --> <!-- bundled with Minecraft, should be kept in sync -->

View File

@ -781,7 +781,7 @@ public final class Bukkit {
* @param type the type of list to fetch, cannot be null * @param type the type of list to fetch, cannot be null
* @return a ban list of the specified type * @return a ban list of the specified type
*/ */
public static BanList getBanList(BanList.Type type){ public static BanList getBanList(BanList.Type type) {
return server.getBanList(type); return server.getBanList(type);
} }

View File

@ -204,7 +204,7 @@ public enum Effect {
private static final Map<Integer, Effect> BY_ID = Maps.newHashMap(); private static final Map<Integer, Effect> BY_ID = Maps.newHashMap();
Effect(int id, Type type) { Effect(int id, Type type) {
this(id,type,null); this(id, type, null);
} }
Effect(int id, Type type, Class<?> data) { Effect(int id, Type type, Class<?> data) {

View File

@ -145,7 +145,7 @@ public final class FireworkEffect implements ConfigurationSerializable {
* @throws IllegalArgumentException If any color is null (may be * @throws IllegalArgumentException If any color is null (may be
* thrown after changes have occurred) * thrown after changes have occurred)
*/ */
public Builder withColor(Color...colors) throws IllegalArgumentException { public Builder withColor(Color... colors) throws IllegalArgumentException {
Validate.notNull(colors, "Cannot have null colors"); Validate.notNull(colors, "Cannot have null colors");
if (colors.length == 0) { if (colors.length == 0) {
return this; return this;
@ -214,7 +214,7 @@ public final class FireworkEffect implements ConfigurationSerializable {
* @throws IllegalArgumentException If any color is null (may be * @throws IllegalArgumentException If any color is null (may be
* thrown after changes have occurred) * thrown after changes have occurred)
*/ */
public Builder withFade(Color...colors) throws IllegalArgumentException { public Builder withFade(Color... colors) throws IllegalArgumentException {
Validate.notNull(colors, "Cannot have null colors"); Validate.notNull(colors, "Cannot have null colors");
if (colors.length == 0) { if (colors.length == 0) {
return this; return this;

View File

@ -41,7 +41,7 @@ public enum Rotation {
COUNTER_CLOCKWISE_45 COUNTER_CLOCKWISE_45
; ;
private static final Rotation [] rotations = values(); private static final Rotation[] rotations = values();
/** /**
* Rotate clockwise by 90 degrees. * Rotate clockwise by 90 degrees.

View File

@ -918,7 +918,7 @@ public interface Server extends PluginMessageRecipient {
* @param flags an optional list of flags to set on the boss bar * @param flags an optional list of flags to set on the boss bar
* @return the created boss bar * @return the created boss bar
*/ */
BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag ...flags); BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags);
/** /**
* Gets an entity on the server by its UUID * Gets an entity on the server by its UUID

View File

@ -38,7 +38,7 @@ public class Pattern implements ConfigurationSerializable {
pattern = PatternType.getByIdentifier(getString(map, PATTERN)); pattern = PatternType.getByIdentifier(getString(map, PATTERN));
} }
private static String getString(Map<?,?> map, Object key) { private static String getString(Map<?, ?> map, Object key) {
Object str = map.get(key); Object str = map.get(key);
if (str instanceof String) { if (str instanceof String) {
return (String) str; return (String) str;

View File

@ -46,7 +46,7 @@ public class TimingsCommand extends BukkitCommand {
for (HandlerList handlerList : HandlerList.getHandlerLists()) { for (HandlerList handlerList : HandlerList.getHandlerLists()) {
for (RegisteredListener listener : handlerList.getRegisteredListeners()) { for (RegisteredListener listener : handlerList.getRegisteredListeners()) {
if (listener instanceof TimedRegisteredListener) { if (listener instanceof TimedRegisteredListener) {
((TimedRegisteredListener)listener).reset(); ((TimedRegisteredListener) listener).reset();
} }
} }
} }

View File

@ -181,7 +181,7 @@ public class MemorySection implements ConfigurationSection {
ConfigurationSection subSection = section.getConfigurationSection(node); ConfigurationSection subSection = section.getConfigurationSection(node);
if (subSection == null) { if (subSection == null) {
if (value == null) { if (value == null) {
// no need to create missing sub-sections if we want to remove the value: // no need to create missing sub-sections if we want to remove the value:
return; return;
} }
section = section.createSection(node); section = section.createSection(node);

View File

@ -3,7 +3,6 @@ package org.bukkit.configuration.file;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.Reader; import java.io.Reader;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; import java.util.logging.Level;
@ -181,7 +180,7 @@ public class YamlConfiguration extends FileConfiguration {
} catch (IOException ex) { } catch (IOException ex) {
Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file, ex); Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file, ex);
} catch (InvalidConfigurationException ex) { } catch (InvalidConfigurationException ex) {
Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file , ex); Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file, ex);
} }
return config; return config;

View File

@ -7,7 +7,7 @@ import org.apache.commons.lang.BooleanUtils;
* BooleanPrompt is the base class for any prompt that requires a boolean * BooleanPrompt is the base class for any prompt that requires a boolean
* response from the user. * response from the user.
*/ */
public abstract class BooleanPrompt extends ValidatingPrompt{ public abstract class BooleanPrompt extends ValidatingPrompt {
public BooleanPrompt() { public BooleanPrompt() {
super(); super();

View File

@ -217,7 +217,7 @@ public class Conversation {
} }
// Test for conversation abandonment based on input // Test for conversation abandonment based on input
for(ConversationCanceller canceller : cancellers) { for (ConversationCanceller canceller : cancellers) {
if (canceller.cancelBasedOnInput(context, input)) { if (canceller.cancelBasedOnInput(context, input)) {
abandon(new ConversationAbandonedEvent(this, canceller)); abandon(new ConversationAbandonedEvent(this, canceller));
return; return;

View File

@ -35,8 +35,7 @@ public class ConversationFactory {
* *
* @param plugin The plugin that owns the factory. * @param plugin The plugin that owns the factory.
*/ */
public ConversationFactory(Plugin plugin) public ConversationFactory(Plugin plugin) {
{
this.plugin = plugin; this.plugin = plugin;
isModal = true; isModal = true;
localEchoEnabled = true; localEchoEnabled = true;
@ -58,8 +57,7 @@ public class ConversationFactory {
* @param modal The modality of all conversations to be created. * @param modal The modality of all conversations to be created.
* @return This object. * @return This object.
*/ */
public ConversationFactory withModality(boolean modal) public ConversationFactory withModality(boolean modal) {
{
isModal = modal; isModal = modal;
return this; return this;
} }
@ -141,7 +139,6 @@ public class ConversationFactory {
return withConversationCanceller(new ExactMatchConversationCanceller(escapeSequence)); return withConversationCanceller(new ExactMatchConversationCanceller(escapeSequence));
} }
/** /**
* Adds a {@link ConversationCanceller} to constructed conversations. * Adds a {@link ConversationCanceller} to constructed conversations.
* *

View File

@ -1,6 +1,5 @@
package org.bukkit.conversations; package org.bukkit.conversations;
import org.bukkit.Server;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
/** /**
@ -48,7 +47,7 @@ public class InactivityConversationCanceller implements ConversationCanceller {
public void run() { public void run() {
if (conversation.getState() == Conversation.ConversationState.UNSTARTED) { if (conversation.getState() == Conversation.ConversationState.UNSTARTED) {
startTimer(); startTimer();
} else if (conversation.getState() == Conversation.ConversationState.STARTED) { } else if (conversation.getState() == Conversation.ConversationState.STARTED) {
cancelling(conversation); cancelling(conversation);
conversation.abandon(new ConversationAbandonedEvent(conversation, InactivityConversationCanceller.this)); conversation.abandon(new ConversationAbandonedEvent(conversation, InactivityConversationCanceller.this));
} }

View File

@ -5,7 +5,7 @@ package org.bukkit.conversations;
* ConversationAbandonedEvent} to indicate that the conversation was manually * ConversationAbandonedEvent} to indicate that the conversation was manually
* abandoned by programmatically calling the abandon() method on it. * abandoned by programmatically calling the abandon() method on it.
*/ */
public class ManuallyAbandonedConversationCanceller implements ConversationCanceller{ public class ManuallyAbandonedConversationCanceller implements ConversationCanceller {
public void setConversation(Conversation conversation) { public void setConversation(Conversation conversation) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -4,7 +4,7 @@ package org.bukkit.conversations;
* MessagePrompt is the base class for any prompt that only displays a message * MessagePrompt is the base class for any prompt that only displays a message
* to the user and requires no input. * to the user and requires no input.
*/ */
public abstract class MessagePrompt implements Prompt{ public abstract class MessagePrompt implements Prompt {
public MessagePrompt() { public MessagePrompt() {
super(); super();

View File

@ -1,12 +1,10 @@
package org.bukkit.conversations; package org.bukkit.conversations;
import org.bukkit.command.CommandSender;
/** /**
* NullConversationPrefix is a {@link ConversationPrefix} implementation that * NullConversationPrefix is a {@link ConversationPrefix} implementation that
* displays nothing in front of conversation output. * displays nothing in front of conversation output.
*/ */
public class NullConversationPrefix implements ConversationPrefix{ public class NullConversationPrefix implements ConversationPrefix {
/** /**
* Prepends each conversation message with an empty string. * Prepends each conversation message with an empty string.

View File

@ -6,7 +6,7 @@ import org.apache.commons.lang.math.NumberUtils;
* NumericPrompt is the base class for any prompt that requires a {@link * NumericPrompt is the base class for any prompt that requires a {@link
* Number} response from the user. * Number} response from the user.
*/ */
public abstract class NumericPrompt extends ValidatingPrompt{ public abstract class NumericPrompt extends ValidatingPrompt {
public NumericPrompt() { public NumericPrompt() {
super(); super();
} }
@ -30,8 +30,7 @@ public abstract class NumericPrompt extends ValidatingPrompt{
@Override @Override
protected Prompt acceptValidatedInput(ConversationContext context, String input) { protected Prompt acceptValidatedInput(ConversationContext context, String input) {
try try {
{
return acceptValidatedInput(context, NumberUtils.createNumber(input)); return acceptValidatedInput(context, NumberUtils.createNumber(input));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return acceptValidatedInput(context, NumberUtils.INTEGER_ZERO); return acceptValidatedInput(context, NumberUtils.INTEGER_ZERO);

View File

@ -7,7 +7,7 @@ import org.bukkit.plugin.Plugin;
* PlayerNamePrompt is the base class for any prompt that requires the player * PlayerNamePrompt is the base class for any prompt that requires the player
* to enter another player's name. * to enter another player's name.
*/ */
public abstract class PlayerNamePrompt extends ValidatingPrompt{ public abstract class PlayerNamePrompt extends ValidatingPrompt {
private Plugin plugin; private Plugin plugin;
public PlayerNamePrompt(Plugin plugin) { public PlayerNamePrompt(Plugin plugin) {
@ -18,7 +18,6 @@ public abstract class PlayerNamePrompt extends ValidatingPrompt{
@Override @Override
protected boolean isInputValid(ConversationContext context, String input) { protected boolean isInputValid(ConversationContext context, String input) {
return plugin.getServer().getPlayer(input) != null; return plugin.getServer().getPlayer(input) != null;
} }
@Override @Override

View File

@ -4,7 +4,7 @@ package org.bukkit.conversations;
* StringPrompt is the base class for any prompt that accepts an arbitrary * StringPrompt is the base class for any prompt that accepts an arbitrary
* string from the user. * string from the user.
*/ */
public abstract class StringPrompt implements Prompt{ public abstract class StringPrompt implements Prompt {
/** /**
* Ensures that the prompt waits for the user to provide input. * Ensures that the prompt waits for the user to provide input.

View File

@ -122,7 +122,7 @@ public class AsyncPlayerChatEvent extends PlayerEvent implements Cancellable {
} }
public boolean isCancelled() { public boolean isCancelled() {
return cancel ; return cancel;
} }
public void setCancelled(boolean cancel) { public void setCancelled(boolean cancel) {

View File

@ -23,7 +23,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable {
public PlayerEditBookEvent(Player who, int slot, BookMeta previousBookMeta, BookMeta newBookMeta, boolean isSigning) { public PlayerEditBookEvent(Player who, int slot, BookMeta previousBookMeta, BookMeta newBookMeta, boolean isSigning) {
super(who); super(who);
Validate.isTrue(slot >= 0 && slot <=8, "Slot must be in range 0-8 inclusive"); Validate.isTrue(slot >= 0 && slot <= 8, "Slot must be in range 0-8 inclusive");
Validate.notNull(previousBookMeta, "Previous book meta must not be null"); Validate.notNull(previousBookMeta, "Previous book meta must not be null");
Validate.notNull(newBookMeta, "New book meta must not be null"); Validate.notNull(newBookMeta, "New book meta must not be null");

View File

@ -12,9 +12,9 @@ public class PlayerLevelChangeEvent extends PlayerEvent {
private final int newLevel; private final int newLevel;
public PlayerLevelChangeEvent(final Player player, final int oldLevel, final int newLevel) { public PlayerLevelChangeEvent(final Player player, final int oldLevel, final int newLevel) {
super(player); super(player);
this.oldLevel = oldLevel; this.oldLevel = oldLevel;
this.newLevel = newLevel; this.newLevel = newLevel;
} }
/** /**

View File

@ -24,7 +24,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel
private final Material material; private final Material material;
public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue) { public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue) {
super (player); super(player);
this.statistic = statistic; this.statistic = statistic;
this.initialValue = initialValue; this.initialValue = initialValue;
this.newValue = newValue; this.newValue = newValue;
@ -33,7 +33,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel
} }
public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, EntityType entityType) { public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, EntityType entityType) {
super (player); super(player);
this.statistic = statistic; this.statistic = statistic;
this.initialValue = initialValue; this.initialValue = initialValue;
this.newValue = newValue; this.newValue = newValue;
@ -42,7 +42,7 @@ public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancel
} }
public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, Material material) { public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, Material material) {
super (player); super(player);
this.statistic = statistic; this.statistic = statistic;
this.initialValue = initialValue; this.initialValue = initialValue;
this.newValue = newValue; this.newValue = newValue;

View File

@ -159,9 +159,9 @@ public abstract class InventoryView {
public void setItem(int slot, ItemStack item) { public void setItem(int slot, ItemStack item) {
if (slot != OUTSIDE) { if (slot != OUTSIDE) {
if (slot < getTopInventory().getSize()) { if (slot < getTopInventory().getSize()) {
getTopInventory().setItem(convertSlot(slot),item); getTopInventory().setItem(convertSlot(slot), item);
} else { } else {
getBottomInventory().setItem(convertSlot(slot),item); getBottomInventory().setItem(convertSlot(slot), item);
} }
} else { } else {
getPlayer().getWorld().dropItemNaturally(getPlayer().getLocation(), item); getPlayer().getWorld().dropItemNaturally(getPlayer().getLocation(), item);

View File

@ -26,7 +26,7 @@ public interface FireworkMeta extends ItemMeta {
* @throws IllegalArgumentException If any effect is null (may be thrown * @throws IllegalArgumentException If any effect is null (may be thrown
* after changes have occurred) * after changes have occurred)
*/ */
void addEffects(FireworkEffect...effects) throws IllegalArgumentException; void addEffects(FireworkEffect... effects) throws IllegalArgumentException;
/** /**
* Add several firework effects to this firework. * Add several firework effects to this firework.

View File

@ -141,13 +141,13 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
*/ */
boolean removeEnchant(Enchantment ench); boolean removeEnchant(Enchantment ench);
/** /**
* Checks if the specified enchantment conflicts with any enchantments in * Checks if the specified enchantment conflicts with any enchantments in
* this ItemMeta. * this ItemMeta.
* *
* @param ench enchantment to test * @param ench enchantment to test
* @return true if the enchantment conflicts, false otherwise * @return true if the enchantment conflicts, false otherwise
*/ */
boolean hasConflictingEnchant(Enchantment ench); boolean hasConflictingEnchant(Enchantment ench);
/** /**

View File

@ -53,7 +53,7 @@ public class MapFont {
throw new IllegalArgumentException("text contains invalid characters"); throw new IllegalArgumentException("text contains invalid characters");
} }
if (text.length() == 0){ if (text.length() == 0) {
return 0; return 0;
} }

View File

@ -20,7 +20,7 @@ public class Cauldron extends MaterialData {
* @deprecated Magic value * @deprecated Magic value
*/ */
@Deprecated @Deprecated
public Cauldron(int type, byte data){ public Cauldron(int type, byte data) {
super(type, data); super(type, data);
} }

View File

@ -41,7 +41,7 @@ public class Comparator extends MaterialData implements Directional, Redstone {
* @see BlockFace * @see BlockFace
*/ */
public Comparator(BlockFace facingDirection, boolean isSubtraction) { public Comparator(BlockFace facingDirection, boolean isSubtraction) {
this(facingDirection, isSubtraction, DEFAULT_STATE); this(facingDirection, isSubtraction, DEFAULT_STATE);
} }
/** /**
@ -98,7 +98,7 @@ public class Comparator extends MaterialData implements Directional, Redstone {
* @param isSubtraction True if the comparator is in subtraction mode, false for normal comparator operation * @param isSubtraction True if the comparator is in subtraction mode, false for normal comparator operation
*/ */
public void setSubtractionMode(boolean isSubtraction) { public void setSubtractionMode(boolean isSubtraction) {
setData((byte)(getData() & 0xB | (isSubtraction ? 0x4 : 0x0))); setData((byte) (getData() & 0xB | (isSubtraction ? 0x4 : 0x0)));
} }
/** /**
@ -139,7 +139,7 @@ public class Comparator extends MaterialData implements Directional, Redstone {
data |= 0x0; data |= 0x0;
} }
setData((byte)data); setData((byte) data);
} }
/** /**

View File

@ -96,12 +96,12 @@ public class Crops extends MaterialData {
case CARROT: case CARROT:
case POTATO: case POTATO:
// Mask the data just in case top bit set // Mask the data just in case top bit set
return CropState.getByData((byte)(getData() & 0x7)); return CropState.getByData((byte) (getData() & 0x7));
case BEETROOT_BLOCK: case BEETROOT_BLOCK:
case NETHER_WARTS: case NETHER_WARTS:
// Mask the data just in case top bits are set // Mask the data just in case top bits are set
// Will return SEEDED, SMALL, TALL, RIPE for the three growth data values // Will return SEEDED, SMALL, TALL, RIPE for the three growth data values
return CropState.getByData((byte)(((getData() & 0x3)*7+2)/3)) ; return CropState.getByData((byte) (((getData() & 0x3) * 7 + 2) / 3));
default: default:
throw new IllegalArgumentException("Block type is not a crop"); throw new IllegalArgumentException("Block type is not a crop");
} }
@ -127,12 +127,12 @@ public class Crops extends MaterialData {
case CARROT: case CARROT:
case POTATO: case POTATO:
// Preserve the top bit in case it is set // Preserve the top bit in case it is set
setData((byte)((getData() & 0x8)|state.getData())); setData((byte) ((getData() & 0x8) | state.getData()));
break; break;
case NETHER_WARTS: case NETHER_WARTS:
case BEETROOT_BLOCK: case BEETROOT_BLOCK:
// Preserve the top bits in case they are set // Preserve the top bits in case they are set
setData((byte)((getData() & 0xC)|(state.getData() >> 1))); setData((byte) ((getData() & 0xC) | (state.getData() >> 1)));
break; break;
default: default:
throw new IllegalArgumentException("Block type is not a crop"); throw new IllegalArgumentException("Block type is not a crop");

View File

@ -18,7 +18,7 @@ public class Gate extends MaterialData implements Directional, Openable {
super(Material.FENCE_GATE); super(Material.FENCE_GATE);
} }
public Gate(int type, byte data){ public Gate(int type, byte data) {
super(type, data); super(type, data);
} }
@ -27,7 +27,7 @@ public class Gate extends MaterialData implements Directional, Openable {
} }
public void setFacingDirection(BlockFace face) { public void setFacingDirection(BlockFace face) {
byte data = (byte) (getData() &~ DIR_BIT); byte data = (byte) (getData() & ~DIR_BIT);
switch (face) { switch (face) {
default: default:

View File

@ -88,7 +88,7 @@ public class Mushroom extends MaterialData {
* @deprecated Magic value * @deprecated Magic value
*/ */
@Deprecated @Deprecated
public Mushroom(int type, byte data){ public Mushroom(int type, byte data) {
super(type, data); super(type, data);
Validate.isTrue(type == Material.HUGE_MUSHROOM_1.getId() || type == Material.HUGE_MUSHROOM_2.getId(), "Not a mushroom!"); Validate.isTrue(type == Material.HUGE_MUSHROOM_1.getId() || type == Material.HUGE_MUSHROOM_2.getId(), "Not a mushroom!");
} }
@ -237,8 +237,7 @@ public class Mushroom extends MaterialData {
case DOWN: case DOWN:
if (painted) { if (painted) {
data = MushroomBlockTexture.ALL_CAP.getData(); data = MushroomBlockTexture.ALL_CAP.getData();
} } else {
else {
data = MushroomBlockTexture.ALL_PORES.getData(); data = MushroomBlockTexture.ALL_PORES.getData();
} }
break; break;

View File

@ -26,7 +26,7 @@ public class NetherWarts extends MaterialData {
} }
public NetherWarts(final Material type) { public NetherWarts(final Material type) {
super (type); super(type);
} }
/** /**

View File

@ -21,7 +21,7 @@ public class SpawnEgg extends MaterialData {
* @deprecated Magic value * @deprecated Magic value
*/ */
@Deprecated @Deprecated
public SpawnEgg(int type, byte data){ public SpawnEgg(int type, byte data) {
super(type, data); super(type, data);
} }

View File

@ -130,7 +130,7 @@ public class Stairs extends MaterialData implements Directional {
@Override @Override
public String toString() { public String toString() {
return super.toString() + " facing " + getFacing() + (isInverted()?" inverted":""); return super.toString() + " facing " + getFacing() + (isInverted() ? " inverted" : "");
} }
@Override @Override

View File

@ -116,6 +116,6 @@ public class Step extends TexturedMaterial {
@Override @Override
public String toString() { public String toString() {
return super.toString() + (isInverted()?"inverted":""); return super.toString() + (isInverted() ? "inverted" : "");
} }
} }

View File

@ -81,6 +81,6 @@ public class Tripwire extends MaterialData {
@Override @Override
public String toString() { public String toString() {
return super.toString() + (isActivated()?" Activated":"") + (isObjectTriggering()?" Triggered":""); return super.toString() + (isActivated() ? " Activated" : "") + (isObjectTriggering() ? " Triggered" : "");
} }
} }

View File

@ -124,6 +124,6 @@ public class TripwireHook extends SimpleAttachableMaterialData implements Redsto
@Override @Override
public String toString() { public String toString() {
return super.toString() + " facing " + getFacing() + (isActivated()?" Activated":"") + (isConnected()?" Connected":""); return super.toString() + " facing " + getFacing() + (isActivated() ? " Activated" : "") + (isConnected() ? " Connected" : "");
} }
} }

View File

@ -26,7 +26,7 @@ public class Vine extends MaterialData {
* @deprecated Magic value * @deprecated Magic value
*/ */
@Deprecated @Deprecated
public Vine(int type, byte data){ public Vine(int type, byte data) {
super(type, data); super(type, data);
} }
@ -107,7 +107,7 @@ public class Vine extends MaterialData {
* @param face The face to attach. * @param face The face to attach.
*/ */
public void putOnFace(BlockFace face) { public void putOnFace(BlockFace face) {
switch(face) { switch (face) {
case WEST: case WEST:
setData((byte) (getData() | VINE_WEST)); setData((byte) (getData() | VINE_WEST));
break; break;
@ -149,7 +149,7 @@ public class Vine extends MaterialData {
* @param face The face to detach. * @param face The face to detach.
*/ */
public void removeFromFace(BlockFace face) { public void removeFromFace(BlockFace face) {
switch(face) { switch (face) {
case WEST: case WEST:
setData((byte) (getData() & ~VINE_WEST)); setData((byte) (getData() & ~VINE_WEST));
break; break;

View File

@ -305,7 +305,7 @@ public class Permission {
} }
} }
} else if (childrenNode instanceof Map) { } else if (childrenNode instanceof Map) {
children = extractChildren((Map<?,?>) childrenNode, name, def, output); children = extractChildren((Map<?, ?>) childrenNode, name, def, output);
} else { } else {
throw new IllegalArgumentException("'children' key is of wrong type"); throw new IllegalArgumentException("'children' key is of wrong type");
} }

View File

@ -1060,9 +1060,9 @@ public final class PluginDescriptionFile {
return map; return map;
} }
private Map<?,?> asMap(Object object) throws InvalidDescriptionException { private Map<?, ?> asMap(Object object) throws InvalidDescriptionException {
if (object instanceof Map) { if (object instanceof Map) {
return (Map<?,?>) object; return (Map<?, ?>) object;
} }
throw new InvalidDescriptionException(object + " is not properly structured."); throw new InvalidDescriptionException(object + " is not properly structured.");
} }

View File

@ -54,15 +54,15 @@ public class RegisteredListener {
* @throws EventException If an event handler throws an exception. * @throws EventException If an event handler throws an exception.
*/ */
public void callEvent(final Event event) throws EventException { public void callEvent(final Event event) throws EventException {
if (event instanceof Cancellable){ if (event instanceof Cancellable) {
if (((Cancellable) event).isCancelled() && isIgnoringCancelled()){ if (((Cancellable) event).isCancelled() && isIgnoringCancelled()) {
return; return;
} }
} }
executor.execute(listener, event); executor.execute(listener, event);
} }
/** /**
* Whether this listener accepts cancelled events * Whether this listener accepts cancelled events
* *
* @return True when ignoring cancelled events * @return True when ignoring cancelled events

View File

@ -152,7 +152,7 @@ public final class SimplePluginManager implements PluginManager {
file.getPath(), file.getPath(),
replacedFile.getPath(), replacedFile.getPath(),
directory.getPath() directory.getPath()
)); ));
} }
Collection<String> softDependencySet = description.getSoftDepend(); Collection<String> softDependencySet = description.getSoftDepend();
@ -443,7 +443,7 @@ public final class SimplePluginManager implements PluginManager {
try { try {
server.getMessenger().unregisterIncomingPluginChannel(plugin); server.getMessenger().unregisterIncomingPluginChannel(plugin);
server.getMessenger().unregisterOutgoingPluginChannel(plugin); server.getMessenger().unregisterOutgoingPluginChannel(plugin);
} catch(Throwable ex) { } catch (Throwable ex) {
server.getLogger().log(Level.SEVERE, "Error occurred (in the plugin loader) while unregistering plugin channels for " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); server.getLogger().log(Level.SEVERE, "Error occurred (in the plugin loader) while unregistering plugin channels for " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
} }
} }

View File

@ -41,7 +41,7 @@ public class PotionEffect implements ConfigurationSerializable {
* @param particles the particle status, see {@link PotionEffect#hasParticles()} * @param particles the particle status, see {@link PotionEffect#hasParticles()}
* @param color the particle color, see {@link PotionEffect#getColor()} * @param color the particle color, see {@link PotionEffect#getColor()}
*/ */
public PotionEffect(PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, Color color){ public PotionEffect(PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, Color color) {
Validate.notNull(type, "effect type cannot be null"); Validate.notNull(type, "effect type cannot be null");
this.type = type; this.type = type;
this.duration = duration; this.duration = duration;
@ -99,7 +99,7 @@ public class PotionEffect implements ConfigurationSerializable {
this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true)); this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true));
} }
private static PotionEffectType getEffectType(Map<?,?> map) { private static PotionEffectType getEffectType(Map<?, ?> map) {
int type = getInt(map, TYPE); int type = getInt(map, TYPE);
PotionEffectType effect = PotionEffectType.getById(type); PotionEffectType effect = PotionEffectType.getById(type);
if (effect != null) { if (effect != null) {
@ -108,7 +108,7 @@ public class PotionEffect implements ConfigurationSerializable {
throw new NoSuchElementException(map + " does not contain " + TYPE); throw new NoSuchElementException(map + " does not contain " + TYPE);
} }
private static int getInt(Map<?,?> map, Object key) { private static int getInt(Map<?, ?> map, Object key) {
Object num = map.get(key); Object num = map.get(key);
if (num instanceof Integer) { if (num instanceof Integer) {
return (Integer) num; return (Integer) num;
@ -116,7 +116,7 @@ public class PotionEffect implements ConfigurationSerializable {
throw new NoSuchElementException(map + " does not contain " + key); throw new NoSuchElementException(map + " does not contain " + key);
} }
private static boolean getBool(Map<?,?> map, Object key, boolean def) { private static boolean getBool(Map<?, ?> map, Object key, boolean def) {
Object bool = map.get(key); Object bool = map.get(key);
if (bool instanceof Boolean) { if (bool instanceof Boolean) {
return (Boolean) bool; return (Boolean) bool;
@ -200,7 +200,7 @@ public class PotionEffect implements ConfigurationSerializable {
/** /**
* @return whether this effect has particles or not * @return whether this effect has particles or not
*/ */
public boolean hasParticles(){ public boolean hasParticles() {
return particles; return particles;
} }

View File

@ -27,7 +27,7 @@ public class ChatPaginator {
* @return A single chat page. * @return A single chat page.
*/ */
public static ChatPage paginate(String unpaginatedString, int pageNumber) { public static ChatPage paginate(String unpaginatedString, int pageNumber) {
return paginate(unpaginatedString, pageNumber, GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH, CLOSED_CHAT_PAGE_HEIGHT); return paginate(unpaginatedString, pageNumber, GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH, CLOSED_CHAT_PAGE_HEIGHT);
} }
/** /**
@ -46,7 +46,7 @@ public class ChatPaginator {
int actualPageNumber = pageNumber <= totalPages ? pageNumber : totalPages; int actualPageNumber = pageNumber <= totalPages ? pageNumber : totalPages;
int from = (actualPageNumber - 1) * pageHeight; int from = (actualPageNumber - 1) * pageHeight;
int to = from + pageHeight <= lines.length ? from + pageHeight : lines.length; int to = from + pageHeight <= lines.length ? from + pageHeight : lines.length;
String[] selectedLines = Arrays.copyOfRange(lines, from, to); String[] selectedLines = Arrays.copyOfRange(lines, from, to);
return new ChatPage(selectedLines, actualPageNumber, totalPages); return new ChatPage(selectedLines, actualPageNumber, totalPages);
@ -121,7 +121,7 @@ public class ChatPaginator {
} }
} }
if(line.length() > 0) { // Only add the last line if there is anything to add if (line.length() > 0) { // Only add the last line if there is anything to add
lines.add(line.toString()); lines.add(line.toString());
} }
@ -130,7 +130,7 @@ public class ChatPaginator {
lines.set(0, ChatColor.WHITE + lines.get(0)); lines.set(0, ChatColor.WHITE + lines.get(0));
} }
for (int i = 1; i < lines.size(); i++) { for (int i = 1; i < lines.size(); i++) {
final String pLine = lines.get(i-1); final String pLine = lines.get(i - 1);
final String subLine = lines.get(i); final String subLine = lines.get(i);
char color = pLine.charAt(pLine.lastIndexOf(ChatColor.COLOR_CHAR) + 1); char color = pLine.charAt(pLine.lastIndexOf(ChatColor.COLOR_CHAR) + 1);