diff --git a/src/changelog.txt b/src/changelog.txt index a780d90..682e31a 100644 --- a/src/changelog.txt +++ b/src/changelog.txt @@ -83,4 +83,5 @@ v0.15: v0.16: - 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. - - Added a new command '/townychat reload'. \ No newline at end of file + - Added a new command '/townychat reload'. + - spam_time now accepts smaller values (eg. 0.5). \ No newline at end of file diff --git a/src/com/palmergames/bukkit/TownyChat/config/ChatSettings.java b/src/com/palmergames/bukkit/TownyChat/config/ChatSettings.java index 638965e..7ad582d 100644 --- a/src/com/palmergames/bukkit/TownyChat/config/ChatSettings.java +++ b/src/com/palmergames/bukkit/TownyChat/config/ChatSettings.java @@ -12,7 +12,7 @@ import com.palmergames.bukkit.towny.object.TownyWorld; public class ChatSettings extends tag_formats { - private static long spam_time; + private static Double spam_time; private static boolean modify_chat; private static boolean per_world; @@ -71,16 +71,16 @@ public class ChatSettings extends tag_formats { /** * @return the spam_time */ - public static long getSpam_time() { + public static Double getSpam_time() { return spam_time; } /** - * @param spam_time + * @param d * the spam_time to set */ - public static void setSpam_time(long spam_time) { - ChatSettings.spam_time = spam_time; + public static void setSpam_time(Double d) { + ChatSettings.spam_time = d; } /** diff --git a/src/com/palmergames/bukkit/TownyChat/config/ConfigurationHandler.java b/src/com/palmergames/bukkit/TownyChat/config/ConfigurationHandler.java index 8d41583..1ead8d7 100644 --- a/src/com/palmergames/bukkit/TownyChat/config/ConfigurationHandler.java +++ b/src/com/palmergames/bukkit/TownyChat/config/ConfigurationHandler.java @@ -55,7 +55,7 @@ public class ConfigurationHandler { if (allChannelNodes != null) { for (String channelKey : allChannelNodes.keySet()) { if (channelKey.equalsIgnoreCase("spam_time")) - ChatSettings.setSpam_time((Long)allChannelNodes.get(channelKey)); + ChatSettings.setSpam_time((Double)allChannelNodes.get(channelKey)); Map thisChannelNode = (Map) allChannelNodes.get(channelKey); @@ -123,7 +123,7 @@ public class ConfigurationHandler { for (String Key : file.keySet()) { 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")) { Map subNodes = (Map) file.get(Key); @@ -285,7 +285,7 @@ public class ConfigurationHandler { 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("[townformat]", (defaults)? town : ChatSettings.getFormatGroup("channel_formats").getTOWN());