Package net.minecraft.util.com.mojang.authlib

Examples of net.minecraft.util.com.mojang.authlib.GameProfile


      }
    }
   
    private void handleLoginStart(Channel channel, Object packet) {
      if (PACKET_LOGIN_IN_START.isInstance(packet)) {
        GameProfile profile = getGameProfile.get(packet);
        channelLookup.put(profile.getName(), channel);
      }
    }
View Full Code Here


   */
  public void setBukkitPlayers(Iterable<? extends Player> players) {
    List<WrappedGameProfile> profiles = Lists.newArrayList();
   
    for (Player player : players) {
      GameProfile profile = (GameProfile) ENTITY_HUMAN_PROFILE.get(BukkitUnwrapper.getInstance().unwrapItem(player));
      profiles.add(WrappedGameProfile.fromHandle(profile));
    }
    setPlayers(profiles);
  }
View Full Code Here

    super(GameProfile.class);
   
    if (CREATE_STRING_STRING != null) {
      setHandle(CREATE_STRING_STRING.invoke(id, name));
    } else {
      setHandle(new GameProfile(parseUUID(id), name));
    }
  }
View Full Code Here

    super(GameProfile.class);
   
    if (CREATE_STRING_STRING != null) {
      setHandle(CREATE_STRING_STRING.invoke(uuid != null ? uuid.toString() : null, name));
    } else {
      setHandle(new GameProfile(uuid, name));
    }
  }
View Full Code Here

   * @return The UUID of the player, or NULL if not computed.
   */
  public String getId() {
    if (GET_UUID_STRING != null)
      return (String) GET_UUID_STRING.get(handle);
    final GameProfile profile = getProfile();
    return profile.getId() != null ? profile.getId().toString() : null;
  }
View Full Code Here

      LOGIN_GAME_PROFILE = loginClient;
    }
     
    // See if we are dealing with the login packet
    if (loginClass.equals(packetClass)) {
      GameProfile profile = (GameProfile) loginClient.get(packet);
     
      // Save the channel injector
      factory.cacheInjector(profile.getName(), this);
    }
  }
View Full Code Here

                TileEntity tileentity = world.getTileEntity(i, j, k);

                if (tileentity != null && tileentity instanceof TileEntitySkull) {
                    if (itemstack.getData() == 3) {
                        GameProfile gameprofile = null;

                        if (itemstack.hasTag()) {
                            NBTTagCompound nbttagcompound = itemstack.getTag();

                            if (nbttagcompound.hasKeyOfType("SkullOwner", 10)) {
                                gameprofile = GameProfileSerializer.deserialize(nbttagcompound.getCompound("SkullOwner"));
                            } else if (nbttagcompound.hasKeyOfType("SkullOwner", 8) && nbttagcompound.getString("SkullOwner").length() > 0) {
                                gameprofile = new GameProfile((UUID) null, nbttagcompound.getString("SkullOwner"));
                            }
                        }

                        ((TileEntitySkull) tileentity).setGameProfile(gameprofile);
                    } else {
View Full Code Here

                uuid = UUID.fromString(s);
            } catch (Throwable throwable) {
                return null;
            }

            return new GameProfile(uuid, jsonobject.get("name").getAsString());
        } else {
            return null;
        }
    }
View Full Code Here

            String[] astring1 = astring;
            int i = astring.length;

            for (int j = 0; j < i; ++j) {
                String s = astring1[j];
                UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s));
                GameProfile gameprofile = new GameProfile(uuid, s);

                profilelookupcallback.onProfileLookupSucceeded(gameprofile);
            }
        }
    }
View Full Code Here

    }

    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;
        }
    }
View Full Code Here

TOP

Related Classes of net.minecraft.util.com.mojang.authlib.GameProfile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.