Fixed return values - false = error

This commit is contained in:
Tastybento 2018-02-06 21:46:59 -08:00
parent 00470b1fc8
commit a9373a3eea

View File

@ -28,11 +28,11 @@ public class IslandSethomeCommand extends CompositeCommand {
// Check island // Check island
if (getPlugin().getIslands().getIsland(user.getUniqueId()) == null) { if (getPlugin().getIslands().getIsland(user.getUniqueId()) == null) {
user.sendMessage("general.errors.no-island"); user.sendMessage("general.errors.no-island");
return true; return false;
} }
if (!getPlugin().getIslands().playerIsOnIsland(user)) { if (!getPlugin().getIslands().playerIsOnIsland(user)) {
user.sendMessage("commands.island.sethome.must-be-on-your-island"); user.sendMessage("commands.island.sethome.must-be-on-your-island");
return true; return false;
} }
if (args.isEmpty()) { if (args.isEmpty()) {
// island sethome // island sethome
@ -48,15 +48,18 @@ public class IslandSethomeCommand extends CompositeCommand {
number = Integer.valueOf(args.get(0)); number = Integer.valueOf(args.get(0));
if (number < 1 || number > maxHomes) { if (number < 1 || number > maxHomes) {
user.sendMessage("commands.island.sethome.num-homes", "[max]", String.valueOf(maxHomes)); user.sendMessage("commands.island.sethome.num-homes", "[max]", String.valueOf(maxHomes));
return false;
} else { } else {
getPlugin().getPlayers().setHomeLocation(playerUUID, user.getLocation(), number); getPlugin().getPlayers().setHomeLocation(playerUUID, user.getLocation(), number);
user.sendMessage("commands.island.sethome.home-set"); user.sendMessage("commands.island.sethome.home-set");
} }
} catch (Exception e) { } catch (Exception e) {
user.sendMessage("commands.island.sethome.num-homes", "[max]", String.valueOf(maxHomes)); user.sendMessage("commands.island.sethome.num-homes", "[max]", String.valueOf(maxHomes));
return false;
} }
} else { } else {
user.sendMessage("general.errors.no-permission"); user.sendMessage("general.errors.no-permission");
return false;
} }
} }
return true; return true;