Make TNTLeague Event System Capable

This commit is contained in:
2025-02-01 21:50:36 +01:00
parent 90666e2d20
commit 3d153d49b5
10 changed files with 182 additions and 79 deletions
@@ -66,7 +66,7 @@ object GlobalListener: Listener {
fun onPlayerMove(e: PlayerMoveEvent) {
if (e.to.blockY < TNTLeagueWorldConfig.minHeight) {
when (val team = TNTLeagueGame.getTeam(e.player)) {
is TNTLeagueTeam -> e.player.teleport(team.config.spawnLocation)
is TNTLeagueTeam -> e.player.teleport(team.config.worldConfig.spawnLocation)
null -> e.player.teleport(TNTLeagueWorldConfig.blueTeam.spawnLocation)
}
}
@@ -87,7 +87,7 @@ object GlobalListener: Listener {
@EventHandler
fun onPlayerRespawn(e: PlayerRespawnEvent) {
when (val team = TNTLeagueGame.getTeam(e.player)) {
is TNTLeagueTeam -> e.respawnLocation = team.config.spawnLocation
is TNTLeagueTeam -> e.respawnLocation = team.config.worldConfig.spawnLocation
null -> e.respawnLocation = TNTLeagueWorldConfig.lobby
}
}
@@ -100,7 +100,7 @@ object GlobalListener: Listener {
val fightTeam = TNTLeagueGame.getTeam(player)
if (fightTeam != null) {
message.broadcastPrefixless("PARTICIPANT_CHAT", SubMessage(fightTeam.name), player.name, msg)
message.broadcastPrefixless("PARTICIPANT_CHAT", fightTeam.name, player.name, msg)
} else {
message.broadcastPrefixless("SPECTATOR_CHAT", player.name, msg)
}