summaryrefslogtreecommitdiffstats
path: root/Essentials2Compat/src/com/earth2me/essentials/Settings.java
diff options
context:
space:
mode:
authorIaccidentally <coryhuckaby@gmail.com>2013-01-14 20:06:28 -0500
committerIaccidentally <coryhuckaby@gmail.com>2013-01-14 20:06:28 -0500
commit2a097530e5ea96e1329dca19b049a23ccce5d3ba (patch)
treeda72b93c02edb4182f649114fee5fad7d833601f /Essentials2Compat/src/com/earth2me/essentials/Settings.java
parent8e54bf13b281d1299c3dc33f89940bd3a06d1a30 (diff)
downloadEssentials-2a097530e5ea96e1329dca19b049a23ccce5d3ba.tar
Essentials-2a097530e5ea96e1329dca19b049a23ccce5d3ba.tar.gz
Essentials-2a097530e5ea96e1329dca19b049a23ccce5d3ba.tar.lz
Essentials-2a097530e5ea96e1329dca19b049a23ccce5d3ba.tar.xz
Essentials-2a097530e5ea96e1329dca19b049a23ccce5d3ba.zip
Revert "Remove Transient :: Formatting Cleanup"
Diffstat (limited to 'Essentials2Compat/src/com/earth2me/essentials/Settings.java')
-rw-r--r--Essentials2Compat/src/com/earth2me/essentials/Settings.java74
1 files changed, 52 insertions, 22 deletions
diff --git a/Essentials2Compat/src/com/earth2me/essentials/Settings.java b/Essentials2Compat/src/com/earth2me/essentials/Settings.java
index bd8671c7b..a5f454916 100644
--- a/Essentials2Compat/src/com/earth2me/essentials/Settings.java
+++ b/Essentials2Compat/src/com/earth2me/essentials/Settings.java
@@ -16,9 +16,9 @@ import org.bukkit.inventory.ItemStack;
public final class Settings implements ISettings
{
- private final EssentialsConf config;
+ private final transient EssentialsConf config;
private final static Logger logger = Logger.getLogger("Minecraft");
- private final IEssentials ess;
+ private final transient IEssentials ess;
private boolean metricsEnabled = true;
public Settings(IEssentials ess, File file)
@@ -52,6 +52,7 @@ 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()
@@ -88,6 +89,7 @@ public final class Settings implements ISettings
{
return config.getInt("starting-balance", 0);
}
+
private Set<String> disabledCommands = new HashSet<String>();
@Override
@@ -140,8 +142,10 @@ 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"))
@@ -174,6 +178,7 @@ public final class Settings implements ISettings
}
return 0.0;
}
+
private String nicknamePrefix = "~";
private String _getNicknamePrefix()
@@ -198,6 +203,7 @@ public final class Settings implements ISettings
{
return config.getDouble("heal-cooldown", 0);
}
+
private ConfigurationSection kits;
public ConfigurationSection _getKits()
@@ -238,6 +244,7 @@ public final class Settings implements ISettings
}
return null;
}
+
private ChatColor operatorColor = null;
@Override
@@ -311,29 +318,31 @@ public final class Settings implements ISettings
{
return config.getString("backup.command", null);
}
+
private Map<String, MessageFormat> chatFormats = Collections.synchronizedMap(new HashMap<String, MessageFormat>());
/*@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}");
@@ -375,6 +384,7 @@ public final class Settings implements ISettings
return config.getBoolean("sort-list-by-groups", true);
}
+
public void reloadConfig()
{
config.load();
@@ -405,6 +415,7 @@ public final class Settings implements ISettings
warnOnBuildDisallow = _warnOnBuildDisallow();
mailsPerMinute = _getMailsPerMinute();
}
+
private List<Integer> itemSpawnBl = new ArrayList<Integer>();
@Override
@@ -440,6 +451,7 @@ public final class Settings implements ISettings
}
return epItemSpwn;
}
+
private List<String> enabledSigns = new ArrayList<String>();
private boolean signsEnabled = false;
@@ -478,6 +490,7 @@ public final class Settings implements ISettings
}
return newSigns;
}
+
private boolean warnOnBuildDisallow;
private boolean _warnOnBuildDisallow()
@@ -490,6 +503,7 @@ public final class Settings implements ISettings
{
return warnOnBuildDisallow;
}
+
private boolean debug = false;
private boolean configDebug = false;
@@ -582,6 +596,7 @@ public final class Settings implements ISettings
{
return config.getBoolean(configName, def);
}
+
private final static double MAXMONEY = 10000000000000.0;
@Override
@@ -594,6 +609,7 @@ public final class Settings implements ISettings
}
return max;
}
+
private final static double MINMONEY = -10000000000000.0;
@Override
@@ -628,6 +644,7 @@ public final class Settings implements ISettings
{
return config.getBoolean("remove-god-on-disconnect", false);
}
+
private boolean changeDisplayName = true;
private boolean _changeDisplayName()
@@ -640,6 +657,7 @@ public final class Settings implements ISettings
{
return changeDisplayName;
}
+
private boolean changePlayerListName = false;
private boolean _changePlayerListName()
@@ -658,6 +676,7 @@ 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;
@@ -683,6 +702,7 @@ public final class Settings implements ISettings
{
return prefixsuffixconfigured ? addprefixsuffix : essentialsChatActive;
}
+
private boolean disablePrefix = false;
private boolean _disablePrefix()
@@ -695,6 +715,7 @@ public final class Settings implements ISettings
{
return disablePrefix;
}
+
private boolean disableSuffix = false;
private boolean _disableSuffix()
@@ -719,6 +740,7 @@ public final class Settings implements ISettings
{
return config.getLong("auto-afk-kick", -1);
}
+
private boolean getFreezeAfkPlayers;
@Override
@@ -731,6 +753,7 @@ public final class Settings implements ISettings
{
return config.getBoolean("freeze-afk-players", false);
}
+
private boolean cancelAfkOnMove;
@Override
@@ -749,6 +772,7 @@ public final class Settings implements ISettings
{
return config.getBoolean("death-messages", true);
}
+
private Set<String> noGodWorlds = new HashSet<String>();
@Override
@@ -780,6 +804,7 @@ public final class Settings implements ISettings
{
return config.getBoolean("world-home-permissions", false);
}
+
private boolean registerBackInListener;
@Override
@@ -792,6 +817,7 @@ public final class Settings implements ISettings
{
return config.getBoolean("register-back-in-listener", false);
}
+
private boolean disableItemPickupWhileAfk;
@Override
@@ -849,6 +875,7 @@ public final class Settings implements ISettings
{
this.metricsEnabled = metricsEnabled;
}
+
private boolean teleportInvulnerability;
@Override
@@ -867,6 +894,7 @@ public final class Settings implements ISettings
{
return teleportInvulnerability;
}
+
private long loginAttackDelay;
private long _getLoginAttackDelay()
@@ -879,6 +907,7 @@ public final class Settings implements ISettings
{
return loginAttackDelay;
}
+
private int signUsePerSecond;
private int _getSignUsePerSecond()
@@ -908,6 +937,7 @@ 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()