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