From a61bd095dd57b5873e229ebbfe62c9a1502a5cab Mon Sep 17 00:00:00 2001 From: Coloryr <402067010@qq.com> Date: Mon, 23 Sep 2024 13:31:53 +0800 Subject: [PATCH] 3.2.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 让颜色代码支持0x00000和#000000 --- core/AllMusic.java | 2 +- core/utils/HudUtils.java | 10 +++++++--- version | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/AllMusic.java b/core/AllMusic.java index 005c3c69..f5770959 100644 --- a/core/AllMusic.java +++ b/core/AllMusic.java @@ -36,7 +36,7 @@ public class AllMusic { /** * 插件版本号 */ - public static final String version = "3.2.4"; + public static final String version = "3.2.7"; /** * 配置文件版本号 */ diff --git a/core/utils/HudUtils.java b/core/utils/HudUtils.java index 1443e43f..7e2599d1 100644 --- a/core/utils/HudUtils.java +++ b/core/utils/HudUtils.java @@ -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; } diff --git a/version b/version index c4a602db..6a3913b0 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.2.6 \ No newline at end of file +3.2.7 \ No newline at end of file