Advertisement
GamingLVScripts

func_181560_a

Apr 1st, 2024
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 8.73 KB | None | 0 0
  1. public void func_181560_a(float p_181560_1_, long p_181560_2_, float particleTicks)
  2.     {
  3.         Config.renderPartialTicks = p_181560_1_;
  4.         this.frameInit();
  5.         boolean flag = Display.isActive();
  6.  
  7.         if (!flag && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1)))
  8.         {
  9.             if (Minecraft.getSystemTime() - this.prevFrameTime > 500L)
  10.             {
  11.                 this.mc.displayInGameMenu();
  12.             }
  13.         }
  14.         else
  15.         {
  16.             this.prevFrameTime = Minecraft.getSystemTime();
  17.         }
  18.  
  19.         this.mc.mcProfiler.startSection("mouse");
  20.  
  21.         if (flag && Minecraft.isRunningOnMac && this.mc.inGameHasFocus && !Mouse.isInsideWindow())
  22.         {
  23.             Mouse.setGrabbed(false);
  24.             Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2);
  25.             Mouse.setGrabbed(true);
  26.         }
  27.  
  28.  
  29.         if (this.mc.inGameHasFocus && flag) {
  30.             if (this.pointedEntity instanceof EntityLivingBase) {
  31.                 final EntityLivingBase livingBase = (EntityLivingBase) this.mc.getRenderViewEntity();
  32.                 final RendererEvent rendererEvent = new RendererEvent(livingBase.rotationYaw, livingBase.rotationPitch).publishItself();
  33.             }
  34.  
  35.             this.mc.mouseHelper.mouseXYChange();
  36.             float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F;
  37.             float f1 = f * f * f * 8.0F;
  38.             float f2 = (float) this.mc.mouseHelper.deltaX * f1;
  39.             float f3 = (float) this.mc.mouseHelper.deltaY * f1;
  40.             int i = 1;
  41.  
  42.             if (this.mc.gameSettings.invertMouse) {
  43.                 i = -1;
  44.             }
  45.  
  46.             final EntityRendererEvent entityRendererEvent = new EntityRendererEvent(this.mc.thePlayer).publishItself();
  47.             if (entityRendererEvent.getEntity() != null)
  48.                 if (this.mc.gameSettings.smoothCamera) {
  49.                     this.smoothCamYaw += f2;
  50.                     this.smoothCamPitch += f3;
  51.                     float f4 = p_181560_1_ - this.smoothCamPartialTicks;
  52.                     this.smoothCamPartialTicks = p_181560_1_;
  53.                     f2 = this.smoothCamFilterX * f4;
  54.                     f3 = this.smoothCamFilterY * f4;
  55.                     entityRendererEvent.getEntity().setAngles(f2, f3 * (float) i);
  56.                 } else {
  57.                     this.smoothCamYaw = 0.0F;
  58.                     this.smoothCamPitch = 0.0F;
  59.                     entityRendererEvent.getEntity().setAngles(f2, f3 * (float) i);
  60.                 }
  61.             PlayerHandler.prevYaw = PlayerHandler.yaw;
  62.             PlayerHandler.prevPitch = PlayerHandler.pitch;
  63.             final RotationEvent rotationEvent = new RotationEvent(entityRendererEvent.getEntity().rotationYaw, entityRendererEvent.getEntity().rotationPitch).publishItself();
  64.             PlayerHandler.yaw = rotationEvent.getYaw();
  65.             PlayerHandler.pitch = rotationEvent.getPitch();
  66.         }
  67.  
  68.         this.mc.mcProfiler.endSection();
  69.  
  70.         if (!this.mc.skipRenderWorld)
  71.         {
  72.             anaglyphEnable = this.mc.gameSettings.anaglyph;
  73.             final ScaledResolution scaledresolution = new ScaledResolution(this.mc);
  74.             int i1 = scaledresolution.getScaledWidth();
  75.             int j1 = scaledresolution.getScaledHeight();
  76.             final int k1 = Mouse.getX() * i1 / this.mc.displayWidth;
  77.             final int l1 = j1 - Mouse.getY() * j1 / this.mc.displayHeight - 1;
  78.             int i2 = this.mc.gameSettings.limitFramerate;
  79.  
  80.             if (this.mc.theWorld != null)
  81.             {
  82.                 this.mc.mcProfiler.startSection("level");
  83.                 int j = Math.min(Minecraft.getDebugFPS(), i2);
  84.                 j = Math.max(j, 60);
  85.                 long k = System.nanoTime() - p_181560_2_;
  86.                 long l = Math.max((long)(1000000000 / j / 4) - k, 0L);
  87.                 this.renderWorld(p_181560_1_, System.nanoTime() + l, particleTicks);
  88.  
  89.                 if (OpenGlHelper.shadersSupported)
  90.                 {
  91.                     this.mc.renderGlobal.renderEntityOutlineFramebuffer();
  92.  
  93.                     if (this.theShaderGroup != null && this.useShader)
  94.                     {
  95.                         GlStateManager.matrixMode(5890);
  96.                         GlStateManager.pushMatrix();
  97.                         GlStateManager.loadIdentity();
  98.                         this.theShaderGroup.loadShaderGroup(p_181560_1_);
  99.                         GlStateManager.popMatrix();
  100.                     }
  101.  
  102.                     this.mc.getFramebuffer().bindFramebuffer(true);
  103.                 }
  104.  
  105.                 this.renderEndNanoTime = System.nanoTime();
  106.                 this.mc.mcProfiler.endStartSection("gui");
  107.  
  108.                 if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null)
  109.                 {
  110.                     GlStateManager.alphaFunc(516, 0.1F);
  111.                     this.mc.ingameGUI.renderGameOverlay(p_181560_1_);
  112.  
  113.                     if (this.mc.gameSettings.ofShowFps && !this.mc.gameSettings.showDebugInfo)
  114.                     {
  115.                         Config.drawFps();
  116.                     }
  117.  
  118.                     if (this.mc.gameSettings.showDebugInfo)
  119.                     {
  120.                         Lagometer.showLagometer(scaledresolution);
  121.                     }
  122.                 }
  123.  
  124.                 this.mc.mcProfiler.endSection();
  125.             }
  126.             else
  127.             {
  128.                 GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
  129.                 GlStateManager.matrixMode(5889);
  130.                 GlStateManager.loadIdentity();
  131.                 GlStateManager.matrixMode(5888);
  132.                 GlStateManager.loadIdentity();
  133.                 this.setupOverlayRendering();
  134.                 this.renderEndNanoTime = System.nanoTime();
  135.                 TileEntityRendererDispatcher.instance.renderEngine = this.mc.getTextureManager();
  136.                 TileEntityRendererDispatcher.instance.fontRenderer = this.mc.fontRendererObj;
  137.             }
  138.  
  139.             if (this.mc.currentScreen != null)
  140.             {
  141.                 GlStateManager.clear(256);
  142.  
  143.                 try
  144.                 {
  145.                     if (Reflector.ForgeHooksClient_drawScreen.exists())
  146.                     {
  147.                         Reflector.callVoid(Reflector.ForgeHooksClient_drawScreen, new Object[] {this.mc.currentScreen, Integer.valueOf(k1), Integer.valueOf(l1), Float.valueOf(p_181560_1_)});
  148.                     }
  149.                     else
  150.                     {
  151.                         this.mc.currentScreen.drawScreen(k1, l1, p_181560_1_);
  152.                     }
  153.                 }
  154.                 catch (Throwable throwable)
  155.                 {
  156.                     CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering screen");
  157.                     CrashReportCategory crashreportcategory = crashreport.makeCategory("Screen render details");
  158.                     crashreportcategory.addCrashSectionCallable("Screen name", new Callable<String>()
  159.                     {
  160.                         public String call() throws Exception
  161.                         {
  162.                             return EntityRenderer.this.mc.currentScreen.getClass().getCanonicalName();
  163.                         }
  164.                     });
  165.                     crashreportcategory.addCrashSectionCallable("Mouse location", new Callable<String>()
  166.                     {
  167.                         public String call() throws Exception
  168.                         {
  169.                             return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[] {Integer.valueOf(k1), Integer.valueOf(l1), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())});
  170.                         }
  171.                     });
  172.                     crashreportcategory.addCrashSectionCallable("Screen size", new Callable<String>()
  173.                     {
  174.                         public String call() throws Exception
  175.                         {
  176.                             return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[] {Integer.valueOf(scaledresolution.getScaledWidth()), Integer.valueOf(scaledresolution.getScaledHeight()), Integer.valueOf(EntityRenderer.this.mc.displayWidth), Integer.valueOf(EntityRenderer.this.mc.displayHeight), Integer.valueOf(scaledresolution.getScaleFactor())});
  177.                         }
  178.                     });
  179.                     throw new ReportedException(crashreport);
  180.                 }
  181.             }
  182.         }
  183.  
  184.         this.frameFinish();
  185.         this.waitForServerThread();
  186.         Lagometer.updateLagometer();
  187.  
  188.         if (this.mc.gameSettings.ofProfiler)
  189.         {
  190.             this.mc.gameSettings.showDebugProfilerChart = true;
  191.         }
  192.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement