本文整理汇总了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];
}
示例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)
{
;
}
}
}
};
}
示例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) {
;
}
}
}
};
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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));
}
示例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();
}
示例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()));
}
示例12: getGameProfileRepository
import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository getGameProfileRepository()
{
return this.profileRepo;
}
示例13: getGameProfileRepository
import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository getGameProfileRepository() {
return this.Y;
}
示例14: func_152359_aw
import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository func_152359_aw()
{
return this.field_152365_W;
}
示例15: getGameProfileRepository
import com.mojang.authlib.GameProfileRepository; //导入依赖的package包/类
public GameProfileRepository getGameProfileRepository() {
return this.W;
}