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) {