use of net.minecraft.util.com.mojang.authlib.GameProfile in project mc-dev by Bukkit.
the class UserCache method getProfile.
public GameProfile getProfile(String s) {
String s1 = s.toLowerCase(Locale.ROOT);
UserCacheEntry usercacheentry = (UserCacheEntry) this.c.get(s1);
if (usercacheentry != null && (new Date()).getTime() >= UserCacheEntry.a(usercacheentry).getTime()) {
this.d.remove(usercacheentry.a().getId());
this.c.remove(usercacheentry.a().getName().toLowerCase(Locale.ROOT));
LinkedList linkedlist = this.e;
synchronized (this.e) {
this.e.remove(usercacheentry.a());
}
usercacheentry = null;
}
GameProfile gameprofile;
if (usercacheentry != null) {
gameprofile = usercacheentry.a();
LinkedList linkedlist1 = this.e;
synchronized (this.e) {
this.e.remove(gameprofile);
this.e.addFirst(gameprofile);
}
} else {
gameprofile = a(this.f, s1);
if (gameprofile != null) {
this.a(gameprofile);
usercacheentry = (UserCacheEntry) this.c.get(s1);
}
}
this.c();
return usercacheentry == null ? null : usercacheentry.a();
}
use of net.minecraft.util.com.mojang.authlib.GameProfile in project mc-dev by Bukkit.
the class NameReferencingFileConverter method a.
public static String a(String s) {
if (!UtilColor.b(s) && s.length() <= 16) {
MinecraftServer minecraftserver = MinecraftServer.getServer();
GameProfile gameprofile = minecraftserver.getUserCache().getProfile(s);
if (gameprofile != null && gameprofile.getId() != null) {
return gameprofile.getId().toString();
} else if (!minecraftserver.N() && minecraftserver.getOnlineMode()) {
ArrayList arraylist = Lists.newArrayList();
GameProfileLookupCallback gameprofilelookupcallback = new GameProfileLookupCallback(minecraftserver, arraylist);
a(minecraftserver, Lists.newArrayList(new String[] { s }), gameprofilelookupcallback);
return arraylist.size() > 0 && ((GameProfile) arraylist.get(0)).getId() != null ? ((GameProfile) arraylist.get(0)).getId().toString() : "";
} else {
return EntityHuman.a(new GameProfile((UUID) null, s)).toString();
}
} else {
return s;
}
}
use of net.minecraft.util.com.mojang.authlib.GameProfile in project mc-dev by Bukkit.
the class OpList method a.
public GameProfile a(String s) {
Iterator iterator = this.e().values().iterator();
OpListEntry oplistentry;
do {
if (!iterator.hasNext()) {
return null;
}
oplistentry = (OpListEntry) iterator.next();
} while (!s.equalsIgnoreCase(((GameProfile) oplistentry.getKey()).getName()));
return (GameProfile) oplistentry.getKey();
}
use of net.minecraft.util.com.mojang.authlib.GameProfile in project mc-dev by Bukkit.
the class OpListEntry method b.
private static GameProfile b(JsonObject jsonobject) {
if (jsonobject.has("uuid") && jsonobject.has("name")) {
String s = jsonobject.get("uuid").getAsString();
UUID uuid;
try {
uuid = UUID.fromString(s);
} catch (Throwable throwable) {
return null;
}
return new GameProfile(uuid, jsonobject.get("name").getAsString());
} else {
return null;
}
}
use of net.minecraft.util.com.mojang.authlib.GameProfile in project mc-dev by Bukkit.
the class PacketLoginOutSuccess method a.
public void a(PacketDataSerializer packetdataserializer) {
String s = packetdataserializer.c(36);
String s1 = packetdataserializer.c(16);
UUID uuid = UUID.fromString(s);
this.a = new GameProfile(uuid, s1);
}
Aggregations