当前位置: 首页>>代码示例>>Java>>正文


Java EntityPlayer.getUUID方法代码示例

本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.getUUID方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.getUUID方法的具体用法?Java EntityPlayer.getUUID怎么用?Java EntityPlayer.getUUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.player.EntityPlayer的用法示例。


在下文中一共展示了EntityPlayer.getUUID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: lookupNames

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:PreYggdrasilConverter.java

示例2: getGameProfile

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
 * 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];
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:32,代码来源:PlayerProfileCache.java

示例3: lookupNames

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
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);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:PreYggdrasilConverter.java

示例4: lookupProfile

import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
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];
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:PlayerProfileCache.java


注:本文中的net.minecraft.entity.player.EntityPlayer.getUUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。