Enhance alias message with placeholders

This commit is contained in:
NotMyFault 2021-05-28 11:37:13 +02:00
parent c146d6207d
commit c509882a18
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
3 changed files with 13 additions and 4 deletions

View File

@ -154,7 +154,10 @@ public class Alias extends SubCommand {
if (PlotQuery.newQuery().inArea(plot.getArea())
.withAlias(alias)
.anyMatch()) {
player.sendMessage(TranslatableCaption.of("alias.alias_is_taken"));
player.sendMessage(
TranslatableCaption.of("alias.alias_is_taken"),
Template.of("alias", alias)
);
return;
}
if (Settings.UUID.OFFLINE) {
@ -166,7 +169,10 @@ public class Alias extends SubCommand {
if (throwable instanceof TimeoutException) {
player.sendMessage(TranslatableCaption.of("players.fetching_players_timeout"));
} else if (uuid != null) {
player.sendMessage(TranslatableCaption.of("alias.alias_is_taken"));
player.sendMessage(
TranslatableCaption.of("alias.alias_is_taken"),
Template.of("alias", alias)
);
} else {
plot.setAlias(alias);
player.sendMessage(

View File

@ -170,7 +170,10 @@ public class Cluster extends SubCommand {
// check if name is taken
String name = args[1];
if (area.getCluster(name) != null) {
player.sendMessage(TranslatableCaption.of("alias.alias_is_taken"));
player.sendMessage(
TranslatableCaption.of("alias.alias_is_taken"),
Template.of("alias", name)
);
return false;
}
if (pos2.getX() < pos1.getX() || pos2.getY() < pos1.getY()) {

View File

@ -185,7 +185,7 @@
"alias.alias_set_to": "<prefix><dark_aqua>Plot alias set to </dark_aqua><gold><alias></gold><dark_aqua>.</dark_aqua>",
"alias.alias_removed": "<prefix><dark_aqua>Plot alias </dark_aqua><gold><alias></gold><dark_aqua> removed.</dark_aqua>",
"alias.alias_too_long": "<prefix><red>The alias must have less than 50 characters in length.</red>",
"alias.alias_is_taken": "<prefix><red>That alias is already taken.</red>",
"alias.alias_is_taken": "<prefix><red>That alias </red><gold><alias></gold><red> is already taken.</red>",
"alias.no_alias_set": "<prefix><red>No plot alias set.</red>",
"position.position_set": "<prefix><gold>Home position set to your current location.</gold>",
"position.position_unset": "<prefix><gold>Home position reset to the default location.</gold>",