diff --git a/src/main/kotlin/xyz/fortern/minehunt/Minehunt.kt b/src/main/kotlin/xyz/fortern/minehunt/Minehunt.kt index a2f57fc..aefb94c 100644 --- a/src/main/kotlin/xyz/fortern/minehunt/Minehunt.kt +++ b/src/main/kotlin/xyz/fortern/minehunt/Minehunt.kt @@ -23,10 +23,10 @@ class Minehunt : JavaPlugin() { instance = this val console = Console() - // 注册命令 + // 注册事件 Bukkit.getPluginManager().registerEvents(PlayerListener(console), this) - // 注册事件 + // 注册命令 Bukkit.getPluginCommand("test")!!.setExecutor(TestCommand()) Bukkit.getPluginCommand("minehunt")!!.setExecutor(MinehuntCommand(console)) diff --git a/src/main/kotlin/xyz/fortern/minehunt/command/MinehuntCommand.kt b/src/main/kotlin/xyz/fortern/minehunt/command/MinehuntCommand.kt index 5fbee43..e91f821 100644 --- a/src/main/kotlin/xyz/fortern/minehunt/command/MinehuntCommand.kt +++ b/src/main/kotlin/xyz/fortern/minehunt/command/MinehuntCommand.kt @@ -283,7 +283,7 @@ class MinehuntCommand( */ private fun onStart(sender: CommandSender, flag: Boolean): List? { if (flag) { - if (console.stage == Console.GameStage.PREPARING) { + if (console.stage == Console.GameStage.PREPARING && console.beginningCountdown == null) { val result = console.tryStart() if (result.isNotEmpty()) { sender.sendMessage(Component.text("游戏开始失败,原因:${result}", NamedTextColor.RED))