This update is for Spigot/Minecraft 1.16.5 - 1.17.1, and has been compiled with Java 16 and Spigot API 1.17.1.
1) add bungee option to load all available arenas on the server and randomly select one of these at the end of game (without restarting the server)
Code (YAML):
bungeecord:
randomarena
: true
2) add support for group meta to hold a colour code
If you want your players names to be colour coded in chat according to the group or rank they belong to, then this can be done by first enabling the option in config:
Code (YAML):
UseRankInChat:
enabled
: true
usegroup
: true
groupcolormeta
: true
The colour code then needs to be added to the group meta. The actual method to do this will vary depending on your permissions plugin, but essentially you need to set a key/value pair for the group, where the key is "
tntrun-color" and the value is the colour code.
For example, the steps for LuckPerms to set a colour for groups 'admin', 'mod' and 'vip' would be:
Code (YAML):
/lp group admin meta set tntrun-color &b
/lp group mod meta set tntrun-color &e
/lp group vip meta set tntrun-color <
#ff11aa>
3) add {COLOR} placeholder to some message strings. This will use the group colour meta above.
Code (YAML):
playerjoinedtoothers
: '&c
{RANK
}&6
{COLOR
}
{PLAYER
} &7joined the arena
(&6
{PS
}&7/&6
{MPS
}&7
)'
playerjoininvite
: '&c
{RANK
}&6
{COLOR
}
{PLAYER
} &7has joined TNTRun arena &6
{ARENA
}&7, click to play'
playerlefttoothers
: '&c
{RANK
}&6
{COLOR
}
{PLAYER
} &7left the game
(&6
{PS
}&7/&6
{MPS
}&7
)'
playerlosttoothers
: '&c
{RANK
}&6
{COLOR
}
{PLAYER
} &7lost the game
(&6
{PS
}&7/&6
{MPS
}&7
)'
playerfirstplace
: '&a1st place
:
&f{RANK}{COLOR}{PLAYER}'
playersecondplace
: '&a2nd place
:
&f{RANK}{COLOR}{PLAYER}'
playerthirdplace
: '&a3rd place
:
&f{RANK}{COLOR}{PLAYER}'
leaderboard
: '
{POSITION
}
) &c
{RANK
}&b
{COLOR
}
{PLAYER
} &f
: Wins &3
{WINS
}'
If not used or not set, the {RANK} and {COLOR} placeholders will simply be replaced with an empty string, or can even removed from the message strings if desired.
Note:
a) If enabled in config, the {RANK} and {COLOR} are cached when the player first joins any arena.
b) For offline players (e.g. in placeholders or leader boards) the caching has to be done async as it could involve a web lookup to get the offline player which could in turn lag your server.
4) square brackets [] were originally added to the {RANK} placeholder in code but have been removed. {RANK} now returns the players rank/primary group exactly as it is set.
This gives server owner more options when editing the messages strings. To add the brackets back in, just change the relevant message strings enclosing the {RANK} placeholder with the brackets, e.g.
Code (YAML):
`&c
[
{RANK
}
]&6
...` or to add grey brackets `&8
[&c
{RANK
}&8
]&6
...`
5) remove leading spaces from podium messages. They will now be left-justified by default. If more central is preferred, the extra spacing can be added into the messages file, e.g.
Code (Text):
playerfirstplace: ' &a1st place: &f{RANK}{COLOR}{PLAYER}'
6) the {PLAYER} placeholder has been added to the podium (1st, 2nd, 3rd) message strings instead of adding the player name in code. This change should be automatic and not require manually updating.
7) make using player's level (exp) bar to display countdown/time-left configurable
Code (YAML):
special:
UseExpBar
: true
8) some small MySQL changes:
- allow special characters ('+', '-', '!', etc.) to be used in the MySQL password string
- use Bukkit logger for MySQL exceptions
- add 'mysql' as a valid database option (equivalent to using 'sql' but more intuitive)
9) some bug fixes and improvements - see change log
Change Log
==========
- add bungee option to load all arenas and randomly select one at end of game (without restarting)
- make leaderboard command more efficient by using already cached data
- fix tab-complete npe when unlinking kit
- add {PS} and {MPS} placeholders to playerlosttoothers string
- use getFormattedMessage method consistently in Playerhandler class
- refactor code around leaderboards and getting offline player ranks
- add support for group meta to hold a colour code
- add {COLOR} placeholder to message strings
- no longer add square brackets [] around the {RANK} placeholder
- remove leading spaces from podium messages
- add {PLAYER} to podium messages
- make using setlevel (exp bar) to display countdown/time-left configurable
- add command to reset/remove player's rank from cache
- refresh rank cache if player joins arena with different rank
- check stats enabled before attempting to clear cached stats
- use logger for mysql exceptions
- allow special chars in mysql password string
- fix bug with placeholder evaluation in 2nd and 3rd place messages
- evaluate internal placeholders for playerlosttoplayer message string
- update all translated/part-translated messages files with new placeholder strings
Please report any issues found either in the discussion pages, on GitHub or Discord -
https://discord.gg/wFYSAS4