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
@@ -17,33 +17,33 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
PREFIX=§4TNT§6League§8»
join=§e{0} §7joined the game!
joinTeam={0} §7joined the {1} §7team!
quit={0} §cleft the game!
quitTeam={0} §7left the {1} §7team!
blue=Blue
red=Red
shutdown=§cThe server stops in §e{0} §cseconds!
teamWin=§aTeam {0} §awins!
notEnoughCoins=§cYou don't have enough coins to buy this item!
gameStarting=§aThe game starts in §e{0} §aseconds!
gameStart=
gameStarted=§aThe game has started!
timeRemaining=§e{0} §7minutes remaining!
gameEnded=§cThe game has ended!
draw=§cThe game ended in a draw!
dealer=Shopkeeper
dealerItem={0} {1}
dealerPrice=
scoreboardTarget=
scoreboardTime=§7Time: §e{0}§8:§e{1}
scoreboardCoins=§7Coins: §e{0}
scoreboardTeam=§7Team {0}§8: §e{1}
ready=§aReady
notReady=§cNot ready
isReady=§aTeam {0} §ais ready!
isNotReady=§cTeam {0} §cis not ready!
invited={0} §ainvited you to join the {1} §ateam! §e*Click*
invitedHover=§7Click to join the {0} §7team!
invitedPlayer=§aInvited §e{0} §ato join your team!
PREFIX=§eTNT§7League§8»
JOIN=§e{0} §7joined the game!
JOIN_TEAM={0} §7joined the {1} §7team!
QUIT={0} §7left the game!
QUIT_TEAM={0} §7left the {1} §7team!
BLUE=blue
RED=red
SHUTDOWN=§7The server stops in §e{0} §cseconds!
TEAM_WIN=§aTeam {0} §awins!
NOT_ENOUGH_COINS=§cYou don't have enough coins to buy this item!
GAME_STARTING=§aThe game starts in §e{0} §aseconds!
GAME_START=
GAME_STARTED=§aThe game has started!
TIME_REMAINING=§e{0} §7minutes remaining!
GAME_ENDED=§cThe game has ended!
DRAW=§cThe game ended in a draw!
DEALER=Shopkeeper
DEALER_ITEM={0} {1}
DEALER_PRICE=
SCOREBOARD_TARGET=
SCOREBOARD_TIME=§7Time§8: §e{0}§8:§e{1}
SCOREBOARD_COINS=§7Coins§8: §e{0}
SCOREBOARD_TEAM=§7Team {0}§8: §e{1}
READY=§aReady
NOT_READY=§cNot ready
IS_READY=§aTeam {0} §ais ready!
IS_NOT_READY=§cTeam {0} §cis not ready!
INVITED={0} §ainvited you to join team {1}§7! §e*Click*
INVITED_HOVER=§7Click to join team {0}§7!
INVITED_PLAYER=§aInvited §e{0} §ato join your team!
@@ -16,29 +16,29 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
join=§e{0} §7ist dem Spiel beigetreten!
joinTeam={0} §7ist dem {1} §7team begetreten!
quit={0} §chat das Spiel verlassen!
quitTeam={0} §7hat Team {1} §7verlassen!
blue=Blau
red=Rot
shutdown=§cDer Server fährt in §e{0} §csekunden herunter!
teamWin=§aTeam {0} §agewinnt!
notEnoughCoins=§cDu hast nicht genug Coins um dir das zu kaufen!
gameStarting=§aDas Spiel beginnt in §e{0} §aSekunden!
gameStarted=§aDas Spiel beginnt!
timeRemaining=§7noch §e{0} §7Minuten!
gameEnded=§cDas Spiel ist vorbei!
draw=§cKeiner hat gewonnen!
dealer=Händler
dealerPrice=§7Kosten: §e{0} Coins
JOIN=§e{0} §7ist dem Spiel beigetreten!
JOIN_TEAM={0} §7ist Team {1} §7begetreten!
QUIT={0} §7hat das Spiel verlassen!
QUIT_TEAM={0} §7hat Team {1} §7verlassen!
BLUE=Blau
RED=Rot
SHUTDOWN=§7Der Server fährt in §e{0} §cSekunden herunter!
TEAM_WIN=§aTeam {0} §agewinnt!
NOT_ENOUGH_COINS=§cDu hast nicht genug Coins um dir das zu kaufen!
GAME_STARTING=§aDas Spiel beginnt in §e{0} §aSekunden!
GAME_STARTED=§aDas Spiel beginnt!
TIME_REMAINING=§7noch §e{0} §7Minuten!
GAME_ENDED=§cDas Spiel ist vorbei!
DRAW=§cKeiner hat gewonnen!
DEALER=Händler
DEALER_PRICE=§7Kosten: §e{0} Coins
scoreboardTarget=§7Ziel: {0}
scoreboardTime=§7Zeit: §e{0}§8:§e{1}
ready=§aBereit
notReady=§cNicht bereit
isReady=§aTeam {0} §aist bereit!
isNotReady=§cTeam {0} §cist nicht bereit!
invited={0} §ahat dich in team {1} §aeingeladen! §e*Klick*
invitedHover=§7Team {0} §7beitreten!
invitedPlayer={0} §awurde eingeladen!
SCOREBOARD_TARGET=§7Ziel§8: {0}
SCOREBOARD_TIME=§7Zeit§8: §e{0}§8:§e{1}
READY=§aBereit
NOT_READY=§cNicht bereit
IS_READY=§aTeam {0} §aist bereit!
IS_NOT_READY=§cTeam {0} §cist nicht bereit!
INVITED={0} §ahat dich in Team {1} §aeingeladen! §e*Klick*
INVITED_HOVER=§7Team {0} §7beitreten!
INVITED_PLAYER={0} §awurde eingeladen!
@@ -38,10 +38,10 @@ object InviteCommand: SWCommand("invite") {
team.invites.add(target)
message
.send("invited", target, message.parse("invitedHover", target, team.name.colorByTeam(team)),
.send("INVITED", target, message.parse("INVITED_HOVER", target, team.name.colorByTeam(team)),
ClickEvent(ClickEvent.Action.RUN_COMMAND, "/accept "), sender.name, team.name.colorByTeam(team), )
message.send("invitedPlayer", sender, target.name)
message.send("INVITED_PLAYER", sender, target.name)
}
@Validator("isLeader", local = false)
@@ -45,7 +45,7 @@ object GlobalListener: Listener {
with(e.player) {
teleport(TNTLeagueWorldConfig.lobby)
inventory.clear()
message.broadcast("join", name)
message.broadcast("JOIN", name)
isOp = false
gameMode = GameMode.SPECTATOR
respawnLocation = TNTLeagueWorldConfig.lobby
@@ -55,7 +55,7 @@ object GlobalListener: Listener {
@EventHandler(priority = EventPriority.HIGHEST)
fun onPlayerQuit(e: PlayerQuitEvent) {
e.quitMessage(null)
message.broadcast("quit", e.player.name.colorByTeam(TNTLeagueGame.getTeam(e.player)))
message.broadcast("QUIT", e.player.name.colorByTeam(TNTLeagueGame.getTeam(e.player)))
TNTLeagueGame.playerLeave(e.player)
}
@@ -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))
}
}
@@ -48,7 +48,7 @@ class DealerInventory(val player: Player): SWInventoryHolder() {
val team = TNTLeagueGame.getTeam(player) ?: return@to
if (team.coins < price) {
message.send("notEnoughCoins", player)
message.send("NOT_ENOUGH_COINS", player)
player.playSound(Sound.sound(org.bukkit.Sound.ENTITY_VILLAGER_HURT.key, net.kyori.adventure.sound.Sound.Source.MASTER, 1f, 1f))
return@to
}
@@ -59,7 +59,7 @@ class DealerInventory(val player: Player): SWInventoryHolder() {
}
}
override fun createInventory(): Inventory = plugin.server.createInventory(this, ceil(TNTLeagueConfig.config.prices.size / 9f).toInt() * 9, Component.text(message.parse("dealer", player)))
override fun createInventory(): Inventory = plugin.server.createInventory(this, ceil(TNTLeagueConfig.config.prices.size / 9f).toInt() * 9, Component.text(message.parse("DEALER", player)))
companion object {
private val priceKey = NamespacedKey(plugin, "price")
@@ -36,23 +36,23 @@ data class TNTLeagueScoreboard(val p: Player): ScoreboardCallback {
val minutes = TNTLeagueGame.gameTimeRemaining.floorDiv(60)
val seconds = TNTLeagueGame.gameTimeRemaining.rem(60).toString().padStart(2, '0')
lines.add(message.parse("scoreboardTime", p, minutes, seconds))
lines.add(message.parse("SCOREBOARD_TIME", p, minutes, seconds))
lines.add("§2")
when (val team = TNTLeagueGame.getTeam(p)) {
is TNTLeagueTeam -> lines.add(message.parse("scoreboardCoins", p, team.coins))
else -> lines.add(message.parse("scoreboardCoins", p,
is TNTLeagueTeam -> lines.add(message.parse("SCOREBOARD_COINS", p, team.coins))
else -> lines.add(message.parse("SCOREBOARD_COINS", p,
"§${TNTLeagueGame.blueTeam.color}${TNTLeagueGame.blueTeam.coins}§8:§${TNTLeagueGame.redTeam.color}${TNTLeagueGame.redTeam.coins}"))
}
lines.add("§3")
with(TNTLeagueGame.redTeam) {
lines.add(message.parse("scoreboardTeam", p, message.parse(name, p).colorByTeam(this), targetedBlocks - damagedBlocks))
lines.add(message.parse("SCOREBOARD_TEAM", p, message.parse(name, p).colorByTeam(this), targetedBlocks - damagedBlocks))
}
with(TNTLeagueGame.blueTeam) {
lines.add(message.parse("scoreboardTeam", p, message.parse(name, p).colorByTeam(this), targetedBlocks - damagedBlocks))
lines.add(message.parse("SCOREBOARD_TEAM", p, message.parse(name, p).colorByTeam(this), targetedBlocks - damagedBlocks))
}
lines.add("§4")
@@ -61,5 +61,5 @@ data class TNTLeagueScoreboard(val p: Player): ScoreboardCallback {
.foldIndexed(HashMap()) { index, acc, component -> acc.also { it[component] = index } }
}
override fun getTitle(): String = message.parse("PREFIX", p)
override fun getTitle(): String = message.parse("PREFIX", p).dropLast(1)
}