• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ProfileLookupCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.mojang.authlib.ProfileLookupCallback的典型用法代码示例。如果您正苦于以下问题:Java ProfileLookupCallback类的具体用法?Java ProfileLookupCallback怎么用?Java ProfileLookupCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ProfileLookupCallback类属于com.mojang.authlib包,在下文中一共展示了ProfileLookupCallback类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: lookupNames

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的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 com.mojang.authlib.ProfileLookupCallback; //导入依赖的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 com.mojang.authlib.ProfileLookupCallback; //导入依赖的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 com.mojang.authlib.ProfileLookupCallback; //导入依赖的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


示例5: func_152650_a

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
private static GameProfile func_152650_a(MinecraftServer p_152650_0_, String p_152650_1_)
{
    final GameProfile[] agameprofile = new GameProfile[1];
    ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
    {
        private static final String __OBFID = "CL_00001887";
        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;
        }
    };
    p_152650_0_.func_152359_aw().findProfilesByNames(new String[] {p_152650_1_}, Agent.MINECRAFT, profilelookupcallback);

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

    return agameprofile[0];
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:27,代码来源:PlayerProfileCache.java


示例6: getStringUUIDFromName

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
public static String getStringUUIDFromName(String p_152719_0_)
{
    if (!StringUtils.isNullOrEmpty(p_152719_0_) && p_152719_0_.length() <= 16)
    {
        final MinecraftServer minecraftserver = MinecraftServer.getServer();
        GameProfile gameprofile = minecraftserver.getPlayerProfileCache().getGameProfileForUsername(p_152719_0_);

        if (gameprofile != null && gameprofile.getId() != null)
        {
            return gameprofile.getId().toString();
        }
        else if (!minecraftserver.isSinglePlayer() && minecraftserver.isServerInOnlineMode())
        {
            final List<GameProfile> list = Lists.<GameProfile>newArrayList();
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    minecraftserver.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    list.add(p_onProfileLookupSucceeded_1_);
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn((String)("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName()), (Throwable)p_onProfileLookupFailed_2_);
                }
            };
            lookupNames(minecraftserver, Lists.newArrayList(new String[] {p_152719_0_}), profilelookupcallback);
            return list.size() > 0 && ((GameProfile)list.get(0)).getId() != null ? ((GameProfile)list.get(0)).getId().toString() : "";
        }
        else
        {
            return EntityPlayer.getUUID(new GameProfile((UUID)null, p_152719_0_)).toString();
        }
    }
    else
    {
        return p_152719_0_;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:40,代码来源:PreYggdrasilConverter.java


示例7: convertMobOwnerIfNeeded

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
public static String convertMobOwnerIfNeeded(final MinecraftServer server, String username)
{
    if (!StringUtils.isNullOrEmpty(username) && username.length() <= 16)
    {
        GameProfile gameprofile = server.getPlayerProfileCache().getGameProfileForUsername(username);

        if (gameprofile != null && gameprofile.getId() != null)
        {
            return gameprofile.getId().toString();
        }
        else if (!server.isSinglePlayer() && server.isServerInOnlineMode())
        {
            final List<GameProfile> list = Lists.<GameProfile>newArrayList();
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    list.add(p_onProfileLookupSucceeded_1_);
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn("Could not lookup user whitelist entry for {}", new Object[] {p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_});
                }
            };
            lookupNames(server, Lists.newArrayList(new String[] {username}), profilelookupcallback);
            return !list.isEmpty() && ((GameProfile)list.get(0)).getId() != null ? ((GameProfile)list.get(0)).getId().toString() : "";
        }
        else
        {
            return EntityPlayer.getUUID(new GameProfile((UUID)null, username)).toString();
        }
    }
    else
    {
        return username;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:PreYggdrasilConverter.java


示例8: func_152717_a

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
private static void func_152717_a(MinecraftServer p_152717_0_, Collection p_152717_1_, ProfileLookupCallback p_152717_2_)
{
    String[] astring = (String[])Iterators.toArray(Iterators.filter(p_152717_1_.iterator(), new Predicate()
    {
        private static final String __OBFID = "CL_00001881";
        public boolean func_152733_a(String p_152733_1_)
        {
            return !StringUtils.isNullOrEmpty(p_152733_1_);
        }
        public boolean apply(Object p_apply_1_)
        {
            return this.func_152733_a((String)p_apply_1_);
        }
    }), String.class);

    if (p_152717_0_.isServerInOnlineMode())
    {
        p_152717_0_.func_152359_aw().findProfilesByNames(astring, Agent.MINECRAFT, p_152717_2_);
    }
    else
    {
        String[] astring1 = astring;
        int i = astring.length;

        for (int j = 0; j < i; ++j)
        {
            String s = astring1[j];
            UUID uuid = EntityPlayer.func_146094_a(new GameProfile((UUID)null, s));
            GameProfile gameprofile = new GameProfile(uuid, s);
            p_152717_2_.onProfileLookupSucceeded(gameprofile);
        }
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:34,代码来源:PreYggdrasilConverter.java


示例9: func_152719_a

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
public static String func_152719_a(String p_152719_0_)
{
    if (!StringUtils.isNullOrEmpty(p_152719_0_) && p_152719_0_.length() <= 16)
    {
        final MinecraftServer minecraftserver = MinecraftServer.getServer();
        GameProfile gameprofile = minecraftserver.func_152358_ax().func_152655_a(p_152719_0_);

        if (gameprofile != null && gameprofile.getId() != null)
        {
            return gameprofile.getId().toString();
        }
        else if (!minecraftserver.isSinglePlayer() && minecraftserver.isServerInOnlineMode())
        {
            final ArrayList arraylist = Lists.newArrayList();
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                private static final String __OBFID = "CL_00001880";
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    minecraftserver.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_);
                    arraylist.add(p_onProfileLookupSucceeded_1_);
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.field_152732_e.warn("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_);
                }
            };
            func_152717_a(minecraftserver, Lists.newArrayList(new String[] {p_152719_0_}), profilelookupcallback);
            return arraylist.size() > 0 && ((GameProfile)arraylist.get(0)).getId() != null ? ((GameProfile)arraylist.get(0)).getId().toString() : "";
        }
        else
        {
            return EntityPlayer.func_146094_a(new GameProfile((UUID)null, p_152719_0_)).toString();
        }
    }
    else
    {
        return p_152719_0_;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:41,代码来源:PreYggdrasilConverter.java


示例10: convertUserBanlist

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
public static boolean convertUserBanlist(final MinecraftServer server) throws IOException
{
    final UserListBans userlistbans = new UserListBans(ServerConfigurationManager.FILE_PLAYERBANS);

    if (OLD_PLAYERBAN_FILE.exists() && OLD_PLAYERBAN_FILE.isFile())
    {
        if (userlistbans.getSaveFile().exists())
        {
            try
            {
                userlistbans.readSavedFile();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                LOGGER.warn((String)("Could not load existing file " + userlistbans.getSaveFile().getName()), (Throwable)filenotfoundexception);
            }
        }

        try
        {
            final Map<String, String[]> map = Maps.<String, String[]>newHashMap();
            readFile(OLD_PLAYERBAN_FILE, map);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    String[] astring = (String[])map.get(p_onProfileLookupSucceeded_1_.getName().toLowerCase(Locale.ROOT));

                    if (astring == null)
                    {
                        PreYggdrasilConverter.LOGGER.warn("Could not convert user banlist entry for " + p_onProfileLookupSucceeded_1_.getName());
                        throw new PreYggdrasilConverter.ConversionError("Profile not in the conversionlist");
                    }
                    else
                    {
                        Date date = astring.length > 1 ? PreYggdrasilConverter.parseDate(astring[1], (Date)null) : null;
                        String s = astring.length > 2 ? astring[2] : null;
                        Date date1 = astring.length > 3 ? PreYggdrasilConverter.parseDate(astring[3], (Date)null) : null;
                        String s1 = astring.length > 4 ? astring[4] : null;
                        userlistbans.addEntry(new UserListBansEntry(p_onProfileLookupSucceeded_1_, date, s, date1, s1));
                    }
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn((String)("Could not lookup user banlist entry for " + p_onProfileLookupFailed_1_.getName()), (Throwable)p_onProfileLookupFailed_2_);

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_);
                    }
                }
            };
            lookupNames(server, map.keySet(), profilelookupcallback);
            userlistbans.writeChanges();
            backupConverted(OLD_PLAYERBAN_FILE);
            return true;
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Could not read old user banlist to convert it!", (Throwable)ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverter$conversionerror)
        {
            LOGGER.error((String)"Conversion failed, please try again later", (Throwable)preyggdrasilconverter$conversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:75,代码来源:PreYggdrasilConverter.java


示例11: convertOplist

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
public static boolean convertOplist(final MinecraftServer server) throws IOException
{
    final UserListOps userlistops = new UserListOps(ServerConfigurationManager.FILE_OPS);

    if (OLD_OPS_FILE.exists() && OLD_OPS_FILE.isFile())
    {
        if (userlistops.getSaveFile().exists())
        {
            try
            {
                userlistops.readSavedFile();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                LOGGER.warn((String)("Could not load existing file " + userlistops.getSaveFile().getName()), (Throwable)filenotfoundexception);
            }
        }

        try
        {
            List<String> list = Files.readLines(OLD_OPS_FILE, Charsets.UTF_8);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    userlistops.addEntry(new UserListOpsEntry(p_onProfileLookupSucceeded_1_, server.getOpPermissionLevel(), false));
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn((String)("Could not lookup oplist entry for " + p_onProfileLookupFailed_1_.getName()), (Throwable)p_onProfileLookupFailed_2_);

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_);
                    }
                }
            };
            lookupNames(server, list, profilelookupcallback);
            userlistops.writeChanges();
            backupConverted(OLD_OPS_FILE);
            return true;
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Could not read old oplist to convert it!", (Throwable)ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverter$conversionerror)
        {
            LOGGER.error((String)"Conversion failed, please try again later", (Throwable)preyggdrasilconverter$conversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:60,代码来源:PreYggdrasilConverter.java


示例12: convertWhitelist

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
public static boolean convertWhitelist(final MinecraftServer server) throws IOException
{
    final UserListWhitelist userlistwhitelist = new UserListWhitelist(ServerConfigurationManager.FILE_WHITELIST);

    if (OLD_WHITELIST_FILE.exists() && OLD_WHITELIST_FILE.isFile())
    {
        if (userlistwhitelist.getSaveFile().exists())
        {
            try
            {
                userlistwhitelist.readSavedFile();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                LOGGER.warn((String)("Could not load existing file " + userlistwhitelist.getSaveFile().getName()), (Throwable)filenotfoundexception);
            }
        }

        try
        {
            List<String> list = Files.readLines(OLD_WHITELIST_FILE, Charsets.UTF_8);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    userlistwhitelist.addEntry(new UserListWhitelistEntry(p_onProfileLookupSucceeded_1_));
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn((String)("Could not lookup user whitelist entry for " + p_onProfileLookupFailed_1_.getName()), (Throwable)p_onProfileLookupFailed_2_);

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_);
                    }
                }
            };
            lookupNames(server, list, profilelookupcallback);
            userlistwhitelist.writeChanges();
            backupConverted(OLD_WHITELIST_FILE);
            return true;
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Could not read old whitelist to convert it!", (Throwable)ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverter$conversionerror)
        {
            LOGGER.error((String)"Conversion failed, please try again later", (Throwable)preyggdrasilconverter$conversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:60,代码来源:PreYggdrasilConverter.java


示例13: convertUserBanlist

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean convertUserBanlist(final MinecraftServer server) throws IOException
{
    final UserListBans userlistbans = new UserListBans(PlayerList.FILE_PLAYERBANS);

    if (OLD_PLAYERBAN_FILE.exists() && OLD_PLAYERBAN_FILE.isFile())
    {
        if (userlistbans.getSaveFile().exists())
        {
            try
            {
                userlistbans.readSavedFile();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                LOGGER.warn("Could not load existing file {}", new Object[] {userlistbans.getSaveFile().getName(), filenotfoundexception});
            }
        }

        try
        {
            final Map<String, String[]> map = Maps.<String, String[]>newHashMap();
            readFile(OLD_PLAYERBAN_FILE, map);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    String[] astring = (String[])map.get(p_onProfileLookupSucceeded_1_.getName().toLowerCase(Locale.ROOT));

                    if (astring == null)
                    {
                        PreYggdrasilConverter.LOGGER.warn("Could not convert user banlist entry for {}", new Object[] {p_onProfileLookupSucceeded_1_.getName()});
                        throw new PreYggdrasilConverter.ConversionError("Profile not in the conversionlist");
                    }
                    else
                    {
                        Date date = astring.length > 1 ? PreYggdrasilConverter.parseDate(astring[1], (Date)null) : null;
                        String s = astring.length > 2 ? astring[2] : null;
                        Date date1 = astring.length > 3 ? PreYggdrasilConverter.parseDate(astring[3], (Date)null) : null;
                        String s1 = astring.length > 4 ? astring[4] : null;
                        userlistbans.addEntry(new UserListBansEntry(p_onProfileLookupSucceeded_1_, date, s, date1, s1));
                    }
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn("Could not lookup user banlist entry for {}", new Object[] {p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_});

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_);
                    }
                }
            };
            lookupNames(server, map.keySet(), profilelookupcallback);
            userlistbans.writeChanges();
            backupConverted(OLD_PLAYERBAN_FILE);
            return true;
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Could not read old user banlist to convert it!", (Throwable)ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverter$conversionerror)
        {
            LOGGER.error((String)"Conversion failed, please try again later", (Throwable)preyggdrasilconverter$conversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:76,代码来源:PreYggdrasilConverter.java


示例14: convertOplist

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean convertOplist(final MinecraftServer server) throws IOException
{
    final UserListOps userlistops = new UserListOps(PlayerList.FILE_OPS);

    if (OLD_OPS_FILE.exists() && OLD_OPS_FILE.isFile())
    {
        if (userlistops.getSaveFile().exists())
        {
            try
            {
                userlistops.readSavedFile();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                LOGGER.warn("Could not load existing file {}", new Object[] {userlistops.getSaveFile().getName(), filenotfoundexception});
            }
        }

        try
        {
            List<String> list = Files.readLines(OLD_OPS_FILE, Charsets.UTF_8);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    userlistops.addEntry(new UserListOpsEntry(p_onProfileLookupSucceeded_1_, server.getOpPermissionLevel(), false));
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn("Could not lookup oplist entry for {}", new Object[] {p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_});

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_);
                    }
                }
            };
            lookupNames(server, list, profilelookupcallback);
            userlistops.writeChanges();
            backupConverted(OLD_OPS_FILE);
            return true;
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Could not read old oplist to convert it!", (Throwable)ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverter$conversionerror)
        {
            LOGGER.error((String)"Conversion failed, please try again later", (Throwable)preyggdrasilconverter$conversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:61,代码来源:PreYggdrasilConverter.java


示例15: convertWhitelist

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean convertWhitelist(final MinecraftServer server) throws IOException
{
    final UserListWhitelist userlistwhitelist = new UserListWhitelist(PlayerList.FILE_WHITELIST);

    if (OLD_WHITELIST_FILE.exists() && OLD_WHITELIST_FILE.isFile())
    {
        if (userlistwhitelist.getSaveFile().exists())
        {
            try
            {
                userlistwhitelist.readSavedFile();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                LOGGER.warn("Could not load existing file {}", new Object[] {userlistwhitelist.getSaveFile().getName(), filenotfoundexception});
            }
        }

        try
        {
            List<String> list = Files.readLines(OLD_WHITELIST_FILE, Charsets.UTF_8);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    server.getPlayerProfileCache().addEntry(p_onProfileLookupSucceeded_1_);
                    userlistwhitelist.addEntry(new UserListWhitelistEntry(p_onProfileLookupSucceeded_1_));
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.LOGGER.warn("Could not lookup user whitelist entry for {}", new Object[] {p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_});

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_);
                    }
                }
            };
            lookupNames(server, list, profilelookupcallback);
            userlistwhitelist.writeChanges();
            backupConverted(OLD_WHITELIST_FILE);
            return true;
        }
        catch (IOException ioexception)
        {
            LOGGER.warn((String)"Could not read old whitelist to convert it!", (Throwable)ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverter$conversionerror)
        {
            LOGGER.error((String)"Conversion failed, please try again later", (Throwable)preyggdrasilconverter$conversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:61,代码来源:PreYggdrasilConverter.java


示例16: func_152724_a

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean func_152724_a(final MinecraftServer p_152724_0_) throws IOException
{
    final UserListBans userlistbans = new UserListBans(ServerConfigurationManager.field_152613_a);

    if (field_152729_b.exists() && field_152729_b.isFile())
    {
        if (userlistbans.func_152691_c().exists())
        {
            try
            {
                userlistbans.func_152679_g();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                field_152732_e.warn("Could not load existing file " + userlistbans.func_152691_c().getName(), filenotfoundexception);
            }
        }

        try
        {
            final HashMap hashmap = Maps.newHashMap();
            func_152721_a(field_152729_b, hashmap);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                private static final String __OBFID = "CL_00001910";
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    p_152724_0_.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_);
                    String[] astring = (String[])hashmap.get(p_onProfileLookupSucceeded_1_.getName().toLowerCase(Locale.ROOT));

                    if (astring == null)
                    {
                        PreYggdrasilConverter.field_152732_e.warn("Could not convert user banlist entry for " + p_onProfileLookupSucceeded_1_.getName());
                        throw new PreYggdrasilConverter.ConversionError("Profile not in the conversionlist", null);
                    }
                    else
                    {
                        Date date = astring.length > 1 ? PreYggdrasilConverter.func_152713_b(astring[1], (Date)null) : null;
                        String s = astring.length > 2 ? astring[2] : null;
                        Date date1 = astring.length > 3 ? PreYggdrasilConverter.func_152713_b(astring[3], (Date)null) : null;
                        String s1 = astring.length > 4 ? astring[4] : null;
                        userlistbans.func_152687_a(new UserListBansEntry(p_onProfileLookupSucceeded_1_, date, s, date1, s1));
                    }
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.field_152732_e.warn("Could not lookup user banlist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_);

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_, null);
                    }
                }
            };
            func_152717_a(p_152724_0_, hashmap.keySet(), profilelookupcallback);
            userlistbans.func_152678_f();
            func_152727_c(field_152729_b);
            return true;
        }
        catch (IOException ioexception)
        {
            field_152732_e.warn("Could not read old user banlist to convert it!", ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverterconversionerror)
        {
            field_152732_e.error("Conversion failed, please try again later", preyggdrasilconverterconversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:77,代码来源:PreYggdrasilConverter.java


示例17: func_152718_c

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean func_152718_c(final MinecraftServer p_152718_0_) throws IOException
{
    final UserListOps userlistops = new UserListOps(ServerConfigurationManager.field_152615_c);

    if (field_152730_c.exists() && field_152730_c.isFile())
    {
        if (userlistops.func_152691_c().exists())
        {
            try
            {
                userlistops.func_152679_g();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                field_152732_e.warn("Could not load existing file " + userlistops.func_152691_c().getName(), filenotfoundexception);
            }
        }

        try
        {
            List list = Files.readLines(field_152730_c, Charsets.UTF_8);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                private static final String __OBFID = "CL_00001909";
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    p_152718_0_.func_152358_ax().func_152649_a(p_onProfileLookupSucceeded_1_);
                    userlistops.func_152687_a(new UserListOpsEntry(p_onProfileLookupSucceeded_1_, p_152718_0_.getOpPermissionLevel()));
                }
                public void onProfileLookupFailed(GameProfile p_onProfileLookupFailed_1_, Exception p_onProfileLookupFailed_2_)
                {
                    PreYggdrasilConverter.field_152732_e.warn("Could not lookup oplist entry for " + p_onProfileLookupFailed_1_.getName(), p_onProfileLookupFailed_2_);

                    if (!(p_onProfileLookupFailed_2_ instanceof ProfileNotFoundException))
                    {
                        throw new PreYggdrasilConverter.ConversionError("Could not request user " + p_onProfileLookupFailed_1_.getName() + " from backend systems", p_onProfileLookupFailed_2_, null);
                    }
                }
            };
            func_152717_a(p_152718_0_, list, profilelookupcallback);
            userlistops.func_152678_f();
            func_152727_c(field_152730_c);
            return true;
        }
        catch (IOException ioexception)
        {
            field_152732_e.warn("Could not read old oplist to convert it!", ioexception);
            return false;
        }
        catch (PreYggdrasilConverter.ConversionError preyggdrasilconverterconversionerror)
        {
            field_152732_e.error("Conversion failed, please try again later", preyggdrasilconverterconversionerror);
            return false;
        }
    }
    else
    {
        return true;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:62,代码来源:PreYggdrasilConverter.java


示例18: func_152710_d

import com.mojang.authlib.ProfileLookupCallback; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean func_152710_d(final MinecraftServer p_152710_0_) throws IOException
{
    final UserListWhitelist userlistwhitelist = new UserListWhitelist(ServerConfigurationManager.field_152616_d);

    if (field_152731_d.exists() && field_152731_d.isFile())
    {
        if (userlistwhitelist.func_152691_c().exists())
        {
            try
            {
                userlistwhitelist.func_152679_g();
            }
            catch (FileNotFoundException filenotfoundexception)
            {
                field_152732_e.warn("Could not load existing file " + userlistwhitelist.func_152691_c().getName(), filenotfoundexception);
            }
        }

        try
        {
            List list = Files.readLines(field_152731_d, Charsets.UTF_8);
            ProfileLookupCallback profilelookupcallback = new ProfileLookupCallback()
            {
                private static final String __OBFID = "CL_00001908";
                public void onProfileLookupSucceeded(GameProfile p_onProfileLookupSucceeded_1_)
                {
                    p_152710_0_. 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AlipayTradeWapPayModel类代码示例发布时间:2022-05-23
下一篇:
Java Alignment类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap