From a5d9f2e5fb245e32a1503fed9c3c6a455ad5b6e3 Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Thu, 2 Nov 2023 17:51:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?misc:=20=E5=8F=AA=E6=A3=80=E6=9F=A5Release?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/xiamomc/morph/updates/UpdateHandler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/xiamomc/morph/updates/UpdateHandler.java b/src/main/java/xiamomc/morph/updates/UpdateHandler.java index bb6a2fef..1ec0f8d4 100644 --- a/src/main/java/xiamomc/morph/updates/UpdateHandler.java +++ b/src/main/java/xiamomc/morph/updates/UpdateHandler.java @@ -171,7 +171,10 @@ private void onUpdateReqFinish(CloseableHttpResponse response, int reqId, var supportedLoaders = m.supportedLoaders; if (supportedLoaders == null) return false; - return supportedLoaders.stream().anyMatch(s -> s.equalsIgnoreCase(loader.getImplName())); + var isRelease = "Release".equalsIgnoreCase(m.versionType); + var loaderMatch = supportedLoaders.stream().anyMatch(s -> s.equalsIgnoreCase(loader.getImplName())); + + return isRelease && loaderMatch; }).findFirst().orElse(null); if (matchMeta == null) From 76435dbafcf44663c0fa63816d634b9b3bbaf2a5 Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Thu, 2 Nov 2023 17:56:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?misc:=20=E8=B0=83=E6=95=B4=E2=80=9C?= =?UTF-8?q?=E5=B7=B2=E6=98=AF=E6=9C=80=E6=96=B0=E7=89=88=E2=80=9D=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commands/subcommands/plugin/CheckUpdateSubCommand.java | 6 +++++- src/main/java/xiamomc/morph/updates/UpdateHandler.java | 2 +- src/main/resources/assets/feathermorph/lang/en_us.json | 2 +- src/main/resources/assets/feathermorph/lang/zh_cn.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java b/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java index 59ec5c0e..b84967f8 100644 --- a/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java +++ b/src/main/java/xiamomc/morph/commands/subcommands/plugin/CheckUpdateSubCommand.java @@ -1,5 +1,6 @@ package xiamomc.morph.commands.subcommands.plugin; +import org.bukkit.Bukkit; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -53,6 +54,9 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull String[] args) private void onRequestFinish(UpdateHandler.CheckResult result, CommandSender sender) { if (result == UpdateHandler.CheckResult.ALREADY_LATEST) - sender.sendMessage(MessageUtils.prefixes(sender, UpdateStrings.noNewVersionAvailable())); + { + var msg = UpdateStrings.noNewVersionAvailable().resolve("mc_version", Bukkit.getMinecraftVersion()); + sender.sendMessage(MessageUtils.prefixes(sender, msg)); + } } } diff --git a/src/main/java/xiamomc/morph/updates/UpdateHandler.java b/src/main/java/xiamomc/morph/updates/UpdateHandler.java index 1ec0f8d4..838c7a40 100644 --- a/src/main/java/xiamomc/morph/updates/UpdateHandler.java +++ b/src/main/java/xiamomc/morph/updates/UpdateHandler.java @@ -200,7 +200,7 @@ private void onUpdateReqFinish(CloseableHttpResponse response, int reqId, if (currentVersion.equals(latestVersion)) { - logger.info("Already on the latest version"); + logger.info("Already on the latest version for " + Bukkit.getMinecraftVersion()); if (onFinish != null) onFinish.accept(CheckResult.ALREADY_LATEST); diff --git a/src/main/resources/assets/feathermorph/lang/en_us.json b/src/main/resources/assets/feathermorph/lang/en_us.json index b0957e99..8c4f68ef 100644 --- a/src/main/resources/assets/feathermorph/lang/en_us.json +++ b/src/main/resources/assets/feathermorph/lang/en_us.json @@ -124,7 +124,7 @@ "update.msg_header_footer": "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-", "update.checking_update": "Checking update...", "update.new_version_available": "A newer version of FeatherMorph has been released!( -> )", - "update.no_new_ver_available": "You're already on the latest version", + "update.no_new_ver_available": "You're already on the latest version for ", "update.update_here": "Update here: ", "requests.already_have_disguise": "You already have their disguise!", "requests.cant_send_to_self": "You can't send requests to yourself", diff --git a/src/main/resources/assets/feathermorph/lang/zh_cn.json b/src/main/resources/assets/feathermorph/lang/zh_cn.json index 62256957..5e11e1b0 100644 --- a/src/main/resources/assets/feathermorph/lang/zh_cn.json +++ b/src/main/resources/assets/feathermorph/lang/zh_cn.json @@ -124,7 +124,7 @@ "update.msg_header_footer": "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-", "update.checking_update": "检查更新中...", "update.new_version_available": "FeatherMorph有新版本辣!( -> )", - "update.no_new_ver_available": "FeatherMorph已是最新版本", + "update.no_new_ver_available": "FeatherMorph已是上的最新版本", "update.update_here": "在此更新:", "requests.already_have_disguise": "你已经有对方的形态了", "requests.cant_send_to_self": "你不能给自己发请求",