mirror of
https://github.com/Coloryr/AllMusic.git
synced 2026-11-28 23:59:41 +00:00
3.2.7
让颜色代码支持0x00000和#000000
This commit is contained in:
1 parent
49f24d99da
commit
a61bd095dd
3 files changed
+9
-5
No files matched your search
+1
-1
@@ -36,7 +36,7 @@ public class AllMusic {
|
||||
/**
|
||||
* 插件版本号
|
||||
*/
|
||||
public static final String version = "3.2.4";
|
||||
public static final String version = "3.2.7";
|
||||
/**
|
||||
* 配置文件版本号
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user