Skip to content

Commit

Permalink
Disable timed respawns after the game ends
Browse files Browse the repository at this point in the history
  • Loading branch information
FluxCapacitor2 committed Sep 15, 2024
1 parent bff7e65 commit d4c39d2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit d4c39d2

Please sign in to comment.