Always attempt to return a name before a uuid.

This commit is contained in:
drtshock 2014-04-16 12:28:57 -05:00
parent 9d73339e14
commit 402b3b0d07

View File

@ -15,10 +15,12 @@ import com.massivecraft.factions.zcore.persist.PlayerEntity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import java.util.UUID;
/** /**
@ -300,7 +302,11 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator {
} }
public String getName() { public String getName() {
return getPlayer() != null ? getPlayer().getName() : getId(); if(getPlayer() != null) {
return getPlayer().getName();
}
OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(getId()));
return player.getName() != null ? player.getName() : getId();
} }
public String getTag() { public String getTag() {