use of com.mojang.authlib.AuthenticationService in project CumServerPro by MCUmbrella.
the class Minecraft method loadWorld.
public void loadWorld(@Nullable WorldClient worldClientIn, String loadingMessage) {
if (world != null)
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(world));
if (worldClientIn == null) {
NetHandlerPlayClient nethandlerplayclient = this.getConnection();
if (nethandlerplayclient != null) {
nethandlerplayclient.cleanup();
}
if (this.integratedServer != null && this.integratedServer.isAnvilFileSet()) {
this.integratedServer.initiateShutdown();
if (loadingScreen != null && this.running) {
this.loadingScreen.displayLoadingString(I18n.format("forge.client.shutdown.internal"));
}
while (!integratedServer.isServerStopped()) {
try {
Thread.sleep(10);
} catch (InterruptedException ie) {
}
}
}
this.integratedServer = null;
this.entityRenderer.resetData();
this.playerController = null;
NarratorChatListener.INSTANCE.clear();
}
this.renderViewEntity = null;
this.myNetworkManager = null;
if (this.loadingScreen != null) {
this.loadingScreen.resetProgressAndMessage(loadingMessage);
this.loadingScreen.displayLoadingString("");
}
if (worldClientIn == null && this.world != null) {
this.mcResourcePackRepository.clearResourcePack();
this.ingameGUI.resetPlayersOverlayFooterHeader();
this.setServerData((ServerData) null);
this.integratedServerIsRunning = false;
net.minecraftforge.fml.client.FMLClientHandler.instance().handleClientWorldClosing(this.world);
}
this.mcSoundHandler.stopSounds();
this.world = worldClientIn;
if (this.renderGlobal != null) {
this.renderGlobal.setWorldAndLoadRenderers(worldClientIn);
}
if (this.effectRenderer != null) {
this.effectRenderer.clearEffects(worldClientIn);
}
TileEntityRendererDispatcher.instance.setWorld(worldClientIn);
net.minecraftforge.client.MinecraftForgeClient.clearRenderCache();
if (worldClientIn != null) {
if (!this.integratedServerIsRunning) {
AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString());
MinecraftSessionService minecraftsessionservice = authenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = authenticationservice.createProfileRepository();
PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.mcDataDir, MinecraftServer.USER_CACHE_FILE.getName()));
TileEntitySkull.setProfileCache(playerprofilecache);
TileEntitySkull.setSessionService(minecraftsessionservice);
PlayerProfileCache.setOnlineMode(false);
}
if (this.player == null) {
this.player = this.playerController.createPlayer(worldClientIn, new StatisticsManager(), new RecipeBookClient());
this.playerController.flipPlayer(this.player);
}
this.player.preparePlayerToSpawn();
worldClientIn.spawnEntity(this.player);
this.player.movementInput = new MovementInputFromOptions(this.gameSettings);
this.playerController.setPlayerCapabilities(this.player);
this.renderViewEntity = this.player;
} else {
this.saveLoader.flushCache();
this.player = null;
}
System.gc();
this.systemTime = 0L;
}
use of com.mojang.authlib.AuthenticationService in project Minecraft-SlientClient-Hack by YouNeverKnow00.
the class Minecraft method loadWorld.
/**
* par2Str is displayed on the loading screen to the user unloads the current world first
*/
public void loadWorld(@Nullable WorldClient worldClientIn, String loadingMessage) {
if (worldClientIn == null) {
NetHandlerPlayClient nethandlerplayclient = this.getConnection();
if (nethandlerplayclient != null) {
nethandlerplayclient.cleanup();
}
if (this.theIntegratedServer != null && this.theIntegratedServer.isAnvilFileSet()) {
this.theIntegratedServer.initiateShutdown();
}
this.theIntegratedServer = null;
this.entityRenderer.func_190564_k();
this.playerController = null;
NarratorChatListener.field_193643_a.func_193642_b();
}
this.renderViewEntity = null;
this.myNetworkManager = null;
if (this.loadingScreen != null) {
this.loadingScreen.resetProgressAndMessage(loadingMessage);
this.loadingScreen.displayLoadingString("");
}
if (worldClientIn == null && this.world != null) {
this.mcResourcePackRepository.clearResourcePack();
this.ingameGUI.resetPlayersOverlayFooterHeader();
this.setServerData((ServerData) null);
this.integratedServerIsRunning = false;
}
this.mcSoundHandler.stopSounds();
this.world = worldClientIn;
if (this.renderGlobal != null) {
this.renderGlobal.setWorldAndLoadRenderers(worldClientIn);
}
if (this.effectRenderer != null) {
this.effectRenderer.clearEffects(worldClientIn);
}
TileEntityRendererDispatcher.instance.setWorld(worldClientIn);
if (worldClientIn != null) {
if (!this.integratedServerIsRunning) {
AuthenticationService authenticationservice = new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString());
MinecraftSessionService minecraftsessionservice = authenticationservice.createMinecraftSessionService();
GameProfileRepository gameprofilerepository = authenticationservice.createProfileRepository();
PlayerProfileCache playerprofilecache = new PlayerProfileCache(gameprofilerepository, new File(this.mcDataDir, MinecraftServer.USER_CACHE_FILE.getName()));
TileEntitySkull.setProfileCache(playerprofilecache);
TileEntitySkull.setSessionService(minecraftsessionservice);
PlayerProfileCache.setOnlineMode(false);
}
if (this.player == null) {
this.player = this.playerController.func_192830_a(worldClientIn, new StatisticsManager(), new RecipeBookClient());
this.playerController.flipPlayer(this.player);
}
this.player.preparePlayerToSpawn();
worldClientIn.spawnEntityInWorld(this.player);
this.player.movementInput = new MovementInputFromOptions(this.gameSettings);
this.playerController.setPlayerCapabilities(this.player);
this.renderViewEntity = this.player;
} else {
this.saveLoader.flushCache();
this.player = null;
}
System.gc();
this.systemTime = 0L;
}
use of com.mojang.authlib.AuthenticationService in project pollen by MoonflowerTeam.
the class SkinHelper method init.
@ApiStatus.Internal
public static void init() {
AuthenticationService authenticationservice = new YggdrasilAuthenticationService(Minecraft.getInstance().getProxy());
sessionService = authenticationservice.createMinecraftSessionService();
gameProfileCache = new GameProfileCache(authenticationservice.createProfileRepository(), new File(Minecraft.getInstance().gameDirectory, MinecraftServer.USERID_CACHE_FILE.getName()));
}
Aggregations