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

Java GameProfileRepository类代码示例

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

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



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

示例1: lookupProfile

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


示例2: DedicatedServer

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public DedicatedServer(File anvilFileIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    super(anvilFileIn, Proxy.NO_PROXY, dataFixerIn, authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
    Thread thread = new Thread("Server Infinisleeper")
    {
        {
            this.setDaemon(true);
            this.start();
        }
        public void run()
        {
            while (true)
            {
                try
                {
                    Thread.sleep(2147483647L);
                }
                catch (InterruptedException var2)
                {
                    ;
                }
            }
        }
    };
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:DedicatedServer.java


示例3: DedicatedServer

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public DedicatedServer(joptsimple.OptionSet options, DataConverterManager dataconvertermanager, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache) {
    super(options, Proxy.NO_PROXY, dataconvertermanager, yggdrasilauthenticationservice, minecraftsessionservice, gameprofilerepository, usercache);
    // CraftBukkit end
    Thread thread = new Thread("Server Infinisleeper") {
        {
            this.setDaemon(true);
            this.start();
        }

        public void run() {
            while (true) {
                try {
                    Thread.sleep(2147483647L);
                } catch (InterruptedException interruptedexception) {
                    ;
                }
            }
        }
    };
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:21,代码来源:DedicatedServer.java


示例4: getUUID

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
@Override
public UUID getUUID()
{
    if (cache != null)
        return cache;
    Minecraft mc = Minecraft.getMinecraft();
    Session session = mc.getSession();
    boolean online = true;
    if (session.getToken().length() != 32 || session.getPlayerID().length() != 32)
    {
        online = false;
    }

    UUID uuid;

    if (online)
    {
        YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(mc.getProxy(), UUID.randomUUID().toString());
        GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
        PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(mc.mcDataDir, MinecraftServer.USER_CACHE_FILE.getName()));
        uuid = playerprofilecache.getGameProfileForUsername(Minecraft.getMinecraft().getSession().getUsername()).getId();
    }
    else
    {
        uuid = EntityPlayer.getOfflineUUID(session.getUsername().toLowerCase());
    }
    cache = uuid;
    return uuid;
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:30,代码来源:Client.java


示例5: IntegratedServer

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public IntegratedServer(Minecraft clientIn, String folderNameIn, String worldNameIn, WorldSettings worldSettingsIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    super(new File(clientIn.mcDataDir, "saves"), clientIn.getProxy(), clientIn.getDataFixer(), authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
    this.setServerOwner(clientIn.getSession().getUsername());
    this.setFolderName(folderNameIn);
    this.setWorldName(worldNameIn);
    this.setDemo(clientIn.isDemo());
    this.canCreateBonusChest(worldSettingsIn.isBonusChestEnabled());
    this.setBuildLimit(256);
    this.setPlayerList(new IntegratedPlayerList(this));
    this.mc = clientIn;
    this.theWorldSettings = this.isDemo() ? DemoWorldServer.DEMO_WORLD_SETTINGS : worldSettingsIn;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:IntegratedServer.java


示例6: MinecraftServer

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public MinecraftServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    this.serverProxy = proxyIn;
    this.authService = authServiceIn;
    this.sessionService = sessionServiceIn;
    this.profileRepo = profileRepoIn;
    this.profileCache = profileCacheIn;
    this.anvilFile = anvilFileIn;
    this.networkSystem = new NetworkSystem(this);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(anvilFileIn, dataFixerIn);
    this.dataFixer = dataFixerIn;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:14,代码来源:MinecraftServer.java


示例7: PlayerProfileCache

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public PlayerProfileCache(GameProfileRepository profileRepoIn, File usercacheFileIn)
{
    this.profileRepo = profileRepoIn;
    this.usercacheFile = usercacheFileIn;
    GsonBuilder gsonbuilder = new GsonBuilder();
    gsonbuilder.registerTypeHierarchyAdapter(PlayerProfileCache.ProfileEntry.class, new PlayerProfileCache.Serializer());
    this.gson = gsonbuilder.create();
    this.load();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:10,代码来源:PlayerProfileCache.java


示例8: constructServerInstance

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
@Nonnull
private DedicatedServer constructServerInstance(@Nonnull BundleContext ctx) {
  logger.info("Initializing Minecraft %s", FaucetVersion.API_VERSION);
  Bootstrap.register(); // apparently this is how the registries work ... don't question it

  // log some environment information
  logger.info("Running on Java v%s supplied by %s", System.getProperty("java.version", "Unknown"),
      System.getProperty("java.vendor"));

  // TODO: Integrate with plugins here?
  YggdrasilAuthenticationService var15 = new YggdrasilAuthenticationService(Proxy.NO_PROXY,
      UUID.randomUUID().toString());
  MinecraftSessionService var16 = var15.createMinecraftSessionService();
  GameProfileRepository var17 = var15.createProfileRepository();
  PlayerProfileCache var18 = new PlayerProfileCache(var17, new File(".", "usercache.json"));

  DedicatedServer server = new DedicatedServer(new File("."), DataFixesManager.createFixer(),
      var15, var16, var17, var18);

  // TODO: Re-introduce configuration

  if (!GraphicsEnvironment.isHeadless()) {
    logger.info("Server GUI has been disabled or is unavailable in this environment");
    // TODO: Custom GUI
  } else {
    logger
        .info("Server GUI has been disabled or is not available within the current environment");
  }

  return server;
}
 
开发者ID:BasinMC,项目名称:Basin,代码行数:32,代码来源:SinkActivator.java


示例9: FakeServer

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public FakeServer(Minecraft clientIn, String folderNameIn, String worldNameIn, WorldSettings worldSettingsIn,
        YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn,
        GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    super(new File(clientIn.mcDataDir, "saves"), null, clientIn.getDataFixer(), authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);

    this.setPlayerList(new FakePlayerList(this));
}
 
开发者ID:maruohon,项目名称:placementpreview,代码行数:9,代码来源:FakeServer.java


示例10: UserCache

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public UserCache(GameProfileRepository gameprofilerepository, File file) {
    this.g = gameprofilerepository;
    this.h = file;
    GsonBuilder gsonbuilder = new GsonBuilder();

    gsonbuilder.registerTypeHierarchyAdapter(UserCache.UserCacheEntry.class, new UserCache.BanEntrySerializer(null));
    this.b = gsonbuilder.create();
    this.b();
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:10,代码来源:UserCache.java


示例11: setGameProfileLookupService

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
@Override
public void setGameProfileLookupService()
{
    YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Minecraft.getMinecraft().getProxy(), UUID.randomUUID().toString());
    EntityHelper.sessionService = yggdrasilauthenticationservice.createMinecraftSessionService();
    GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
    EntityHelper.profileCache = new PlayerProfileCache(gameprofilerepository, new File(Minecraft.getMinecraft().mcDataDir, MinecraftServer.USER_CACHE_FILE.getName()));
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:9,代码来源:ProxyClient.java


示例12: getGameProfileRepository

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository getGameProfileRepository()
{
    return this.profileRepo;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:MinecraftServer.java


示例13: getGameProfileRepository

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository getGameProfileRepository() {
    return this.Y;
}
 
开发者ID:Prismarine,项目名称:Prismarine,代码行数:4,代码来源:MinecraftServer.java


示例14: func_152359_aw

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository func_152359_aw()
{
    return this.field_152365_W;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:MinecraftServer.java


示例15: getGameProfileRepository

import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository getGameProfileRepository() {
    return this.W;
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:4,代码来源:MinecraftServer.java



注:本文中的com.mojang.authlib.GameProfileRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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