mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Allow /p v <alias>
This commit is contained in:
parent
3d087b1bbe
commit
3476522c00
@ -189,10 +189,10 @@ public class Visit extends Command {
|
|||||||
// /p v <name> [page]
|
// /p v <name> [page]
|
||||||
// /p v <uuid> [page]
|
// /p v <uuid> [page]
|
||||||
// /p v <plot> [page]
|
// /p v <plot> [page]
|
||||||
|
// /p v <alias>
|
||||||
case 1:
|
case 1:
|
||||||
final String[] finalArgs = args;
|
final String[] finalArgs = args;
|
||||||
int finalPage = page;
|
int finalPage = page;
|
||||||
|
|
||||||
if (args[0].length() >= 2 && !args[0].contains(";") && !args[0].contains(",")) {
|
if (args[0].length() >= 2 && !args[0].contains(";") && !args[0].contains(",")) {
|
||||||
PlotSquared.get().getImpromptuUUIDPipeline().getSingle(args[0], (uuid, throwable) -> {
|
PlotSquared.get().getImpromptuUUIDPipeline().getSingle(args[0], (uuid, throwable) -> {
|
||||||
if (throwable instanceof TimeoutException) {
|
if (throwable instanceof TimeoutException) {
|
||||||
@ -202,8 +202,12 @@ public class Visit extends Command {
|
|||||||
// It was a valid UUID but the player has no plots
|
// It was a valid UUID but the player has no plots
|
||||||
MainUtil.sendMessage(player, Captions.PLAYER_NO_PLOTS);
|
MainUtil.sendMessage(player, Captions.PLAYER_NO_PLOTS);
|
||||||
} else if (uuid == null) {
|
} else if (uuid == null) {
|
||||||
// player not found
|
// player not found, so we assume it's an alias if no page was provided
|
||||||
MainUtil.sendMessage(player, Captions.INVALID_PLAYER, finalArgs[0]);
|
if (finalPage == Integer.MIN_VALUE) {
|
||||||
|
this.visit(player, PlotQuery.newQuery().withAlias(finalArgs[0]), player.getApplicablePlotArea(), confirm, whenDone, 1);
|
||||||
|
} else {
|
||||||
|
MainUtil.sendMessage(player, Captions.INVALID_PLAYER, finalArgs[0]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.visit(player, PlotQuery.newQuery().ownedBy(uuid).whereBasePlot(), null, confirm, whenDone, finalPage);
|
this.visit(player, PlotQuery.newQuery().ownedBy(uuid).whereBasePlot(), null, confirm, whenDone, finalPage);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user