让颜色代码支持0x00000和#000000
This commit is contained in:
Coloryr committed 2024-09-23 13:31:53 +08:00
1 parent 49f24d99da
commit a61bd095dd
3 files changed
+9 -5

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ public class AllMusic {
/**
* 插件版本号
*/
public static final String version = "3.2.4";
public static final String version = "3.2.7";
/**
* 配置文件版本号
*/
+7 -3
View File
@@ -419,9 +419,13 @@ public class HudUtils {
public static boolean setColor(String player, HudType type, String arg) {
int color;
try {
color = arg.startsWith("0x")
? Integer.parseUnsignedInt(arg.substring(2), 16)
: Integer.parseUnsignedInt(arg);
if (arg.startsWith("0x")) {
color = Integer.parseUnsignedInt(arg.substring(2), 16);
} else if (arg.startsWith("#")) {
color = Integer.parseUnsignedInt(arg.substring(1), 16);
} else {
color = Integer.parseUnsignedInt(arg);
}
} catch (Exception ignored) {
return false;
}
+1 -1
View File
@@ -1 +1 @@
3.2.6
3.2.7