spam_time now accepts smaller values (eg. 0.5).

This commit is contained in:
ElgarL committed 2012-01-28 17:32:24 +00:00
1 parent 12a0e8395a
commit 4de2af1506
3 files changed
+10 -9

No files matched your search

+2 -1
View File
@@ -83,4 +83,5 @@ v0.15:
v0.16: v0.16:
- Lowered event priorities to HIGH to allow other plugins the chance to beat us to the event and cancel. - Lowered event priorities to HIGH to allow other plugins the chance to beat us to the event and cancel.
- Fixed Op's with no default mode set using local chat. It will now try global, then world, then local in it's search order. - Fixed Op's with no default mode set using local chat. It will now try global, then world, then local in it's search order.
- Added a new command '/townychat reload'. - Added a new command '/townychat reload'.
- spam_time now accepts smaller values (eg. 0.5).
@@ -12,7 +12,7 @@ import com.palmergames.bukkit.towny.object.TownyWorld;
public class ChatSettings extends tag_formats { public class ChatSettings extends tag_formats {
private static long spam_time; private static Double spam_time;
private static boolean modify_chat; private static boolean modify_chat;
private static boolean per_world; private static boolean per_world;
@@ -71,16 +71,16 @@ public class ChatSettings extends tag_formats {
/** /**
* @return the spam_time * @return the spam_time
*/ */
public static long getSpam_time() { public static Double getSpam_time() {
return spam_time; return spam_time;
} }
/** /**
* @param spam_time * @param d
* the spam_time to set * the spam_time to set
*/ */
public static void setSpam_time(long spam_time) { public static void setSpam_time(Double d) {
ChatSettings.spam_time = spam_time; ChatSettings.spam_time = d;
} }
/** /**
@@ -55,7 +55,7 @@ public class ConfigurationHandler {
if (allChannelNodes != null) { if (allChannelNodes != null) {
for (String channelKey : allChannelNodes.keySet()) { for (String channelKey : allChannelNodes.keySet()) {
if (channelKey.equalsIgnoreCase("spam_time")) if (channelKey.equalsIgnoreCase("spam_time"))
ChatSettings.setSpam_time((Long)allChannelNodes.get(channelKey)); ChatSettings.setSpam_time((Double)allChannelNodes.get(channelKey));
Map<String, Object> thisChannelNode = (Map<String, Object>) allChannelNodes.get(channelKey); Map<String, Object> thisChannelNode = (Map<String, Object>) allChannelNodes.get(channelKey);
@@ -123,7 +123,7 @@ public class ConfigurationHandler {
for (String Key : file.keySet()) { for (String Key : file.keySet()) {
if (Key.equalsIgnoreCase("spam_time")) if (Key.equalsIgnoreCase("spam_time"))
ChatSettings.setSpam_time( Long.parseLong((file.get(Key)).toString()) ); ChatSettings.setSpam_time( Double.parseDouble((file.get(Key)).toString()) );
if (Key.equalsIgnoreCase("modify_chat")) { if (Key.equalsIgnoreCase("modify_chat")) {
Map<String, Object> subNodes = (Map<String, Object>) file.get(Key); Map<String, Object> subNodes = (Map<String, Object>) file.get(Key);
@@ -285,7 +285,7 @@ public class ConfigurationHandler {
String resident = "&f"; String resident = "&f";
newConfig = newConfig.replace("[spam_time]", (defaults)? "2" : Long.toString(ChatSettings.getSpam_time())); newConfig = newConfig.replace("[spam_time]", (defaults)? "0.5" : Double.toString(ChatSettings.getSpam_time()));
newConfig = newConfig.replace("[globalformat]", (defaults)? global : ChatSettings.getFormatGroup("channel_formats").getGLOBAL()); newConfig = newConfig.replace("[globalformat]", (defaults)? global : ChatSettings.getFormatGroup("channel_formats").getGLOBAL());
newConfig = newConfig.replace("[townformat]", (defaults)? town : ChatSettings.getFormatGroup("channel_formats").getTOWN()); newConfig = newConfig.replace("[townformat]", (defaults)? town : ChatSettings.getFormatGroup("channel_formats").getTOWN());