From dbf0125eec13ada653bb1c9134f689f56d5c5e83 Mon Sep 17 00:00:00 2001 From: snowleo Date: Sun, 7 Apr 2013 15:00:40 +0200 Subject: Format everything using Netbeans --- Essentials2Compat/pom.xml | 30 +++++----- .../src/com/earth2me/essentials/Economy.java | 30 +++++----- .../src/com/earth2me/essentials/ISettings.java | 2 - .../src/com/earth2me/essentials/Settings.java | 70 +++++++--------------- .../com/earth2me/essentials/UpdateUserFiles.java | 1 - .../src/com/earth2me/essentials/UserData.java | 31 ---------- .../src/com/earth2me/essentials/Util.java | 3 - 7 files changed, 49 insertions(+), 118 deletions(-) (limited to 'Essentials2Compat') diff --git a/Essentials2Compat/pom.xml b/Essentials2Compat/pom.xml index 81dc96ac8..74222b99e 100644 --- a/Essentials2Compat/pom.xml +++ b/Essentials2Compat/pom.xml @@ -1,20 +1,20 @@ - 4.0.0 + 4.0.0 - - net.essentials3 - BuildAll - 3.0-SNAPSHOT - ../pom.xml - + + net.essentials3 + BuildAll + 3.0-SNAPSHOT + ../pom.xml + - Essentials2Compat - - - ${project.groupId} - Essentials - ${project.version} - - + Essentials2Compat + + + ${project.groupId} + Essentials + ${project.version} + + diff --git a/Essentials2Compat/src/com/earth2me/essentials/Economy.java b/Essentials2Compat/src/com/earth2me/essentials/Economy.java index aa383a40c..34ae3c60b 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/Economy.java +++ b/Essentials2Compat/src/com/earth2me/essentials/Economy.java @@ -14,7 +14,6 @@ public final class Economy private Economy() { } - private static IEssentials ess; private static final String noCallBeforeLoad = "Essentials API is called before Essentials is loaded."; @@ -38,11 +37,10 @@ public final class Economy /** * Sets the balance of a user * - * @param name Name of the user + * @param name Name of the user * @param balance The balance you want to set * @throws UserDoesNotExistException If a user by that name does not exists - * @throws net.ess3.api.NoLoanPermittedException - * If the user is not allowed to have a negative balance + * @throws net.ess3.api.NoLoanPermittedException If the user is not allowed to have a negative balance */ public static void setMoney(String name, double balance) throws UserDoesNotExistException, NoLoanPermittedException { @@ -56,10 +54,10 @@ public final class Economy /** * Adds money to the balance of a user * - * @param name Name of the user + * @param name Name of the user * @param amount The money you want to add * @throws UserDoesNotExistException If a user by that name does not exists - * @throws NoLoanPermittedException If the user is not allowed to have a negative balance + * @throws NoLoanPermittedException If the user is not allowed to have a negative balance */ public static void add(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException { @@ -70,10 +68,10 @@ public final class Economy /** * Subtracts money from the balance of a user * - * @param name Name of the user + * @param name Name of the user * @param amount The money you want to subtract * @throws UserDoesNotExistException If a user by that name does not exists - * @throws NoLoanPermittedException If the user is not allowed to have a negative balance + * @throws NoLoanPermittedException If the user is not allowed to have a negative balance */ public static void subtract(String name, double amount) throws UserDoesNotExistException, NoLoanPermittedException { @@ -84,10 +82,10 @@ public final class Economy /** * Divides the balance of a user by a value * - * @param name Name of the user + * @param name Name of the user * @param value The balance is divided by this value * @throws UserDoesNotExistException If a user by that name does not exists - * @throws NoLoanPermittedException If the user is not allowed to have a negative balance + * @throws NoLoanPermittedException If the user is not allowed to have a negative balance */ public static void divide(String name, double value) throws UserDoesNotExistException, NoLoanPermittedException { @@ -98,10 +96,10 @@ public final class Economy /** * Multiplies the balance of a user by a value * - * @param name Name of the user + * @param name Name of the user * @param value The balance is multiplied by this value * @throws UserDoesNotExistException If a user by that name does not exists - * @throws NoLoanPermittedException If the user is not allowed to have a negative balance + * @throws NoLoanPermittedException If the user is not allowed to have a negative balance */ public static void multiply(String name, double value) throws UserDoesNotExistException, NoLoanPermittedException { @@ -114,7 +112,7 @@ public final class Economy * * @param name Name of the user * @throws UserDoesNotExistException If a user by that name does not exists - * @throws NoLoanPermittedException If the user is not allowed to have a negative balance + * @throws NoLoanPermittedException If the user is not allowed to have a negative balance */ public static void resetBalance(String name) throws UserDoesNotExistException, NoLoanPermittedException { @@ -126,7 +124,7 @@ public final class Economy } /** - * @param name Name of the user + * @param name Name of the user * @param amount The amount of money the user should have * @return true, if the user has more or an equal amount of money * @throws UserDoesNotExistException If a user by that name does not exists @@ -137,7 +135,7 @@ public final class Economy } /** - * @param name Name of the user + * @param name Name of the user * @param amount The amount of money the user should have * @return true, if the user has more money * @throws UserDoesNotExistException If a user by that name does not exists @@ -148,7 +146,7 @@ public final class Economy } /** - * @param name Name of the user + * @param name Name of the user * @param amount The amount of money the user should not have * @return true, if the user has less money * @throws UserDoesNotExistException If a user by that name does not exists diff --git a/Essentials2Compat/src/com/earth2me/essentials/ISettings.java b/Essentials2Compat/src/com/earth2me/essentials/ISettings.java index 61cfcaad6..e566b82c9 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/ISettings.java +++ b/Essentials2Compat/src/com/earth2me/essentials/ISettings.java @@ -1,6 +1,5 @@ package com.earth2me.essentials; - import java.util.List; import java.util.Map; import java.util.Set; @@ -24,7 +23,6 @@ public interface ISettings long getBackupInterval(); //MessageFormat getChatFormat(String group); - int getChatRadius(); double getCommandCost(String label); diff --git a/Essentials2Compat/src/com/earth2me/essentials/Settings.java b/Essentials2Compat/src/com/earth2me/essentials/Settings.java index cda4a91c5..40ed1918c 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/Settings.java +++ b/Essentials2Compat/src/com/earth2me/essentials/Settings.java @@ -52,7 +52,6 @@ public final class Settings implements ISettings { return config.getInt("sethome-multiple." + set, config.getInt("sethome-multiple.default", 3)); } - private int chatRadius = 0; private int _getChatRadius() @@ -89,7 +88,6 @@ public final class Settings implements ISettings { return config.getInt("starting-balance", 0); } - private Set disabledCommands = new HashSet(); @Override @@ -142,10 +140,8 @@ public final class Settings implements ISettings } return config.getBoolean("override-" + name.toLowerCase(Locale.ENGLISH), false); } - private ConfigurationSection commandCosts; - public ConfigurationSection _getCommandCosts() { if (config.isConfigurationSection("command-costs")) @@ -178,7 +174,6 @@ public final class Settings implements ISettings } return 0.0; } - private String nicknamePrefix = "~"; private String _getNicknamePrefix() @@ -203,7 +198,6 @@ public final class Settings implements ISettings { return config.getDouble("heal-cooldown", 0); } - private ConfigurationSection kits; public ConfigurationSection _getKits() @@ -244,7 +238,6 @@ public final class Settings implements ISettings } return null; } - private ChatColor operatorColor = null; @Override @@ -318,31 +311,29 @@ public final class Settings implements ISettings { return config.getString("backup.command", null); } - private Map chatFormats = Collections.synchronizedMap(new HashMap()); /*@Override //TODO: implement this - public MessageFormat getChatFormat(String group) - { - MessageFormat mFormat = chatFormats.get(group); - if (mFormat == null) - { - String format = config.getString("chat.group-formats." + (group == null ? "Default" : group), - config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}")); - format = Util.replaceFormat(format); - format = format.replace("{DISPLAYNAME}", "%1$s"); - format = format.replace("{GROUP}", "{0}"); - format = format.replace("{MESSAGE}", "%2$s"); - format = format.replace("{WORLDNAME}", "{1}"); - format = format.replace("{SHORTWORLDNAME}", "{2}"); - format = format.replaceAll("\\{(\\D*?)\\}", "\\[$1\\]"); - format = "§r".concat(format); - mFormat = new MessageFormat(format); - chatFormats.put(group, mFormat); - } - return mFormat; - }*/ - + public MessageFormat getChatFormat(String group) + { + MessageFormat mFormat = chatFormats.get(group); + if (mFormat == null) + { + String format = config.getString("chat.group-formats." + (group == null ? "Default" : group), + config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}")); + format = Util.replaceFormat(format); + format = format.replace("{DISPLAYNAME}", "%1$s"); + format = format.replace("{GROUP}", "{0}"); + format = format.replace("{MESSAGE}", "%2$s"); + format = format.replace("{WORLDNAME}", "{1}"); + format = format.replace("{SHORTWORLDNAME}", "{2}"); + format = format.replaceAll("\\{(\\D*?)\\}", "\\[$1\\]"); + format = "§r".concat(format); + mFormat = new MessageFormat(format); + chatFormats.put(group, mFormat); + } + return mFormat; + }*/ public String getDefaultChatformat() { return config.getString("chat.format", "&7[{GROUP}]&f {DISPLAYNAME}&7:&f {MESSAGE}"); @@ -384,7 +375,6 @@ public final class Settings implements ISettings return config.getBoolean("sort-list-by-groups", true); } - public void reloadConfig() { config.load(); @@ -415,7 +405,6 @@ public final class Settings implements ISettings warnOnBuildDisallow = _warnOnBuildDisallow(); mailsPerMinute = _getMailsPerMinute(); } - private List itemSpawnBl = new ArrayList(); @Override @@ -451,7 +440,6 @@ public final class Settings implements ISettings } return epItemSpwn; } - private List enabledSigns = new ArrayList(); private boolean signsEnabled = false; @@ -490,7 +478,6 @@ public final class Settings implements ISettings } return newSigns; } - private boolean warnOnBuildDisallow; private boolean _warnOnBuildDisallow() @@ -503,7 +490,6 @@ public final class Settings implements ISettings { return warnOnBuildDisallow; } - private boolean debug = false; private boolean configDebug = false; @@ -596,7 +582,6 @@ public final class Settings implements ISettings { return config.getBoolean(configName, def); } - private final static double MAXMONEY = 10000000000000.0; @Override @@ -609,7 +594,6 @@ public final class Settings implements ISettings } return max; } - private final static double MINMONEY = -10000000000000.0; @Override @@ -644,7 +628,6 @@ public final class Settings implements ISettings { return config.getBoolean("remove-god-on-disconnect", false); } - private boolean changeDisplayName = true; private boolean _changeDisplayName() @@ -657,7 +640,6 @@ public final class Settings implements ISettings { return changeDisplayName; } - private boolean changePlayerListName = false; private boolean _changePlayerListName() @@ -676,7 +658,6 @@ public final class Settings implements ISettings { return config.getBoolean("use-bukkit-permissions", false); } - private boolean prefixsuffixconfigured = false; private boolean addprefixsuffix = false; private boolean essentialsChatActive = false; @@ -702,7 +683,6 @@ public final class Settings implements ISettings { return prefixsuffixconfigured ? addprefixsuffix : essentialsChatActive; } - private boolean disablePrefix = false; private boolean _disablePrefix() @@ -715,7 +695,6 @@ public final class Settings implements ISettings { return disablePrefix; } - private boolean disableSuffix = false; private boolean _disableSuffix() @@ -740,7 +719,6 @@ public final class Settings implements ISettings { return config.getLong("auto-afk-kick", -1); } - private boolean getFreezeAfkPlayers; @Override @@ -753,7 +731,6 @@ public final class Settings implements ISettings { return config.getBoolean("freeze-afk-players", false); } - private boolean cancelAfkOnMove; @Override @@ -772,7 +749,6 @@ public final class Settings implements ISettings { return config.getBoolean("death-messages", true); } - private Set noGodWorlds = new HashSet(); @Override @@ -804,7 +780,6 @@ public final class Settings implements ISettings { return config.getBoolean("world-home-permissions", false); } - private boolean registerBackInListener; @Override @@ -817,7 +792,6 @@ public final class Settings implements ISettings { return config.getBoolean("register-back-in-listener", false); } - private boolean disableItemPickupWhileAfk; @Override @@ -875,7 +849,6 @@ public final class Settings implements ISettings { this.metricsEnabled = metricsEnabled; } - private boolean teleportInvulnerability; @Override @@ -894,7 +867,6 @@ public final class Settings implements ISettings { return teleportInvulnerability; } - private long loginAttackDelay; private long _getLoginAttackDelay() @@ -907,7 +879,6 @@ public final class Settings implements ISettings { return loginAttackDelay; } - private int signUsePerSecond; private int _getSignUsePerSecond() @@ -937,7 +908,6 @@ public final class Settings implements ISettings double maxSpeed = config.getDouble("max-walk-speed", 0.8); return maxSpeed > 1.0 ? 1.0 : Math.abs(maxSpeed); } - private int mailsPerMinute; private int _getMailsPerMinute() diff --git a/Essentials2Compat/src/com/earth2me/essentials/UpdateUserFiles.java b/Essentials2Compat/src/com/earth2me/essentials/UpdateUserFiles.java index 040fdd875..a34734cf9 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/UpdateUserFiles.java +++ b/Essentials2Compat/src/com/earth2me/essentials/UpdateUserFiles.java @@ -134,7 +134,6 @@ class UpdateUserFiles String realname = getPlayer(name); return realname == null ? BROKENNAME : realname; } - private final Map players = new HashMap(); private String getPlayer(String check) diff --git a/Essentials2Compat/src/com/earth2me/essentials/UserData.java b/Essentials2Compat/src/com/earth2me/essentials/UserData.java index 7acf309df..b7f6d2d40 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/UserData.java +++ b/Essentials2Compat/src/com/earth2me/essentials/UserData.java @@ -16,7 +16,6 @@ public class UserData private EssentialsConf config; private final File folder; - protected UserData(IEssentials ess, File file) { this.ess = ess; @@ -59,7 +58,6 @@ public class UserData kitTimestamps = _getKitTimestamps(); nickname = _getNickname(); } - private double money; private double _getMoney() @@ -91,7 +89,6 @@ public class UserData config.setProperty("money", value); config.save(); } - private Map homes; private Map _getHomes() @@ -124,7 +121,6 @@ public class UserData return config.getLocation("homes." + search, ess.getServer()); } - public List getHomes() { return new ArrayList(homes.keySet()); @@ -166,7 +162,6 @@ public class UserData } return false; } - private String nickname; public String _getNickname() @@ -185,7 +180,6 @@ public class UserData config.setProperty("nickname", nick); config.save(); } - private List unlimited; private List _getUnlimited() @@ -216,7 +210,6 @@ public class UserData config.setProperty("unlimited", unlimited); config.save(); } - private Map powertools; private Map _getPowertools() @@ -270,7 +263,6 @@ public class UserData { return !powertools.isEmpty(); } - private StoredLocation lastLocation; private StoredLocation _getLastLocation() @@ -289,8 +281,6 @@ public class UserData { return lastLocation; } - - private long lastTeleportTimestamp; private long _getLastTeleportTimestamp() @@ -309,7 +299,6 @@ public class UserData config.setProperty("timestamps.lastteleport", time); config.save(); } - private long lastHealTimestamp; private long _getLastHealTimestamp() @@ -328,7 +317,6 @@ public class UserData config.setProperty("timestamps.lastheal", time); config.save(); } - private String jail; private String _getJail() @@ -355,7 +343,6 @@ public class UserData } config.save(); } - private List mails; private List _getMails() @@ -388,7 +375,6 @@ public class UserData mails.add(mail); setMails(mails); } - private boolean teleportEnabled; private boolean getTeleportEnabled() @@ -421,7 +407,6 @@ public class UserData setSocialSpyEnabled(ret); return ret; } - private List ignoredPlayers; public List getIgnoredPlayers() @@ -443,8 +428,6 @@ public class UserData } config.save(); } - - private boolean godmode; private boolean _getGodModeEnabled() @@ -463,7 +446,6 @@ public class UserData config.setProperty("godmode", set); config.save(); } - private boolean muted; public boolean getMuted() @@ -482,7 +464,6 @@ public class UserData config.setProperty("muted", set); config.save(); } - private long muteTimeout; private long _getMuteTimeout() @@ -501,7 +482,6 @@ public class UserData config.setProperty("timestamps.mute", time); config.save(); } - private boolean jailed; private boolean getJailed() @@ -527,7 +507,6 @@ public class UserData setJailed(ret); return ret; } - private long jailTimeout; private long _getJailTimeout() @@ -568,7 +547,6 @@ public class UserData config.setProperty("ban.timeout", time); config.save(); } - private long lastLogin; private long _getLastLogin() @@ -586,8 +564,6 @@ public class UserData lastLogin = time; config.setProperty("timestamps.login", time); } - - private long lastLogout; private long _getLastLogout() @@ -606,7 +582,6 @@ public class UserData config.setProperty("timestamps.logout", time); config.save(); } - private String lastLoginAddress; private String _getLastLoginAddress() @@ -624,7 +599,6 @@ public class UserData lastLoginAddress = address; config.setProperty("ipAddress", address); } - private boolean afk; private boolean getAfk() @@ -650,7 +624,6 @@ public class UserData setAfk(ret); return ret; } - private boolean newplayer; //TODO: unused variable? private String geolocation; @@ -678,7 +651,6 @@ public class UserData } config.save(); } - private boolean isSocialSpyEnabled; private boolean _isSocialSpyEnabled() @@ -697,7 +669,6 @@ public class UserData config.setProperty("socialspy", status); config.save(); } - private boolean isNPC; private boolean _isNPC() @@ -716,7 +687,6 @@ public class UserData config.setProperty("npc", set); config.save(); } - private boolean arePowerToolsEnabled; public boolean arePowerToolsEnabled() @@ -742,7 +712,6 @@ public class UserData { return config.getBoolean("powertoolsenabled", true); } - private ConfigurationSection kitTimestamps; private ConfigurationSection _getKitTimestamps() diff --git a/Essentials2Compat/src/com/earth2me/essentials/Util.java b/Essentials2Compat/src/com/earth2me/essentials/Util.java index 21ff4e8b4..bb66d7dcc 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/Util.java +++ b/Essentials2Compat/src/com/earth2me/essentials/Util.java @@ -12,7 +12,6 @@ public class Util private Util() { } - private final static Pattern INVALIDFILECHARS = Pattern.compile("[^a-z0-9]"); private final static Pattern INVALIDCHARS = Pattern.compile("[^\t\n\r\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFC]"); @@ -33,8 +32,6 @@ public class Util { return INVALIDCHARS.matcher(string).replaceAll(""); } - - private static DecimalFormat dFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US)); public static String formatAsCurrency(final double value) -- cgit v1.2.3