diff --git a/src/main/java/world/bentobox/bentobox/api/commands/island/IslandResetnameCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/island/IslandResetnameCommand.java index 2a8a81790..cbbff285e 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/island/IslandResetnameCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/island/IslandResetnameCommand.java @@ -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; } diff --git a/src/main/java/world/bentobox/bentobox/api/commands/island/IslandSetnameCommand.java b/src/main/java/world/bentobox/bentobox/api/commands/island/IslandSetnameCommand.java index 34b42653e..eb222b21b 100644 --- a/src/main/java/world/bentobox/bentobox/api/commands/island/IslandSetnameCommand.java +++ b/src/main/java/world/bentobox/bentobox/api/commands/island/IslandSetnameCommand.java @@ -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; } } diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 0e08683aa..c3ba7bcec 100644 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -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: "" + 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: