diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-01-09 21:18:46 +0000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-01-09 21:18:46 +0000 |
commit | 465cdae9893d9e3ffba321fd3ded12ad22d44872 (patch) | |
tree | 21bef2f5d1e5545831831613f666e48946be26e1 | |
parent | 341cb89bb7cacfed3ea2f106cc55eea312c80fd2 (diff) | |
download | Essentials-465cdae9893d9e3ffba321fd3ded12ad22d44872.tar Essentials-465cdae9893d9e3ffba321fd3ded12ad22d44872.tar.gz Essentials-465cdae9893d9e3ffba321fd3ded12ad22d44872.tar.lz Essentials-465cdae9893d9e3ffba321fd3ded12ad22d44872.tar.xz Essentials-465cdae9893d9e3ffba321fd3ded12ad22d44872.zip |
Util commenting
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Util.java | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Util.java b/Essentials/src/com/earth2me/essentials/Util.java index 12f5c9da6..a31d18f0e 100644 --- a/Essentials/src/com/earth2me/essentials/Util.java +++ b/Essentials/src/com/earth2me/essentials/Util.java @@ -614,6 +614,7 @@ public class Util private static transient final Pattern REPLACE_MAGIC_PATTERN = Pattern.compile("&(k)"); private static transient final Pattern REPLACE_FORMAT_PATTERN = Pattern.compile("&([l-or])"); + //This method is used to simply strip the native minecraft colour codes public static String stripFormat(final String input) { if (input == null) @@ -632,6 +633,7 @@ public class Util return LOGCOLOR_PATTERN.matcher(input).replaceAll(""); } + //This method is used to simply replace the ess colour codes with minecraft ones, ie &c public static String replaceFormat(final String input) { if (input == null) @@ -641,20 +643,7 @@ public class Util return REPLACE_PATTERN.matcher(input).replaceAll("\u00a7$1"); } - public static String blockURL(final String input) - { - if (input == null) - { - return null; - } - String text = URL_PATTERN.matcher(input).replaceAll("$1 $2"); - while (URL_PATTERN.matcher(text).find()) - { - text = URL_PATTERN.matcher(text).replaceAll("$1 $2"); - } - return text; - } - + //This is the general permission sensitive message format function, does not touch urls. public static String formatString(final IUser user, final String permBase, final String input) { if (input == null) @@ -689,6 +678,7 @@ public class Util return message; } + //This is the general permission sensitive message format function, checks for urls. public static String formatMessage(final IUser user, final String permBase, final String input) { if (input == null) @@ -702,6 +692,20 @@ public class Util } return message; } + + private static String blockURL(final String input) + { + if (input == null) + { + return null; + } + String text = URL_PATTERN.matcher(input).replaceAll("$1 $2"); + while (URL_PATTERN.matcher(text).find()) + { + text = URL_PATTERN.matcher(text).replaceAll("$1 $2"); + } + return text; + } private static String stripColor(final String input, final Pattern pattern) { |