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>