From 3f2fb72a8ea96fa25c73633e94e1a4fa7a35cbfd Mon Sep 17 00:00:00 2001 From: XiaMoHuaHuo-CN <2549619802@qq.com> Date: Thu, 2 Jun 2022 22:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=91=BD=E4=BB=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moe/xmcn/catsero/events/commands/CatSero.java | 14 +++++++------- src/main/java/moe/xmcn/catsero/utils/Config.kt | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/moe/xmcn/catsero/events/commands/CatSero.java b/src/main/java/moe/xmcn/catsero/events/commands/CatSero.java index e039e5a3..ab709fb0 100644 --- a/src/main/java/moe/xmcn/catsero/events/commands/CatSero.java +++ b/src/main/java/moe/xmcn/catsero/events/commands/CatSero.java @@ -112,7 +112,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command /* Punycode */ - } else if (args[1].equalsIgnoreCase("punycode")) { + } else if (args[0].equalsIgnoreCase("punycode")) { if (args.length > 2 && args[2].equals("urlmode")) { sender.sendMessage(Punycode.encodeURL(args[1])); } else { @@ -126,6 +126,12 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command Config.INSTANCE.reloadConfig(); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', Config.INSTANCE.getPrefix_MC() + "&a配置文件已重载")); return true; + /* + 手动检查更新 + */ + } else if (args[0].equalsIgnoreCase("update")) { + sender.sendMessage(ChatColor.translateAlternateColorCodes('&', Config.INSTANCE.getPrefix_MC() + "&a开始检查更新...")); + sender.sendMessage(Updater.startUpdateCheck()); /* 可能你没启用 (XD @@ -134,12 +140,6 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command sender.sendMessage(ChatColor.translateAlternateColorCodes('&', Config.INSTANCE.getPrefix_MC() + Config.INSTANCE.getMsgByMsID("minecraft.undefined-usage"))); return false; } - /* - 手动检查更新 - */ - } else if (args[0].equalsIgnoreCase("update")) { - sender.sendMessage(ChatColor.translateAlternateColorCodes('&', Config.INSTANCE.getPrefix_MC() + "&a开始检查更新...")); - sender.sendMessage(Updater.startUpdateCheck()); } else { /* 无效方法 diff --git a/src/main/java/moe/xmcn/catsero/utils/Config.kt b/src/main/java/moe/xmcn/catsero/utils/Config.kt index d579d172..a9c70e77 100644 --- a/src/main/java/moe/xmcn/catsero/utils/Config.kt +++ b/src/main/java/moe/xmcn/catsero/utils/Config.kt @@ -4,6 +4,7 @@ import com.google.common.base.Charsets import me.clip.placeholderapi.PlaceholderAPI import moe.xmcn.catsero.Main import org.bukkit.Bukkit +import org.bukkit.ChatColor import org.bukkit.command.CommandSender import org.bukkit.configuration.file.FileConfiguration import org.bukkit.configuration.file.YamlConfiguration @@ -25,7 +26,7 @@ object Config { val Use_Bot: Long = plugin.config.getLong("qq-set.bot") val Use_Group: Long = plugin.config.getLong("qq-set.group") val QQ_OP: Long = plugin.config.getLong("qq-set.qq-op") - val Prefix_MC: String = plugin.config.getString("format-list.prefix.to-mc") + val Prefix_MC: String = plugin.config.getString("format-list.prefix.to-mc") + ChatColor.translateAlternateColorCodes('&', "&r") val Prefix_QQ: String = plugin.config.getString("format-list.prefix.to-qq") val PluginInfo: FileConfiguration =