diff --git a/MineverseChat/mineverse/Aust1n46/chat/utilities/Format.java b/MineverseChat/mineverse/Aust1n46/chat/utilities/Format.java index e9ef53a..e3f21fa 100644 --- a/MineverseChat/mineverse/Aust1n46/chat/utilities/Format.java +++ b/MineverseChat/mineverse/Aust1n46/chat/utilities/Format.java @@ -143,7 +143,7 @@ public class Format { String https = ""; if(ChatColor.stripColor(link).contains("https://")) https = "s"; - temp += convertToJsonColors(lastCode + link, ",\"underlined\":\"" + plugin.getConfig().getBoolean("underlineurls", true) + "\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"http" + https + "://" + ChatColor.stripColor(link.replace("http://", "").replace("https://", "")) + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[" + convertToJsonColors(lastCode + link) + "]}}") + ","; + temp += convertToJsonColors(lastCode + link, ",\"underlined\":\"" + underlineURLs() + "\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"http" + https + "://" + ChatColor.stripColor(link.replace("http://", "").replace("https://", "")) + "\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[" + convertToJsonColors(lastCode + link) + "]}}") + ","; lastCode = getLastCode(lastCode + link); remaining = remaining.substring(indexLinkEnd); } @@ -478,4 +478,8 @@ public class Format { public static String escapeAllRegex(String input) { return input.replace("[", "\\[").replace("]", "\\]").replace("{", "\\{").replace("}", "\\}").replace("(", "\\(").replace(")", "\\)").replace("|", "\\|").replace("+", "\\+").replace("*", "\\*"); } + + public static boolean underlineURLs() { + return plugin.getConfig().getBoolean("underlineurls", true); + } } \ No newline at end of file