Java Code Examples for net.minecraft.entity.player.EntityPlayer.getUUID()

The following are Jave code examples for showing how to use getUUID() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: PreYggdrasilConverter.java   View Source Code Vote up 6 votes
private static void lookupNames(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate<String>()
    {
        public boolean apply(String p_apply_1_)
        {
            return !StringUtils.isNullOrEmpty(p_apply_1_);
        }
    }), String.class);

    if (server.isServerInOnlineMode())
    {
        server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
    }
    else
    {
        for (String s : astring)
        {
            UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            callback.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: PlayerProfileCache.java   View Source Code Vote up 6 votes
/**
 * Get a GameProfile given the MinecraftServer and the player's username.

 *  The UUID of the GameProfile will <b>not</b> be null. If the server is offline, a UUID based on the hash of the
 * username will be used.
 */
private static GameProfile getGameProfile(MinecraftServer server, String username)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
        {
            agameprofile[0] = p_onProfileLookupSucceeded_1_;
        }
        public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
        {
            agameprofile[0] = null;
        }
    };
    server.getGameProfileRepository().findProfilesByNames(new String[] {username}, Agent.MINECRAFT, profilelookupcallback);

    if (!server.isServerInOnlineMode() && agameprofile[0] == null)
    {
        UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, username));
        GameProfile gameprofile = new GameProfile(uuid, username);
        profilelookupcallback.onProfileLookupSucceeded(gameprofile);
    }

    return agameprofile[0];
}
 
Example 3
Project: DecompiledMinecraft   File: PreYggdrasilConverter.java   View Source Code Vote up 6 votes
private static void lookupNames(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate<String>()
    {
        public boolean apply(String p_apply_1_)
        {
            return !StringUtils.isNullOrEmpty(p_apply_1_);
        }
    }), String.class);

    if (server.isServerInOnlineMode())
    {
        server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
    }
    else
    {
        for (String s : astring)
        {
            UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            callback.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
Example 4
Project: DecompiledMinecraft   File: PlayerProfileCache.java   View Source Code Vote up 6 votes
/**
 * Get a GameProfile given the MinecraftServer and the player's username.

 *  The UUID of the GameProfile will <b>not</b> be null. If the server is offline, a UUID based on the hash of the
 * username will be used.
 */
private static GameProfile getGameProfile(MinecraftServer server, String username)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
        {
            agameprofile[0] = p_onProfileLookupSucceeded_1_;
        }
        public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
        {
            agameprofile[0] = null;
        }
    };
    server.getGameProfileRepository().findProfilesByNames(new String[] {username}, Agent.MINECRAFT, profilelookupcallback);

    if (!server.isServerInOnlineMode() && agameprofile[0] == null)
    {
        UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, username));
        GameProfile gameprofile = new GameProfile(uuid, username);
        profilelookupcallback.onProfileLookupSucceeded(gameprofile);
    }

    return agameprofile[0];
}
 
Example 5
Project: BaseClient   File: PreYggdrasilConverter.java   View Source Code Vote up 6 votes
private static void lookupNames(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate<String>()
    {
        public boolean apply(String p_apply_1_)
        {
            return !StringUtils.isNullOrEmpty(p_apply_1_);
        }
    }), String.class);

    if (server.isServerInOnlineMode())
    {
        server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
    }
    else
    {
        for (String s : astring)
        {
            UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            callback.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
Example 6
Project: BaseClient   File: PlayerProfileCache.java   View Source Code Vote up 6 votes
/**
 * Get a GameProfile given the MinecraftServer and the player's username.

 *  The UUID of the GameProfile will <b>not</b> be null. If the server is offline, a UUID based on the hash of the
 * username will be used.
 */
private static GameProfile getGameProfile(MinecraftServer server, String username)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
        {
            agameprofile[0] = p_onProfileLookupSucceeded_1_;
        }
        public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
        {
            agameprofile[0] = null;
        }
    };
    server.getGameProfileRepository().findProfilesByNames(new String[] {username}, Agent.MINECRAFT, profilelookupcallback);

    if (!server.isServerInOnlineMode() && agameprofile[0] == null)
    {
        UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, username));
        GameProfile gameprofile = new GameProfile(uuid, username);
        profilelookupcallback.onProfileLookupSucceeded(gameprofile);
    }

    return agameprofile[0];
}
 
