From baf1e771e96a7683f4eb4afd857e04acb0edcec1 Mon Sep 17 00:00:00 2001 From: LexManos Date: Mon, 19 Aug 2013 10:45:29 -0700 Subject: [PATCH] Cache world on all render passes in case some mod disables the first pass. --- .../client/renderer/EntityRenderer.java.patch | 22 +++++++++++-------- .../client/renderer/RenderGlobal.java.patch | 10 ++++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index d80636f98..df979bdbd 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -95,21 +95,25 @@ GL11.glEnable(GL11.GL_ALPHA_TEST); } } -@@ -1222,6 +1233,13 @@ +@@ -1222,6 +1233,17 @@ renderglobal.sortAndRender(entitylivingbase, 1, (double)par1); } -+ RenderHelper.enableStandardItemLighting(); -+ this.mc.mcProfiler.endStartSection("entities"); -+ ForgeHooksClient.setRenderPass(1); -+ renderglobal.renderEntities(entitylivingbase.getPosition(par1), frustrum, par1); -+ ForgeHooksClient.setRenderPass(-1); -+ RenderHelper.disableStandardItemLighting(); ++ ++ if (this.debugViewDirection == 0) //Only render if render pass 0 happens as well. ++ { ++ RenderHelper.enableStandardItemLighting(); ++ this.mc.mcProfiler.endStartSection("entities"); ++ ForgeHooksClient.setRenderPass(1); ++ renderglobal.renderEntities(entitylivingbase.getPosition(par1), frustrum, par1); ++ ForgeHooksClient.setRenderPass(-1); ++ RenderHelper.disableStandardItemLighting(); ++ } + GL11.glDepthMask(true); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); -@@ -1231,14 +1249,17 @@ +@@ -1231,14 +1253,17 @@ entityplayer = (EntityPlayer)entitylivingbase; GL11.glDisable(GL11.GL_ALPHA_TEST); this.mc.mcProfiler.endStartSection("outline"); @@ -129,7 +133,7 @@ GL11.glDisable(GL11.GL_BLEND); this.mc.mcProfiler.endStartSection("weather"); this.renderRainSnow(par1); -@@ -1248,6 +1269,20 @@ +@@ -1248,6 +1273,20 @@ { this.renderCloudsCheck(renderglobal, par1); } diff --git a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch index 84493179c..04a7766d2 100644 --- a/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch @@ -10,7 +10,7 @@ @SideOnly(Side.CLIENT) public class RenderGlobal implements IWorldAccess { -@@ -447,35 +450,47 @@ +@@ -447,8 +450,13 @@ */ public void renderEntities(Vec3 par1Vec3, ICamera par2ICamera, float par3) { @@ -24,10 +24,10 @@ --this.renderEntitiesStartupCounter; } else - { +@@ -456,26 +464,33 @@ this.theWorld.theProfiler.startSection("prepare"); -- TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, par3); -- RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3); + TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, par3); + RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3); - this.countEntitiesTotal = 0; - this.countEntitiesRendered = 0; - this.countEntitiesHidden = 0; @@ -40,8 +40,6 @@ - TileEntityRenderer.staticPlayerZ = entitylivingbase.lastTickPosZ + (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * (double)par3; + if (pass == 0) + { -+ TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, par3); -+ RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.func_110434_K(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3); + this.countEntitiesTotal = 0; + this.countEntitiesRendered = 0; + this.countEntitiesHidden = 0;