From 51ac5d2cb2bb89f678e3c14c32a74562b8fe0ff0 Mon Sep 17 00:00:00 2001 From: gravitylow Date: Wed, 16 Apr 2014 23:15:14 -0400 Subject: [PATCH] Update commands to search by UUID --- .../massivecraft/factions/cmd/FCommand.java | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/cmd/FCommand.java b/src/main/java/com/massivecraft/factions/cmd/FCommand.java index ca8fe648..5c1d4079 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FCommand.java @@ -131,9 +131,12 @@ public abstract class FCommand extends MCommand

{ FPlayer ret = def; if (name != null) { - FPlayer fplayer = FPlayers.i.get(name); - if (fplayer != null) { - ret = fplayer; + OfflinePlayer player = Bukkit.getOfflinePlayer(name); + if (player.getName() != null) { + FPlayer fplayer = FPlayers.i.get(player); + if (fplayer != null) { + ret = fplayer; + } } } @@ -158,20 +161,7 @@ public abstract class FCommand extends MCommand

{ // BEST FPLAYER MATCH ====================== public FPlayer strAsBestFPlayerMatch(String name, FPlayer def, boolean msg) { - FPlayer ret = def; - - if (name != null) { - FPlayer fplayer = FPlayers.i.getBestIdMatch(name); - if (fplayer != null) { - ret = fplayer; - } - } - - if (msg && ret == null) { - this.msg("No player match found for \"

%s\".", name); - } - - return ret; + return strAsFPlayer(name, def, msg); } public FPlayer argAsBestFPlayerMatch(int idx, FPlayer def, boolean msg) {