Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Commit

Permalink
修复命令错误
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaMoHuaHuo-CN committed Jun 2, 2022
1 parent 10336d7 commit 3f2fb72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/main/java/moe/xmcn/catsero/events/commands/CatSero.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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 {
/*
无效方法
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/moe/xmcn/catsero/utils/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 =
Expand Down

0 comments on commit 3f2fb72

Please sign in to comment.