Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void run()
- {
- running = true;
- try
- {
- startGame();
- }
- catch(Exception exception)
- {
- exception.printStackTrace();
- displayUnexpectedThrowable(new UnexpectedThrowable("Failed to start game", exception));
- return;
- }
- try
- {
- long l = System.currentTimeMillis();
- int i = 0;
- while(running && (mcApplet == null || mcApplet.isActive()))
- {
- AxisAlignedBB.clearBoundingBoxPool();
- Vec3D.initialize();
- if(mcCanvas == null && Display.isCloseRequested())
- {
- shutdown();
- }
- if(isWorldLoaded && theWorld != null)
- {
- float f = timer.renderPartialTicks;
- timer.updateTimer();
- timer.renderPartialTicks = f;
- } else
- {
- timer.updateTimer();
- }
- long l1 = System.nanoTime();
- for(int j = 0; j < timer.elapsedTicks; j++)
- {
- ticksRan++;
- try
- {
- runTick();
- continue;
- }
- catch(MinecraftException minecraftexception)
- {
- theWorld = null;
- }
- changeWorld1(null);
- displayGuiScreen(new GuiConflictWarning());
- }
- long l2 = System.nanoTime() - l1;
- checkGLError("Pre render");
- sndManager.func_338_a(thePlayer, timer.renderPartialTicks);
- GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
- if(theWorld != null && !theWorld.multiplayerWorld)
- {
- theWorld.func_6465_g();
- }
- if(theWorld != null && theWorld.multiplayerWorld)
- {
- theWorld.func_6465_g();
- }
- if(gameSettings.limitFramerate)
- {
- Thread.sleep(5L);
- }
- if(!Keyboard.isKeyDown(65))
- {
- Display.update();
- }
- if(!field_6307_v)
- {
- if(playerController != null)
- {
- playerController.setPartialTime(timer.renderPartialTicks);
- }
- entityRenderer.func_4136_b(timer.renderPartialTicks);
- }
- if(!Display.isActive())
- {
- if(fullscreen)
- {
- toggleFullscreen();
- }
- Thread.sleep(10L);
- }
- if(Keyboard.isKeyDown(61))
- {
- displayDebugInfo(l2);
- } else
- {
- prevFrameTime = System.nanoTime();
- }
- Thread.yield();
- if(Keyboard.isKeyDown(65))
- {
- Display.update();
- }
- screenshotListener();
- if(mcCanvas != null && !fullscreen && (mcCanvas.getWidth() != displayWidth || mcCanvas.getHeight() != displayHeight))
- {
- displayWidth = mcCanvas.getWidth();
- displayHeight = mcCanvas.getHeight();
- if(displayWidth <= 0)
- {
- displayWidth = 1;
- }
- if(displayHeight <= 0)
- {
- displayHeight = 1;
- }
- resize(displayWidth, displayHeight);
- }
- checkGLError("Post render");
- i++;
- isWorldLoaded = !isMultiplayerWorld() && currentScreen != null && currentScreen.doesGuiPauseGame();
- while(System.currentTimeMillis() >= l + 1000L)
- {
- debug = (new StringBuilder()).append(i).append(" fps, ").append(WorldRenderer.chunksUpdated).append(" chunk updates").toString();
- WorldRenderer.chunksUpdated = 0;
- l += 1000L;
- i = 0;
- }
- }
- }
- catch(MinecraftError minecrafterror) { }
- catch(Throwable throwable)
- {
- theWorld = null;
- throwable.printStackTrace();
- displayUnexpectedThrowable(new UnexpectedThrowable("Unexpected error", throwable));
- }
- finally { }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement