private WrappedGameProfile(Object profile) { super(GAME_PROFILE); setHandle(profile); }
/** * Construct a new game profile with the given properties. * <p> * Note that at least one of the parameters must be non-null. * * @param uuid - the UUID of the player, or NULL. * @param name - the name of the player, or NULL. */ public WrappedGameProfile(UUID uuid, String name) { super(GAME_PROFILE); if (CREATE_STRING_STRING != null) { setHandle(CREATE_STRING_STRING.invoke(uuid != null ? uuid.toString() : null, name)); } else if (CREATE_UUID_STRING != null) { setHandle(CREATE_UUID_STRING.invoke(uuid, name)); } else { throw new IllegalArgumentException("Unsupported GameProfile constructor."); } }
/** * Construct a new game profile with the given properties. * <p> * Note that this constructor is very lenient when parsing UUIDs for backwards compatibility reasons. * IDs that cannot be parsed as an UUID will be hashed and form a version 3 UUID instead. * <p> * This method is deprecated for Minecraft 1.7.8 and above. * * @param id - the UUID of the player. * @param name - the name of the player. */ @Deprecated public WrappedGameProfile(String id, String name) { super(GAME_PROFILE); if (CREATE_STRING_STRING != null) { setHandle(CREATE_STRING_STRING.invoke(id, name)); } else if (CREATE_UUID_STRING != null) { setHandle(CREATE_UUID_STRING.invoke(parseUUID(id), name)); } else { throw new IllegalArgumentException("Unsupported GameProfile constructor."); } }