From 8cf39be76cbd6449678928c29c9be198af9a9b61 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 1 Aug 2015 03:24:33 +1000 Subject: [PATCH] Fixed plot visit --- .../java/com/intellectualcrafters/plot/commands/Visit.java | 2 +- .../java/com/intellectualcrafters/plot/util/UUIDHandler.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Visit.java b/src/main/java/com/intellectualcrafters/plot/commands/Visit.java index c243f92f1..4bcf7f6a0 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Visit.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Visit.java @@ -58,7 +58,7 @@ public class Visit extends SubCommand { @Override public boolean onCommand(PlotPlayer plr, String[] args) { ArrayList plots = new ArrayList<>(); - UUID user = UUIDHandler.getUUID(args[0], null); + UUID user = UUIDHandler.getCachedUUID(args[0], null); if (user != null ) { // do plots by username plots.addAll(PS.get().getPlots(user)); diff --git a/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java b/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java index 12fa118d7..318b47077 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java +++ b/src/main/java/com/intellectualcrafters/plot/util/UUIDHandler.java @@ -110,6 +110,10 @@ public class UUIDHandler { public static UUID getUUID(final String name, RunnableVal ifFetch) { return implementation.getUUID(name, ifFetch); } + + public static UUID getCachedUUID(final String name, RunnableVal ifFetch) { + return implementation.getUUIDMap().get(new StringWrapper(name)); + } public static Map getPlayers() { return implementation.getPlayers();