diff --git a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java index ed22a20b..e127100c 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java +++ b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java @@ -325,21 +325,33 @@ public class TFM_PlayerListener implements Listener TFM_Util.playerMsg(p, "Message was shortened because it was too long to send."); } - // check for caps + + // check for caps and exclamation marks if (message.length() >= 6) { int caps = 0; + int excl = 0; for (char c : message.toCharArray()) { if (Character.isUpperCase(c)) { caps++; } + + if(c == '!') + { + excl++; + } } - if (((float) caps / (float) message.length()) > 0.75) //Compute a ratio so that longer sentences can have more caps. + if (caps > 6 || caps > 3 && ((float) caps / (float) message.length()) > 0.55) { message = message.toLowerCase(); } + + if(excl++ > 3) + { + message = message.replaceAll("!", "") + '!'; + } } // finally, set message diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_ProtectedArea.java b/src/me/StevenLawson/TotalFreedomMod/TFM_ProtectedArea.java index 9e81d2a0..b0362d28 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TFM_ProtectedArea.java +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_ProtectedArea.java @@ -15,11 +15,10 @@ import org.bukkit.World; public class TFM_ProtectedArea implements Serializable { - // Serializable Classes need one of these apperantly - private static final long serialVersionUID = 1L; - - - public static final double MAX_RADIUS = 50.0D; + // Serializable Classes need one of these apperantly + private static final long serialVersionUID = 1L; + + public static final double MAX_RADIUS = 50.0D; private static Map protectedAreas = new HashMap(); private final SerializableLocation center_location; private final double radius;