This commit is contained in:
2025-03-26 00:44:31 +08:00
parent 27b5e65dee
commit b02e509e1c
2 changed files with 3 additions and 3 deletions

View File

@@ -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))

View File

@@ -283,7 +283,7 @@ class MinehuntCommand(
*/
private fun onStart(sender: CommandSender, flag: Boolean): List<String>? {
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))