mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Fixed Auto-Decaps not working
Added Removal of excessive exclamation marks
This commit is contained in:
parent
fbc8d20fda
commit
488d721a93
@ -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
|
||||
|
@ -18,7 +18,6 @@ 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;
|
||||
private static Map<String, TFM_ProtectedArea> protectedAreas = new HashMap<String, TFM_ProtectedArea>();
|
||||
private final SerializableLocation center_location;
|
||||
|
Loading…
Reference in New Issue
Block a user