From 3476522c005b7c7e5d5dd39eb2bc5e7050cce20b Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Tue, 7 Jul 2020 15:03:26 +0200 Subject: [PATCH] Allow /p v --- .../main/java/com/plotsquared/core/command/Visit.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Visit.java b/Core/src/main/java/com/plotsquared/core/command/Visit.java index b984d7c58..9d803f6e3 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Visit.java +++ b/Core/src/main/java/com/plotsquared/core/command/Visit.java @@ -189,10 +189,10 @@ public class Visit extends Command { // /p v [page] // /p v [page] // /p v [page] + // /p v case 1: final String[] finalArgs = args; int finalPage = page; - if (args[0].length() >= 2 && !args[0].contains(";") && !args[0].contains(",")) { PlotSquared.get().getImpromptuUUIDPipeline().getSingle(args[0], (uuid, throwable) -> { if (throwable instanceof TimeoutException) { @@ -202,8 +202,12 @@ public class Visit extends Command { // It was a valid UUID but the player has no plots MainUtil.sendMessage(player, Captions.PLAYER_NO_PLOTS); } else if (uuid == null) { - // player not found - MainUtil.sendMessage(player, Captions.INVALID_PLAYER, finalArgs[0]); + // player not found, so we assume it's an alias if no page was provided + 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 { this.visit(player, PlotQuery.newQuery().ownedBy(uuid).whereBasePlot(), null, confirm, whenDone, finalPage); }