This commit is contained in:
2024-12-03 17:17:29 +01:00
parent 677eb4137a
commit 19a4d0e93a
8 changed files with 79 additions and 79 deletions
@@ -81,7 +81,7 @@ object TNTLeagueGame {
blueTeam.start()
redTeam.start()
message.broadcast("gameStarted")
message.broadcast("GAME_STARTED")
val tnt = ItemStack(Material.TNT)
@@ -106,7 +106,7 @@ object TNTLeagueGame {
}
if (gameTimeRemaining % 300 == 0) {
message.broadcast("timeRemaining", (gameTimeRemaining / 60))
message.broadcast("TIME_REMAINING", (gameTimeRemaining / 60))
plugin.server.onlinePlayers.forEach { it.playSound(Sound.sound(org.bukkit.Sound.BLOCK_NOTE_BLOCK_PLING.key, Sound.Source.MASTER, 1f, 1f)) }
}
}, 20, 20)
@@ -124,7 +124,7 @@ object TNTLeagueGame {
it.playSound(Sound.sound(org.bukkit.Sound.ENTITY_ENDER_DRAGON_DEATH.key, Sound.Source.MASTER, 1f, 1f))
}
message.broadcast("gameEnded")
message.broadcast("GAME_ENDED")
spawnerTask.cancel()
@@ -135,7 +135,7 @@ object TNTLeagueGame {
plugin.server.shutdown()
}
message.broadcast("shutdown", shutdown)
message.broadcast("SHUTDOWN", shutdown)
shutdown--
}, 20, 20)
@@ -154,7 +154,7 @@ object TNTLeagueGame {
state = GameState.STARTING
var countdown = TNTLeagueConfig.config.startDelay
message.broadcast("gameStarting", countdown.toString())
message.broadcast("GAME_STARTING", countdown.toString())
task = plugin.server.scheduler.scheduleSyncRepeatingTask(plugin, {
plugin.server.onlinePlayers.forEach { it.playSound(Sound.sound(org.bukkit.Sound.ENTITY_EXPERIENCE_ORB_PICKUP.key, Sound.Source.MASTER, 1f, 1f)) }
if (--countdown == 0) {
@@ -195,7 +195,7 @@ object TNTLeagueGame {
fun win(tntLeagueTeam: TNTLeagueTeam, reason: WinReason) {
if (state != GameState.RUNNING) return
end()
plugin.server.onlinePlayers.forEach { message.send("teamWin", it, message.parse(tntLeagueTeam.name, it).colorByTeam(tntLeagueTeam)) }
plugin.server.onlinePlayers.forEach { message.send("TEAM_WIN", it, message.parse(tntLeagueTeam.name, it).colorByTeam(tntLeagueTeam)) }
statistic(tntLeagueTeam, reason)
explode(tntLeagueTeam.opposite)
}
@@ -203,7 +203,7 @@ object TNTLeagueGame {
fun draw(reason: WinReason) {
if (state != GameState.RUNNING) return
end()
message.broadcast("draw")
message.broadcast("DRAW")
statistic(null, reason)
}
@@ -60,7 +60,7 @@ data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private va
leader?.inventory?.setItem(4, readyItem())
leader?.playSound(Sound.sound(org.bukkit.Sound.BLOCK_NOTE_BLOCK_PLING.key, Sound.Source.MASTER, 1f, 1f))
message.broadcastActionbar(if (value) "isReady" else "isNotReady", name.colorByTeam(this))
message.broadcastActionbar(if (value) "IS_READY" else "IS_NOT_READY", name.colorByTeam(this))
if (value && opposite.isReady) {
TNTLeagueGame.checkStart()
@@ -90,7 +90,7 @@ data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private va
teleport(config.spawnLocation)
gameMode = GameMode.ADVENTURE
inventory.clear()
message.broadcast("joinTeam", name.colorByTeam(this@TNTLeagueTeam), this@TNTLeagueTeam.name.colorByTeam(this@TNTLeagueTeam))
message.broadcast("JOIN_TEAM", name.colorByTeam(this@TNTLeagueTeam), this@TNTLeagueTeam.name.colorByTeam(this@TNTLeagueTeam))
}
if (leader == null) {
@@ -103,13 +103,13 @@ data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private va
fun readyItem() = if (isReady) {
ItemStack.of(Material.LIME_DYE).apply {
itemMeta = itemMeta.apply {
displayName(Component.text(message.parse("ready", leader!!)))
displayName(Component.text(message.parse("READY", leader!!)))
}
}
} else {
ItemStack.of(Material.RED_DYE).apply {
itemMeta = itemMeta.apply {
displayName(Component.text(message.parse("notReady", leader!!)))
displayName(Component.text(message.parse("NOT_READY", leader!!)))
}
}
}
@@ -151,7 +151,7 @@ data class TNTLeagueTeam(val config: TNTLeagueWorldConfig.TeamConfig, private va
teleport(TNTLeagueWorldConfig.lobby)
gameMode = GameMode.SPECTATOR
inventory.clear()
message.broadcast("quitTeam", name.colorByTeam(this@TNTLeagueTeam), this@TNTLeagueTeam.name.colorByTeam(this@TNTLeagueTeam))
message.broadcast("QUIT_TEAM", name.colorByTeam(this@TNTLeagueTeam), this@TNTLeagueTeam.name.colorByTeam(this@TNTLeagueTeam))
}
}