Fixed execute return values.

This commit is contained in:
Tastybento 2018-02-06 21:48:59 -08:00
parent a9373a3eea
commit af5c7e472e

View File

@ -42,17 +42,17 @@ public class IslandSetnameCommand extends CompositeCommand {
if (!getIslands().hasIsland(playerUUID)) { if (!getIslands().hasIsland(playerUUID)) {
user.sendMessage("general.errors.no-island"); user.sendMessage("general.errors.no-island");
return true; return false;
} }
if (!getIslands().isOwner(playerUUID)) { if (!getIslands().isOwner(playerUUID)) {
user.sendMessage("general.errors.not-leader"); user.sendMessage("general.errors.not-leader");
return true; return false;
} }
// Explain command // Explain command
if (args.isEmpty()) { if (args.isEmpty()) {
user.sendMessage(getUsage()); this.getSubCommand("help").ifPresent(help -> help.execute(user, args));
return true; return false;
} }
// Naming the island - join all the arguments with spaces. // Naming the island - join all the arguments with spaces.
@ -61,11 +61,11 @@ public class IslandSetnameCommand extends CompositeCommand {
// Check if the name isn't too short or too long // Check if the name isn't too short or too long
if (name.length() < getSettings().getNameMinLength()) { if (name.length() < getSettings().getNameMinLength()) {
user.sendMessage("commands.island.setname.too-short", "[length]", String.valueOf(getSettings().getNameMinLength())); user.sendMessage("commands.island.setname.too-short", "[length]", String.valueOf(getSettings().getNameMinLength()));
return true; return false;
} }
if (name.length() > getSettings().getNameMaxLength()) { if (name.length() > getSettings().getNameMaxLength()) {
user.sendMessage("commands.island.setname.too-long", "[length]", String.valueOf(getSettings().getNameMaxLength())); user.sendMessage("commands.island.setname.too-long", "[length]", String.valueOf(getSettings().getNameMaxLength()));
return true; return false;
} }
// Set the name // Set the name