SHARE
TWEET

s

a guest Feb 14th, 2020 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.     @Override
  3.     public void findProfilesByNames(String[] names, Agent agent, ProfileLookupCallback callback) {
  4.         Set<String> unfoundNames = Sets.newHashSet();
  5.         for (String name : names) {
  6.             PreLookupProfileEvent event = new PreLookupProfileEvent(name);
  7.             event.callEvent();
  8.             if (event.getUUID() != null) {
  9.                 // Plugin provided UUI, we can skip network call.
  10.                 GameProfile gameprofile = new GameProfile(event.getUUID(), name);
  11.                 // We might even have properties!
  12.                 Set<ProfileProperty> profileProperties = event.getProfileProperties();
  13.                 if (!profileProperties.isEmpty()) {
  14.                     for (ProfileProperty property : profileProperties) {
  15.                         gameprofile.getProperties().put(property.getName(), CraftPlayerProfile.asAuthlib(property));
  16.                     }
  17.                 }
  18.                 callback.onProfileLookupSucceeded(gameprofile);
  19.             } else {
  20.                 unfoundNames.add(name);
  21.             }
  22.         }
  23.  
  24.         // Some things were not found.... Proceed to look up.
  25.         if (!unfoundNames.isEmpty()) {
  26.             String[] namesArr = unfoundNames.toArray(new String[unfoundNames.size()]);
  27.             super.findProfilesByNames(namesArr, agent, new PreProfileLookupCallback(callback));
  28.         }
  29.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top