From d4c39d2abf9bbd3e43161d98f57fdc85d5c1ca54 Mon Sep 17 00:00:00 2001 From: FluxCapacitor2 <31071265+FluxCapacitor2@users.noreply.github.com> Date: Sun, 15 Sep 2024 16:54:18 -0400 Subject: [PATCH] Disable timed respawns after the game ends --- .../server/module/minigame/TimedRespawnModule.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/kotlin/com/bluedragonmc/server/module/minigame/TimedRespawnModule.kt b/common/src/main/kotlin/com/bluedragonmc/server/module/minigame/TimedRespawnModule.kt index f9a52980..2760a30d 100644 --- a/common/src/main/kotlin/com/bluedragonmc/server/module/minigame/TimedRespawnModule.kt +++ b/common/src/main/kotlin/com/bluedragonmc/server/module/minigame/TimedRespawnModule.kt @@ -3,6 +3,7 @@ package com.bluedragonmc.server.module.minigame import com.bluedragonmc.server.Game import com.bluedragonmc.server.event.GameEvent import com.bluedragonmc.server.module.GameModule +import com.bluedragonmc.server.utils.manage import net.kyori.adventure.text.Component import net.kyori.adventure.text.format.NamedTextColor import net.kyori.adventure.title.Title @@ -34,8 +35,8 @@ class TimedRespawnModule(private val seconds: Int = 5) : GameModule() { if (mode != null) event.player.gameMode = mode } event.player.teleport(event.player.respawnPoint) - }.delay(Duration.ofSeconds(seconds.toLong())).schedule() - }.delay(Duration.ofMillis(20)).schedule() + }.delay(Duration.ofSeconds(seconds.toLong())).schedule().manage(parent) + }.delay(Duration.ofMillis(20)).schedule().manage(parent) } }