Fixed plot visit

This commit is contained in:
boy0001 2015-08-01 03:24:33 +10:00
parent 248ffd9d6e
commit 8cf39be76c
2 changed files with 5 additions and 1 deletions

View File

@ -58,7 +58,7 @@ public class Visit extends SubCommand {
@Override @Override
public boolean onCommand(PlotPlayer plr, String[] args) { public boolean onCommand(PlotPlayer plr, String[] args) {
ArrayList<Plot> plots = new ArrayList<>(); ArrayList<Plot> plots = new ArrayList<>();
UUID user = UUIDHandler.getUUID(args[0], null); UUID user = UUIDHandler.getCachedUUID(args[0], null);
if (user != null ) { if (user != null ) {
// do plots by username // do plots by username
plots.addAll(PS.get().getPlots(user)); plots.addAll(PS.get().getPlots(user));

View File

@ -110,6 +110,10 @@ public class UUIDHandler {
public static UUID getUUID(final String name, RunnableVal<UUID> ifFetch) { public static UUID getUUID(final String name, RunnableVal<UUID> ifFetch) {
return implementation.getUUID(name, ifFetch); return implementation.getUUID(name, ifFetch);
} }
public static UUID getCachedUUID(final String name, RunnableVal<UUID> ifFetch) {
return implementation.getUUIDMap().get(new StringWrapper(name));
}
public static Map<String, PlotPlayer> getPlayers() { public static Map<String, PlotPlayer> getPlayers() {
return implementation.getPlayers(); return implementation.getPlayers();