Add ranking system and /ranking command

Introduce a ranking system: add Rank enum and RankingManager enhancements (isRankingEnabled toggle, getRank(), RR change handling, rank-up/down detection and player notifications with titles/sounds). Add a new /ranking admin command (toggle, status, rank) with tab completion and register it in plugin startup. Surface player rank on the scoreboard (ScoreboardManager) and add related language entries and plugin.yml permission/command metadata. Logging updated to include ranked state.
This commit is contained in:
TDSTOS
2026-04-03 22:28:56 +02:00
parent ab976cc2a4
commit 7b6557122b
7 changed files with 339 additions and 18 deletions

View File

@@ -24,6 +24,12 @@ ranking:
result_win: '<prefix><gold>🏆 Victory!</gold> <gray>Kills: <aqua><kills></aqua></gray> · <rr>'
result_loss: '<prefix><gray>You placed <aqua><placement></aqua> · Kills: <aqua><kills></aqua></gray> · <rr>'
promote-main: '<gradient:gold:yellow><bold>RANK UP!</bold></gradient>'
promote-sub: '<color><name><reset>'
rank_up: '<prefix><green>⬆ Rank Up!</green> <gray><from> → <to>'
rank_down: '<prefix><red>⬇ Rank Down.</red> <gray><from> → <to>'
title:
fight-main: '<red>The battle has begun!</red>'
fight-sub: '<red>Try not to die!</red>'
@@ -79,6 +85,15 @@ commands:
positiveNumber: '<red>Invalid time format! Use, for example, 10m, 30s, or 600.</red>'
onlyIngame: '<red>Timer can only be set in game.</red>'
set: '<green>The game timer has been set to <time>!</green>'
ranking:
usage: '<red>Usage: /ranking <toggle|status|rank [player]></red>'
enabled: '<prefix><green>✔ Ranked mode is now <bold>ACTIVE</bold>. RR will be awarded next round.</green>'
disabled: '<prefix><yellow>⚠ Unranked mode is now <bold>ACTIVE</bold>. No RR changes next round.</yellow>'
status_enabled: '<prefix><gray>Ranking: <green><bold>ACTIVE</bold></green></gray>'
status_disabled: '<prefix><gray>Ranking: <yellow><bold>DISABLED (Unranked)</bold></yellow></gray>'
rank_usage: '<red>Usage: /ranking rank <player></red>'
player_not_found: '<red>Player <name> is not online.</red>'
rank_info: '<prefix><gray>Player <white><name></white> — <rank> <gray>(<score> RR · <games> games)</gray>'
scoreboard:
title: '<gradient:red:gold><bold>SpeedHG</bold></gradient>'
@@ -86,6 +101,7 @@ scoreboard:
- "<gray><st> "
- "Players: <green><online>/<max>"
- "Kit: <yellow><kit>"
- "Rank: <rank>"
- ""
- "<gray>Waiting for start..."
- ""
@@ -95,6 +111,7 @@ scoreboard:
- "Time: <green><timer>"
- "Players: <red><alive>"
- "Kills: <green><kills>"
- "Rank: <rank>"
- ""
- "Border: <red><border>"
- ""

View File

@@ -13,6 +13,9 @@ permissions:
speedhg.admin.timer:
description: 'Change the current game time'
default: false
speedhg.admin.ranking:
description: 'Manage the ranking system (toggle unranked mode, inspect ranks)'
default: false
commands:
kit:
@@ -24,4 +27,8 @@ commands:
timer:
description: 'Change the current game time (Admin Command)'
usage: '/timer <seconds>'
permission: speedhg.admin.timer
permission: speedhg.admin.timer
ranking:
description: 'Manage the SpeedHG ranking system'
usage: '/ranking <toggle|status|rank [player]>'
permission: speedhg.admin.ranking