From 1b2c2c46902149a6d322d23f746961ab5e66ef42 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 9 Apr 2014 04:13:54 +1200 Subject: [PATCH] Change gameprofile to accept UUID's --- .../libraryaddict/disguise/utilities/ReflectionManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/ReflectionManager.java b/src/me/libraryaddict/disguise/utilities/ReflectionManager.java index 478f2e35..95591248 100644 --- a/src/me/libraryaddict/disguise/utilities/ReflectionManager.java +++ b/src/me/libraryaddict/disguise/utilities/ReflectionManager.java @@ -90,7 +90,7 @@ public class ReflectionManager { Object playerinteractmanager = getNmsClass("PlayerInteractManager").getConstructor(getNmsClass("World")) .newInstance(world); if (LibVersion.is1_7()) { - Object gameProfile = getGameProfile("LibsDisguises"); + Object gameProfile = getGameProfile(null, "LibsDisguises"); entityObject = entityClass.getConstructor(getNmsClass("MinecraftServer"), getNmsClass("WorldServer"), gameProfile.getClass(), playerinteractmanager.getClass()).newInstance(minecraftServer, world, gameProfile, playerinteractmanager); @@ -206,10 +206,10 @@ public class ReflectionManager { return null; } - public static Object getGameProfile(String playerName) { + public static Object getGameProfile(UUID uuid, String playerName) { try { return Class.forName("net.minecraft.util.com.mojang.authlib.GameProfile").getConstructor(String.class, String.class) - .newInstance(UUID.randomUUID().toString(), playerName); + .newInstance(uuid != null ? uuid.toString() : UUID.randomUUID().toString(), playerName); } catch (Exception ex) { ex.printStackTrace(); }