MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / startGame

Method startGame

src/main/java/net/minecraft/client/Minecraft.java:462–591  ·  view source on GitHub ↗

Starts the game: initializes the canvas, the title, the settings, etcetera.

()

Source from the content-addressed store, hash-verified

460 * Starts the game: initializes the canvas, the title, the settings, etcetera.
461 */
462 private void startGame() throws LWJGLException, IOException
463 {
464 this.gameSettings = new GameSettings(this, this.mcDataDir);
465 this.defaultResourcePacks.add(this.mcDefaultResourcePack);
466 this.startTimerHackThread();
467
468 if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0)
469 {
470 this.displayWidth = this.gameSettings.overrideWidth;
471 this.displayHeight = this.gameSettings.overrideHeight;
472 }
473
474 logger.info("LWJGL Version: " + Sys.getVersion());
475 this.setWindowIcon();
476 this.setInitialDisplayMode();
477 this.createDisplay();
478 OpenGlHelper.initializeTextures();
479 this.framebufferMc = new Framebuffer(this.displayWidth, this.displayHeight, true);
480 this.framebufferMc.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F);
481 this.registerMetadataSerializers();
482 this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, new File(this.mcDataDir, "server-resource-packs"), this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings);
483 this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_);
484 this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language);
485 this.mcResourceManager.registerReloadListener(this.mcLanguageManager);
486 this.refreshResources();
487 this.renderEngine = new TextureManager(this.mcResourceManager);
488 this.mcResourceManager.registerReloadListener(this.renderEngine);
489 this.drawSplashScreen(this.renderEngine);
490 this.skinManager = new SkinManager(this.renderEngine, new File(this.fileAssets, "skins"), this.sessionService);
491 this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves"));
492 this.mcSoundHandler = new SoundHandler(this.mcResourceManager, this.gameSettings);
493 this.mcResourceManager.registerReloadListener(this.mcSoundHandler);
494 this.mcMusicTicker = new MusicTicker(this);
495 this.MCfontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false);
496
497 if (this.gameSettings.language != null)
498 {
499 this.MCfontRenderer.setUnicodeFlag(this.isUnicode());
500 this.MCfontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional());
501 }
502
503 this.standardGalacticFontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii_sga.png"), this.renderEngine, false);
504 this.mcResourceManager.registerReloadListener(this.MCfontRenderer);
505 this.mcResourceManager.registerReloadListener(this.standardGalacticFontRenderer);
506 this.mcResourceManager.registerReloadListener(new GrassColorReloadListener());
507 this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener());
508 AchievementList.openInventory.setStatStringFormatter(new IStatStringFormat()
509 {
510 public String formatString(String p_74535_1_)
511 {
512 try
513 {
514 return String.format(p_74535_1_, GameSettings.getKeyDisplayString(Minecraft.this.gameSettings.keyBindInventory.getKeyCode()));
515 }
516 catch (Exception exception)
517 {
518 return "Error: " + exception.getLocalizedMessage();
519 }

Callers 1

runMethod · 0.95

Calls 15

startTimerHackThreadMethod · 0.95
setWindowIconMethod · 0.95
setInitialDisplayModeMethod · 0.95
createDisplayMethod · 0.95
initializeTexturesMethod · 0.95
refreshResourcesMethod · 0.95
drawSplashScreenMethod · 0.95
isUnicodeMethod · 0.95
checkGLErrorMethod · 0.95
enableTexture2DMethod · 0.95
shadeModelMethod · 0.95

Tested by

no test coverage detected