Fix plot home

This commit is contained in:
Sauilitired 2018-12-26 01:39:49 +01:00
parent edc758334c
commit f1378013c1
No known key found for this signature in database
GPG key ID: C0207FF7EA146678

View file

@ -94,12 +94,8 @@ import java.util.*;
C.FOUND_NO_PLOTS.send(player);
return;
}
Iterator<Plot> iterator = unsorted.iterator();
while (iterator.hasNext()) {
if (!iterator.next().isBasePlot()) {
iterator.remove();
}
}
unsorted = new ArrayList<>(unsorted);
unsorted.removeIf(plot -> !plot.isBasePlot());
if (page < 1 || page > unsorted.size()) {
C.NOT_VALID_NUMBER.send(player, "(1, " + unsorted.size() + ")");
return;
@ -134,19 +130,13 @@ import java.util.*;
return;
}
}
confirm.run(this, new Runnable() {
@Override public void run() {
confirm.run(this, () -> {
if (plot.teleportPlayer(player)) {
whenDone.run(Visit.this, CommandResult.SUCCESS);
} else {
whenDone.run(Visit.this, CommandResult.FAILURE);
}
}
}, new Runnable() {
@Override public void run() {
whenDone.run(Visit.this, CommandResult.FAILURE);
}
});
}, () -> whenDone.run(Visit.this, CommandResult.FAILURE));
}
}