forked from SteamWar/SteamWar
Fixes, changes and Refactors
This commit is contained in:
@@ -19,10 +19,11 @@
|
||||
|
||||
package de.steamwar.tntleague.game
|
||||
|
||||
import de.steamwar.kotlin.message.*
|
||||
import de.steamwar.tntleague.colorByTeam
|
||||
import de.steamwar.tntleague.config.TNTLeagueWorldConfig
|
||||
import de.steamwar.tntleague.config.targetedBlocks
|
||||
import de.steamwar.tntleague.plugin
|
||||
import de.steamwar.tntleague.util.*
|
||||
import net.kyori.adventure.sound.Sound
|
||||
import net.kyori.adventure.text.format.NamedTextColor
|
||||
import net.kyori.adventure.text.format.TextColor
|
||||
@@ -31,7 +32,6 @@ import org.bukkit.Material
|
||||
import org.bukkit.enchantments.Enchantment
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import java.awt.Color.green
|
||||
|
||||
data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private val team: Team) {
|
||||
|
||||
@@ -134,9 +134,7 @@ data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private va
|
||||
}
|
||||
|
||||
fun leave(player: Player) {
|
||||
if (TNTLeagueGame.state == TNTLeagueGame.GameState.RUNNING) {
|
||||
TNTLeagueGame.playerLeave(player)
|
||||
} else {
|
||||
if (TNTLeagueGame.state != TNTLeagueGame.GameState.RUNNING) {
|
||||
members.remove(player)
|
||||
|
||||
if (members.isEmpty()) {
|
||||
@@ -146,6 +144,10 @@ data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private va
|
||||
}
|
||||
if (leader == player) {
|
||||
leader = members.firstOrNull()
|
||||
|
||||
if (leader == null && TNTLeagueGame.state == TNTLeagueGame.GameState.LOBBY) {
|
||||
isReady = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user