Added specific success messages for Island(Re)SetnameCommand

Implements https://github.com/BentoBoxWorld/BentoBox/issues/1164
This commit is contained in:
Florian CUNY 2020-02-01 17:03:52 +01:00
parent 8630c326a5
commit 6c5df58e2c
3 changed files with 6 additions and 4 deletions

View File

@ -39,7 +39,7 @@ public class IslandResetnameCommand extends CompositeCommand {
// Resets the island name
getIslands().getIsland(getWorld(), playerUUID).setName(null);
user.sendMessage("general.success");
user.sendMessage("commands.island.resetname.success");
return true;
}

View File

@ -50,8 +50,8 @@ public class IslandSetnameCommand extends CompositeCommand {
String name = String.join(" ", args);
// Check if the name isn't too short or too long
if (name.length() < getSettings().getNameMinLength()) {
user.sendMessage("commands.island.setname.name-too-short", TextVariables.NUMBER, String.valueOf(getSettings().getNameMinLength()));
if (name.length() < getSettings().getNameMinLength() || ChatColor.stripColor(name).isEmpty()) {
user.sendMessage("commands.island.setname.name-too-short", TextVariables.NUMBER, String.valueOf(getSettings().getNameMinLength()));
return false;
}
if (name.length() > getSettings().getNameMaxLength()) {
@ -72,7 +72,7 @@ public class IslandSetnameCommand extends CompositeCommand {
// Everything's good!
getIslands().getIsland(getWorld(), playerUUID).setName(name);
user.sendMessage("general.success");
user.sendMessage("commands.island.setname.success", TextVariables.NAME, name);
return true;
}
}

View File

@ -497,8 +497,10 @@ commands:
name-too-long: "&c Too long. Maximum size is [number] characters."
name-already-exists: "&c There is already an island with that name in this gamemode."
parameters: "<name>"
success: "&a Successfully set your island's name to &b [name]&a ."
resetname:
description: "reset your island name"
success: "&a Successfully reset your island name."
team:
description: "manage your team"
info: