Revert "Update Message"

This reverts commit ac9197c554.
This commit is contained in:
2024-11-14 22:18:34 +01:00
parent 26f15304a2
commit 9dff1f5884
13 changed files with 107 additions and 105 deletions
@@ -11,18 +11,19 @@ import de.steamwar.tntleague.events.DummyListener
import de.steamwar.tntleague.events.IngameListener
import de.steamwar.tntleague.events.LobbyListener
import de.steamwar.tntleague.inventory.DealerInventory
import de.steamwar.tntleague.message
import de.steamwar.tntleague.plugin
import de.steamwar.tntleague.util.*
import net.kyori.adventure.bossbar.BossBar
import net.kyori.adventure.sound.Sound
import net.kyori.adventure.text.Component
import org.bukkit.GameMode
import org.bukkit.Location
import org.bukkit.Material
import org.bukkit.block.data.type.TNT
import org.bukkit.entity.Entity
import org.bukkit.entity.Item
import org.bukkit.entity.Player
import org.bukkit.entity.TNTPrimed
import org.bukkit.entity.Villager
import org.bukkit.event.HandlerList
import org.bukkit.event.Listener
import org.bukkit.inventory.ItemStack
@@ -61,7 +62,7 @@ object TNTLeagueGame {
blueTeam.start()
redTeam.start()
message.broadcast("gameStarted")
plugin.server.broadcast(translate("gameStarted").success())
val tnt = ItemStack(Material.TNT)
@@ -86,7 +87,7 @@ object TNTLeagueGame {
}
if (gameTimeRemaining % 300 == 0) {
message.broadcast("timeRemaining", gameTimeRemaining / 60)
plugin.server.broadcast(translate("timeRemaining", (gameTimeRemaining / 60).toString().yellow()).basic())
plugin.server.onlinePlayers.forEach { it.playSound(Sound.sound(org.bukkit.Sound.BLOCK_NOTE_BLOCK_PLING.key, Sound.Source.MASTER, 1f, 1f)) }
}
}, 20, 20)
@@ -104,7 +105,7 @@ object TNTLeagueGame {
it.playSound(Sound.sound(org.bukkit.Sound.ENTITY_ENDER_DRAGON_DEATH.key, Sound.Source.MASTER, 1f, 1f))
}
message.broadcast("gameEnded")
plugin.server.broadcast(translate("gameEnded").success())
spawnerTask.cancel()
@@ -115,7 +116,7 @@ object TNTLeagueGame {
plugin.server.shutdown()
}
message.broadcast("shutdown", shutdown)
plugin.server.broadcast(translate("shutdown", shutdown.toString().yellow()).basic())
shutdown--
}, 20, 20)
@@ -134,8 +135,8 @@ object TNTLeagueGame {
state = GameState.STARTING
var countdown = TNTLeagueConfig.config.startDelay
message.broadcast("gameStarting", countdown)
val bar = BossBar.bossBar(Component.text(message.parse("gameStart", countdown)), (TNTLeagueConfig.config.startDelay - countdown) / TNTLeagueConfig.config.startDelay.toFloat(), BossBar.Color.GREEN, BossBar.Overlay.NOTCHED_10)
plugin.server.broadcast(translate("gameStarting", countdown.toString().yellow()).basic())
val bar = BossBar.bossBar(translate("gameStart", countdown.toString().yellow()).gray(), (TNTLeagueConfig.config.startDelay - countdown) / TNTLeagueConfig.config.startDelay.toFloat(), BossBar.Color.GREEN, BossBar.Overlay.NOTCHED_10)
plugin.server.onlinePlayers.forEach { bar.addViewer(it) }
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)) }