Example 7
Project: BaseClient   File: PreYggdrasilConverter.java   View Source Code Vote up 6 votes
private static void lookupNames(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate<String>()
    {
        public boolean apply(String p_apply_1_)
        {
            return !StringUtils.isNullOrEmpty(p_apply_1_);
        }
    }), String.class);

    if (server.isServerInOnlineMode())
    {
        server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
    }
    else
    {
        for (String s : astring)
        {
            UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            callback.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
Example 8
Project: BaseClient   File: PlayerProfileCache.java   View Source Code Vote up 6 votes
/**
 * Get a GameProfile given the MinecraftServer and the player's username.

 *  The UUID of the GameProfile will <b>not</b> be null. If the server is offline, a UUID based on the hash of the
 * username will be used.
 */
private static GameProfile getGameProfile(MinecraftServer server, String username)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
        {
            agameprofile[0] = p_onProfileLookupSucceeded_1_;
        }
        public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
        {
            agameprofile[0] = null;
        }
    };
    server.getGameProfileRepository().findProfilesByNames(new String[] {username}, Agent.MINECRAFT, profilelookupcallback);

    if (!server.isServerInOnlineMode() && agameprofile[0] == null)
    {
        UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, username));
        GameProfile gameprofile = new GameProfile(uuid, username);
        profilelookupcallback.onProfileLookupSucceeded(gameprofile);
    }

    return agameprofile[0];
}
 
Example 9
Project: Backmemed   File: PreYggdrasilConverter.java   View Source Code Vote up 6 votes
private static void lookupNames(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate<String>()
    {
        public boolean apply(@Nullable String p_apply_1_)
        {
            return !StringUtils.isNullOrEmpty(p_apply_1_);
        }
    }), String.class);

    if (server.isServerInOnlineMode())
    {
        server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
    }
    else
    {
        for (String s : astring)
        {
            UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            callback.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
Example 10
Project: Backmemed   File: PlayerProfileCache.java   View Source Code Vote up 6 votes
private static GameProfile lookupProfile(GameProfileRepository profileRepoIn, String name)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
        {
            agameprofile[0] = p_onProfileLookupSucceeded_1_;
        }
        public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
        {
            agameprofile[0] = null;
        }
    };
    profileRepoIn.findProfilesByNames(new String[] {name}, Agent.MINECRAFT, profilelookupcallback);

    if (!isOnlineMode() && agameprofile[0] == null)
    {
        UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, name));
        GameProfile gameprofile = new GameProfile(uuid, name);
        profilelookupcallback.onProfileLookupSucceeded(gameprofile);
    }

    return agameprofile[0];
}
 
Example 11
Project: CustomWorldGen   File: PreYggdrasilConverter.java   View Source Code Vote up 6 votes
private static void lookupNames(MinecraftServer server, Collection<String> names, ProfileLookupCallback callback)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(names.iterator(), new Predicate<String>()
    {
        public boolean apply(@Nullable String p_apply_1_)
        {
            return !StringUtils.isNullOrEmpty(p_apply_1_);
        }
    }), String.class);

    if (server.isServerInOnlineMode())
    {
        server.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, callback);
    }
    else
    {
        for (String s : astring)
        {
            UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            callback.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
Example 12
Project: CustomWorldGen   File: PlayerProfileCache.java   View Source Code Vote up 6 votes
private static GameProfile lookupProfile(GameProfileRepository profileRepoIn, String name)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
        {
            agameprofile[0] = p_onProfileLookupSucceeded_1_;
        }
        public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
        {
            agameprofile[0] = null;
        }
    };
    profileRepoIn.findProfilesByNames(new String[] {name}, Agent.MINECRAFT, profilelookupcallback);

    if (!isOnlineMode() && agameprofile[0] == null)
    {
        UUID uuid = EntityPlayer.getUUID(new GameProfile((UUID)null, name));
        GameProfile gameprofile = new GameProfile(uuid, name);
        profilelookupcallback.onProfileLookupSucceeded(gameprofile);
    }

    return agameprofile[0];
}