mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-23 18:55:25 +01:00
Update commands to search by UUID
This commit is contained in:
parent
bad3d779c5
commit
51ac5d2cb2
@ -131,9 +131,12 @@ public abstract class FCommand extends MCommand<P> {
|
|||||||
FPlayer ret = def;
|
FPlayer ret = def;
|
||||||
|
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
FPlayer fplayer = FPlayers.i.get(name);
|
OfflinePlayer player = Bukkit.getOfflinePlayer(name);
|
||||||
if (fplayer != null) {
|
if (player.getName() != null) {
|
||||||
ret = fplayer;
|
FPlayer fplayer = FPlayers.i.get(player);
|
||||||
|
if (fplayer != null) {
|
||||||
|
ret = fplayer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,20 +161,7 @@ public abstract class FCommand extends MCommand<P> {
|
|||||||
|
|
||||||
// BEST FPLAYER MATCH ======================
|
// BEST FPLAYER MATCH ======================
|
||||||
public FPlayer strAsBestFPlayerMatch(String name, FPlayer def, boolean msg) {
|
public FPlayer strAsBestFPlayerMatch(String name, FPlayer def, boolean msg) {
|
||||||
FPlayer ret = def;
|
return strAsFPlayer(name, def, msg);
|
||||||
|
|
||||||
if (name != null) {
|
|
||||||
FPlayer fplayer = FPlayers.i.getBestIdMatch(name);
|
|
||||||
if (fplayer != null) {
|
|
||||||
ret = fplayer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg && ret == null) {
|
|
||||||
this.msg("<b>No player match found for \"<p>%s<b>\".", name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FPlayer argAsBestFPlayerMatch(int idx, FPlayer def, boolean msg) {
|
public FPlayer argAsBestFPlayerMatch(int idx, FPlayer def, boolean msg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user