We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c033691 commit 887159dCopy full SHA for 887159d
src/main/java/myessentials/utils/PlayerUtils.java
@@ -1,5 +1,6 @@
1
package myessentials.utils;
2
3
+import com.mojang.authlib.GameProfile;
4
import cpw.mods.fml.common.FMLCommonHandler;
5
import cpw.mods.fml.common.registry.GameRegistry;
6
import myessentials.MyEssentialsCore;
@@ -287,4 +288,9 @@ public static EntityPlayer getPlayerFromUUID(UUID uuid) {
287
288
}
289
return null;
290
291
+
292
+ public static UUID getUUIDFromUsername(String username) {
293
+ GameProfile profile = MinecraftServer.getServer().func_152358_ax().func_152655_a(username);
294
+ return profile == null ? null : profile.getId();
295
+ }
296
0 commit comments