From 33b935a2c00d2cb7dd70f42846a716dddcbe667c Mon Sep 17 00:00:00 2001 From: RiceChen_ <68499464+RICE0707@users.noreply.github.com> Date: Thu, 12 Sep 2024 19:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=A9=E6=B4=BB=E7=94=9F=E6=97=A5=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=EF=BC=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/birthdayplugin/BirthdayPlugin.kt | 2 +- .../birthdayplugin/command/GiftCommand.kt | 8 ++++---- .../birthdayplugin/command/HelpCommand.kt | 16 ++++++++-------- .../birthdayplugin/command/ReloadCommand.kt | 6 +++--- .../plugins/birthdayplugin/command/SetCommand.kt | 16 ++++++++-------- .../command/SwitchAnnouncementCommand.kt | 8 ++++---- .../command/SwitchGreetingsCommand.kt | 8 ++++---- .../server/plugins/birthdayplugin/util/Util.kt | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/BirthdayPlugin.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/BirthdayPlugin.kt index ca13f79..83a76a5 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/BirthdayPlugin.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/BirthdayPlugin.kt @@ -30,7 +30,7 @@ class BirthdayPlugin : JavaPlugin() { LOGGER.severe("Command btd is not found") } else { birthdayCommand.setExecutor(BirthdayCommandExecutor()) - birthdayCommand.description = "輝煌伺服器生日系統指令 (btd /help)" + birthdayCommand.description = "輝煌伺服器生日系統指令(/btd help)" LOGGER.info("Register btd command successful") } diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/GiftCommand.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/GiftCommand.kt index 9141de8..1bc0ef6 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/GiftCommand.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/GiftCommand.kt @@ -8,7 +8,7 @@ import org.bukkit.entity.Player class GiftCommand : CommandHandler() { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array) { - if (sender !is Player) return Util.sendSystemMessage(sender, "&c此指令只能在遊戲內使用") + if (sender !is Player) return Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7此指令只能在遊戲內使用") val birthday = BirthdayStorage.get(sender) @@ -16,13 +16,13 @@ class GiftCommand : CommandHandler() { if (birthday.canGiveGift(sender.isOp)) { birthday.giveGift(sender, false) } else { - Util.sendSystemMessage(sender, "&c您已經領取過生日禮包囉~") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7您已經領取過生日禮包囉~") } } else { if (birthday.calendar != null) { - Util.sendSystemMessage(sender, "&c領取生日禮包失敗,今天不是您的生日喔~") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7領取生日禮包失敗,今天不是您的生日喔~") } else { - Util.sendSystemMessage(sender, "&c領取生日禮包失敗,您尚未設定生日") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7領取生日禮包失敗,您尚未設定生日") } } } diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/HelpCommand.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/HelpCommand.kt index 92a9af2..f1325e8 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/HelpCommand.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/HelpCommand.kt @@ -8,18 +8,18 @@ class HelpCommand : CommandHandler() { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array) { val components = ComponentBuilder() if (sender.isOp) { - components.append("§7[§6系統§7] §f飯娘:§7/btd set
- 設定指定玩家的生日\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd set
- 設定指定玩家的生日\n") } else { - components.append("§7[§6系統§7] §f飯娘:§7/btd set
- 設定您的生日 (設定後不能再重設)\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd set
- 設定您的生日 (設定後不能再重設)\n") } - components.append("§7[§6系統§7] §f飯娘:§7/btd gs off - 關閉個人生日祝福(預設開啟)\n") - components.append("§7[§6系統§7] §f飯娘:§7/btd gs on - 開啟個人生日祝福(預設開啟)\n") - components.append("§7[§6系統§7] §f飯娘:§7/btd at off - 關閉全伺服器生日祝福(預設開啟)\n") - components.append("§7[§6系統§7] §f飯娘:§7/btd at on - 開啟全伺服器生日祝福(預設開啟)\n") - components.append("§7[§6系統§7] §f飯娘:§7/btd gift - 領取生日禮包(預設自動領取,只能領取一次)\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd gs off - 關閉個人生日祝福(預設開啟)\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd gs on - 開啟個人生日祝福(預設開啟)\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd at off - 關閉全伺服器生日祝福(預設開啟)\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd at on - 開啟全伺服器生日祝福(預設開啟)\n") + components.append("§7|§6系統§7|§f飯娘:§7/btd gift - 領取生日禮包(預設自動領取,只能領取一次)\n") - components.append("§7[§6系統§7] §f飯娘:§7/btd help - 顯示生日指令幫助列表 (就是此頁面)") + components.append("§7|§6系統§7|§f飯娘:§7/btd help - 顯示生日指令幫助列表 (就是此頁面)") sender.spigot().sendMessage(*components.create()) } diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/ReloadCommand.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/ReloadCommand.kt index 972b901..0fc01bf 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/ReloadCommand.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/ReloadCommand.kt @@ -9,12 +9,12 @@ import org.bukkit.command.CommandSender class ReloadCommand : CommandHandler() { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array) { if (sender.isOp) { - Util.sendSystemMessage(sender, "&7正在重新載入生日插件資料...") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7正在重新載入生日插件資料...") BirthdayStorage.reload() BirthdayConfig.reload() - Util.sendSystemMessage(sender, "&7成功重新載入生日插件資料!") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7成功重新載入生日插件資料!") } else { - Util.sendSystemMessage(sender, "&c您沒有權限執行此指令") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7您沒有權限執行此指令。") } } } diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SetCommand.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SetCommand.kt index 6e30e07..c056088 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SetCommand.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SetCommand.kt @@ -10,7 +10,7 @@ import org.bukkit.entity.Player class SetCommand : CommandHandler() { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array) { - if (sender !is Player) return Util.sendSystemMessage(sender, "&c此指令只能在遊戲內使用") + if (sender !is Player) return Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7此指令只能在遊戲內使用。") if (sender.isOp && args.size == 5) { val player = sender.server.offlinePlayers.find { it.name == args[1] || it.uniqueId.toString() == args[1] } @@ -18,18 +18,18 @@ class SetCommand : CommandHandler() { if (player != null) { setBirthday(sender, player, args, 2) } else { - Util.sendSystemMessage(sender, "找不到此玩家:${args[1]}") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7找不到此玩家:${args[1]}。") } } else if (!sender.isOp && args.size == 4) { val oldBirthday = BirthdayStorage.get(sender) if (oldBirthday.calendar != null) { - Util.sendSystemMessage(sender, "您已經設定過生日了,生日只能設定一次!") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7您已經設定過生日了,生日只能設定一次!") return } setBirthday(sender, sender, args, 1) } else { - Util.sendSystemMessage(sender, "設定生日失敗,請檢查輸入的日期格式是否正確 (請輸入 [/btd help] 查看用法)") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7設定生日失敗,請檢查輸入的日期格式是否正確(請輸入 [/btd help] 查看用法)") } } @@ -44,7 +44,7 @@ class SetCommand : CommandHandler() { calendar.set(year, month - 1, day) if (calendar.after(Util.getTaipeiCalendar())) { - Util.sendSystemMessage(sender, "設定生日失敗,你不是未來人 ._.") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7設定生日失敗,你不是未來人 ._.") return } @@ -55,15 +55,15 @@ class SetCommand : CommandHandler() { player, oldData.copy(calendar = calendar) ) - Util.sendSystemMessage(sender, "成功設定生日,${player.name} 的生日為:$year 年 $month 月 $day 日") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7成功設定生日,${player.name} 的生日為:$year 年 $month 月 $day 日") } catch (e: Exception) { Util.sendSystemMessage( sender, - "設定生日失敗,請檢查輸入的日期格式是否正確 (請輸入 [/btd help] 查看用法)" + "§7|§6系統§7|§f飯娘:§7設定生日失敗,請檢查輸入的日期格式是否正確(請輸入 [/btd help] 查看用法)" ) } } else { - Util.sendSystemMessage(sender, "設定生日失敗,請檢查輸入的日期格式是否正確 (請輸入 [/btd help] 查看用法)") + Util.sendSystemMessage(sender, §7|§6系統§7|§f飯娘:§7"設定生日失敗,請檢查輸入的日期格式是否正確(請輸入 [/btd help] 查看用法)") } } } \ No newline at end of file diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchAnnouncementCommand.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchAnnouncementCommand.kt index f5ac473..3538d0d 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchAnnouncementCommand.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchAnnouncementCommand.kt @@ -8,7 +8,7 @@ import org.bukkit.entity.Player class SwitchAnnouncementCommand : CommandHandler() { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array) { - if (sender !is Player) return Util.sendSystemMessage(sender, "&c此指令只能在遊戲內使用") + if (sender !is Player) return Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7此指令只能在遊戲內使用。") val value = args.getOrNull(1) val birthday = BirthdayStorage.get(sender) @@ -16,15 +16,15 @@ class SwitchAnnouncementCommand : CommandHandler() { when (value) { "on" -> { BirthdayStorage.set(sender, birthday.copy(announcement = true)) - Util.sendSystemMessage(sender, "已啟用全伺服器生日祝福") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§a已啟用§7全伺服器生日祝福。") } "off" -> { BirthdayStorage.set(sender, birthday.copy(announcement = false)) - Util.sendSystemMessage(sender, "已停用全伺服器生日祝福") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§c已停用§7全伺服器生日祝福。") } - else -> Util.sendSystemMessage(sender, "生日指令格式錯誤 (請輸入 [/btd help] 查看用法)") + else -> Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7生日指令格式錯誤(請輸入 [/btd help] 查看用法)") } } } \ No newline at end of file diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchGreetingsCommand.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchGreetingsCommand.kt index 1a9e66c..c028e49 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchGreetingsCommand.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/command/SwitchGreetingsCommand.kt @@ -8,7 +8,7 @@ import org.bukkit.entity.Player class SwitchGreetingsCommand : CommandHandler() { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array) { - if (sender !is Player) return Util.sendSystemMessage(sender, "&c此指令只能在遊戲內使用") + if (sender !is Player) return Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7此指令只能在遊戲內使用。") val value = args.getOrNull(1) val birthday = BirthdayStorage.get(sender) @@ -16,15 +16,15 @@ class SwitchGreetingsCommand : CommandHandler() { when (value) { "on" -> { BirthdayStorage.set(sender, birthday.copy(greetings = true)) - Util.sendSystemMessage(sender, "已啟用個人生日祝福") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§a已啟用§7個人生日祝福。") } "off" -> { BirthdayStorage.set(sender, birthday.copy(greetings = false)) - Util.sendSystemMessage(sender, "已停用個人生日祝福") + Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§c已停用§7個人生日祝福。") } - else -> Util.sendSystemMessage(sender, "生日指令格式錯誤 (請輸入 [/btd help] 查看用法)") + else -> Util.sendSystemMessage(sender, "§7|§6系統§7|§f飯娘:§7生日指令格式錯誤(請輸入 [/btd help] 查看用法)") } } } \ No newline at end of file diff --git a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/util/Util.kt b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/util/Util.kt index bf9dce6..843bc27 100644 --- a/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/util/Util.kt +++ b/src/main/kotlin/tw/brilliant/server/plugins/birthdayplugin/util/Util.kt @@ -28,7 +28,7 @@ object Util { } private fun getSystemMessage(message: String): Array { - return ComponentBuilder(ChatColor.translateAlternateColorCodes('&', "&7[&6系統&7] &f飯娘:&7$message")).create() + return ComponentBuilder(ChatColor.translateAlternateColorCodes('&', "§7|§6系統§7|§f飯娘:§7$message")).create() } fun sendSystemMessage(sender: CommandSender, message: String) {