- Also add new caption if attempting to clear an empty alias
This commit is contained in:
NotMyFault 2021-05-27 17:06:04 +02:00
parent b1fc17e045
commit dc7e6010cb
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 14 additions and 6 deletions

View File

@ -179,11 +179,18 @@ public class Alias extends SubCommand {
} }
private boolean removeAlias(PlotPlayer<?> player, Plot plot) { private boolean removeAlias(PlotPlayer<?> player, Plot plot) {
plot.setAlias(null); String alias = plot.getAlias();
if (!plot.getAlias().isEmpty()) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("permission.no_permission"), TranslatableCaption.of("alias.alias_removed"),
Template.of("node", String.valueOf(Permission.PERMISSION_ALIAS_REMOVE)) Template.of("alias", alias)
); );
} else {
player.sendMessage(
TranslatableCaption.of("alias.no_alias_set")
);
}
plot.setAlias(null);
return true; return true;
} }

View File

@ -182,10 +182,11 @@
"reload.reload_failed": "<prefix><red>Failed to reload file configurations.</red>", "reload.reload_failed": "<prefix><red>Failed to reload file configurations.</red>",
"desc.desc_set": "<prefix><gray>Plot description set.</gray>", "desc.desc_set": "<prefix><gray>Plot description set.</gray>",
"desc.desc_unset": "<prefix><gray>Plot description unset.</gray>", "desc.desc_unset": "<prefix><gray>Plot description unset.</gray>",
"alias.alias_set_to": "<prefix><gray>Plot alias set to </gray><gold><alias></gold><gray>.</gray>", "alias.alias_set_to": "<prefix><dark_aqua>Plot alias set to </dark_aqua><gold><alias></gold><dark_aqua>.</dark_aqua>",
"alias.alias_removed": "<prefix><gray>Plot alias removed.</gray>", "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_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 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_set": "<prefix><gold>Home position set to your current location.</gold>",
"position.position_unset": "<prefix><gold>Home position reset to the default location.</gold>", "position.position_unset": "<prefix><gold>Home position reset to the default location.</gold>",
"permission.no_schematic_permission": "<prefix><red>You don't have the permission required to use schematic </red><gold><value></gold><red>.</red>", "permission.no_schematic_permission": "<prefix><red>You don't have the permission required to use schematic </red><gold><value></gold><red>.</red>",