Fixed bug with island command and island go

This commit is contained in:
tastybento 2018-05-26 15:35:02 -07:00
parent 007a9af025
commit 4bf0d8ec0f
2 changed files with 3 additions and 2 deletions

View File

@ -67,7 +67,8 @@ public class IslandCommand extends CompositeCommand {
} }
if (args.isEmpty()) { if (args.isEmpty()) {
// If in world, go // If in world, go
if (getPlugin().getIslands().hasIsland(getWorld(), user.getUniqueId())) {
if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) {
return getSubCommand("go").map(goCmd -> goCmd.execute(user, new ArrayList<>())).orElse(false); return getSubCommand("go").map(goCmd -> goCmd.execute(user, new ArrayList<>())).orElse(false);
} }
// No islands currently // No islands currently

View File

@ -38,7 +38,7 @@ public class IslandGoCommand extends CompositeCommand {
@Override @Override
public boolean execute(User user, List<String> args) { public boolean execute(User user, List<String> args) {
if (!getIslands().hasIsland(getWorld(), user.getUniqueId())) { if (getIslands().getIsland(getWorld(), user.getUniqueId()) == null) {
user.sendMessage(ChatColor.RED + "general.errors.no-island"); user.sendMessage(ChatColor.RED + "general.errors.no-island");
return false; return false;
} }