Bugfix use 1.20.4 json boolean type for urls

This commit is contained in:
Aust1n46 2024-01-06 19:56:34 -06:00
parent d87c255059
commit 05762e0bc7
2 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>mineverse.Aust1n46.chat</groupId>
<artifactId>VentureChat</artifactId>
<version>3.7.0</version>
<version>3.7.1</version>
<url>https://bitbucket.org/Aust1n46/venturechat/src/master</url>
<scm>
<url>https://bitbucket.org/Aust1n46/venturechat/src/master</url>

View File

@ -190,8 +190,8 @@ public class Format {
if (ChatColor.stripColor(link).contains("https://"))
https = "s";
temp += convertToJsonColors(lastCode + link,
",\"underlined\":\"" + underlineURLs()
+ "\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"http" + https + "://"
",\"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) + "]}}")
@ -811,8 +811,13 @@ public class Format {
.replace(")", "\\)").replace("|", "\\|").replace("+", "\\+").replace("*", "\\*");
}
public static boolean underlineURLs() {
return getInstance().getConfig().getBoolean("underlineurls", true);
public static String underlineURLs() {
final boolean configValue = getInstance().getConfig().getBoolean("underlineurls", true);
if (VersionHandler.isAtLeast_1_20_4()) {
return String.valueOf(configValue);
} else {
return "\"" + configValue + "\"";
}
}
public static String parseTimeStringFromMillis(long millis) {