Add language entries; include prefix placeholders

Include the default prefix as a placeholder when deserializing messages (LanguageManager). Pass the invincibility time placeholder in GameManager broadcasts. Unify GoblinKit action bar messages to a single "ability_charged" language key. ScoreboardManager now imports legacySerializer and serializes the selected kit display name for the scoreboard. Large update to en_US.yml: added many game/timer/title/antirunner/build/craft/commands translations, updated player welcome and scoreboard title coloring, and added kits.goblin names, lore, items and messages.
This commit is contained in:
TDSTOS
2026-03-25 03:09:17 +01:00
parent 72c461ab28
commit cc265a1dea
5 changed files with 72 additions and 11 deletions

View File

@@ -104,8 +104,10 @@ class LanguageManager(
placeholders: Map<String, String>
): Component
{
val prefixRaw = getRawMessage( player, "default.prefix" )
val prefixTag = Placeholder.parsed( "prefix", prefixRaw )
val raw = getRawMessage( player, key )
val tags = placeholders.map { (k, v) -> Placeholder.parsed( k, v ) }
val tags = placeholders.map { (k, v) -> Placeholder.parsed( k, v ) }.plus( prefixTag )
return miniMessage.deserialize( raw, *tags.toTypedArray() )
}

View File

@@ -178,7 +178,7 @@ class GameManager(
}
Bukkit.getOnlinePlayers().forEach { player ->
player.sendMsg( "game.invincibility-start" )
player.sendMsg( "game.invincibility-start", "time" to invincibilityTime.toString() )
}
}

View File

@@ -149,7 +149,7 @@ class GoblinKit : Kit() {
player: Player
) {
player.playSound( player.location, Sound.BLOCK_ANVIL_USE, 0.8f, 1.5f )
player.sendActionBar(player.trans( "kits.goblin.messages.steal_kit_charged" ))
player.sendActionBar(player.trans( "kits.goblin.messages.ability_charged" ))
}
}
@@ -203,7 +203,7 @@ class GoblinKit : Kit() {
player: Player
) {
player.playSound( player.location, Sound.BLOCK_ANVIL_USE, 0.8f, 1.5f )
player.sendActionBar(player.trans( "kits.goblin.messages.bunker_charged" ))
player.sendActionBar(player.trans( "kits.goblin.messages.ability_charged" ))
}
}

View File

@@ -2,6 +2,7 @@ package club.mcscrims.speedhg.scoreboard
import club.mcscrims.speedhg.SpeedHG
import club.mcscrims.speedhg.game.GameState
import club.mcscrims.speedhg.util.legacySerializer
import club.mcscrims.speedhg.util.trans
import club.mcscrims.speedhg.util.transList
import fr.mrmicky.fastboard.adventure.FastBoard
@@ -50,9 +51,7 @@ class ScoreboardManager(
{
boards.forEach { (key, value) ->
val player = Bukkit.getPlayer( key )
if ( player != null )
updateBoard( player, value )
if ( player != null ) updateBoard( player, value )
}
}
@@ -67,7 +66,7 @@ class ScoreboardManager(
val online = Bukkit.getOnlinePlayers().size.toString()
val max = Bukkit.getMaxPlayers().toString()
val kitName = "None" // TODO
val kitName = legacySerializer.serialize(plugin.kitManager.getSelectedKit( player )?.displayName ?: Component.text( "None" ))
val lines: List<Component>

View File

@@ -9,12 +9,48 @@ default:
game:
join: '<prefix><green><name></green> <gray>has joined the game.</gray>'
quit: '<prefix><red><name></red> <gray>has quit the game.</gray>'
start-aborted: '<prefix><red>The game start has been aborted due to the lack of players!</red>'
started: '<prefix><green>The game has started! Good Luck!</green>'
invincibility-start: '<prefix><yellow>Invincibility has started and ends in <time> second(s)!</yellow>'
fighting-started: '<prefix><red>The battle has begun! Try not to die!</red>'
death-killed: '<prefix><yellow><player> has died whilst fighting <killer>! There are <left> players left.</yellow>'
death-pve: '<prefix><yellow><player> has died! There are <left> players left.</yellow>'
win-chat: '<prefix><green><winner> has won the game! Thanks for playing!</green>'
title:
fight-main: '<red>The battle has begun!</red>'
fight-sub: '<red>Try not to die!</red>'
win-main: '<gold><winner> has won the game!</gold>'
win-sub: '<gray>Thanks for playing!</gray>'
timer:
lobby: '<prefix><green>The game starts in <time> second(s)</green>'
actionbar-invincibility: '<yellow>Invincibility ends in <time> second(s)!</yellow>'
antirunner:
warning: '<red>Fight and you will not be punished!</red>'
punish: '<prefix><red>You have been punished due to not fighting your enemy!</red>'
player:
welcome: 'Welcome to <gradient:red:gold>SpeedHG</gradient>!'
welcome: '<red>Welcome to</red> <gradient:red:gold>SpeedHG</gradient><gold>!</gold>'
build:
no_diamonds: '<prefix><red>Diamonds are not allowed in SpeedHG!</red>'
no_iron_before_feast: '<prefix><red>Iron is not allowed before the Feast has started!</red>'
craft:
no_shift_click: '<prefix><red>Shift-click is not allowed while crafting!</red>'
no_shield: '<prefix><red>Shields are not allowed in SpeedHG!</red>'
iron_nerf: '<prefix><red>Your item has been nerfed as it contains iron!</red>'
commands:
kit:
usage: '<red>Usage: /kit <kitName></red>'
kitNotFound: '<red><kit> is not a registered kit!</red>'
selected: '<green>You have selected <kit> as your Kit!</green>'
scoreboard:
title: '<gradient:gold:yellow><bold>SpeedHG</bold></gradient>'
title: '<gradient:red:gold><bold>SpeedHG</bold></gradient>'
lobby:
- "<gray><st> "
- "Spieler: <green><online>/<max>"
@@ -31,4 +67,28 @@ scoreboard:
- ""
- "Border: <red><border>"
- ""
- "<yellow>play.mcscrims.club"
- "<yellow>play.mcscrims.club"
kits:
goblin:
name: '<gradient:dark_green:gray><bold>Goblin</bold></gradient>'
lore:
- ' '
- 'Use your abilities to either copy'
- 'your enemies kit or hide in a bunker'
- ' '
- 'PlayStyle: §e%playstyle%'
- ' '
- 'Left-click to select'
- 'Right-click to change playstyle'
items:
steal:
name: '§cSteal Kit'
description: 'Steal the kit of your opponent for 60 seconds'
bunker:
name: '§2Bunker'
description: 'Create a bunker around yourself for 15 seconds'
messages:
stole_kit: '<green>You have stolen the kit of your opponent (Kit: <kit>)!</green>'
spawn_bunker: '<green>You have created a bunker around yourself!'
ability_charged: '<aqua>Your ability has been recharged!</aqua>'