<commit_before>--- ../src_base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -62,6 +62,9 @@
 import org.lwjgl.opengl.ARBOcclusionQuery;
 import org.lwjgl.opengl.GL11;
 
+import net.minecraftforge.client.IRenderHandler;
+import net.minecraftforge.client.MinecraftForgeClient;
+
 @SideOnly(Side.CLIENT)
 public class RenderGlobal implements IWorldAccess
 {
@@ -439,62 +442,72 @@
      */
     public void renderEntities(Vec3 par1Vec3, ICamera par2ICamera, float par3)
     {
+        int pass = MinecraftForgeClient.getRenderPass();
         if (this.renderEntitiesStartupCounter > 0)
         {
+            if(pass > 0)
+                return;
+
             --this.renderEntitiesStartupCounter;
         }
         else
         {
-            this.theWorld.theProfiler.startSection("prepare");
-            TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
-            RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.gameSettings, par3);
-            this.countEntitiesTotal = 0;
-            this.countEntitiesRendered = 0;
-            this.countEntitiesHidden = 0;
-            EntityLiving var4 = this.mc.renderViewEntity;
-            RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
-            RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
-            RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
-            TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
-            TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
-            TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
+            List var5 = this.theWorld.getLoadedEntityList();
+            if(pass == 0)
+            {
+                this.theWorld.theProfiler.startSection("prepare");
+                TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
+                RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.gameSettings, par3);
+                this.countEntitiesTotal = 0;
+                this.countEntitiesRendered = 0;
+                this.countEntitiesHidden = 0;
+                EntityLiving var4 = this.mc.renderViewEntity;
+                RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
+                RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
+                RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
+                TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
+                TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
+                TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
+                this.countEntitiesTotal = var5.size();
+            }
             this.mc.entityRenderer.enableLightmap((double)par3);
             this.theWorld.theProfiler.endStartSection("global");
-            List var5 = this.theWorld.getLoadedEntityList();
-            this.countEntitiesTotal = var5.size();
             int var6;
             Entity var7;
 <commit_msg>Fix profiler issue with RenderGlobal patch. Closes #414<commit_after>--- ../src_base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src_work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -62,6 +62,9 @@
 import org.lwjgl.opengl.ARBOcclusionQuery;
 import org.lwjgl.opengl.GL11;
 
+import net.minecraftforge.client.IRenderHandler;
+import net.minecraftforge.client.MinecraftForgeClient;
+
 @SideOnly(Side.CLIENT)
 public class RenderGlobal implements IWorldAccess
 {
@@ -439,62 +442,72 @@
      */
     public void renderEntities(Vec3 par1Vec3, ICamera par2ICamera, float par3)
     {
+        int pass = MinecraftForgeClient.getRenderPass();
         if (this.renderEntitiesStartupCounter > 0)
         {
+            if(pass > 0)
+                return;
+
             --this.renderEntitiesStartupCounter;
         }
         else
         {
             this.theWorld.theProfiler.startSection("prepare");
-            TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
-            RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.gameSettings, par3);
-            this.countEntitiesTotal = 0;
-            this.countEntitiesRendered = 0;
-            this.countEntitiesHidden = 0;
-            EntityLiving var4 = this.mc.renderViewEntity;
-            RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
-            RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
-            RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
-            TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
-            TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
-            TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
+            List var5 = this.theWorld.getLoadedEntityList();
+            if(pass == 0)
+            {
+                TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, par3);
+                RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.renderEngine, this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.gameSettings, par3);
+                this.countEntitiesTotal = 0;
+                this.countEntitiesRendered = 0;
+                this.countEntitiesHidden = 0;
+                EntityLiving var4 = this.mc.renderViewEntity;
+                RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
+                RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
+                RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
+                TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3;
+                TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3;
+                TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3;
+                this.countEntitiesTotal = var5.size();
+            }
             this.mc.entityRenderer.enableLightmap((double)par3);
             this.theWorld.theProfiler.endStartSection("global");
-            List var5 = this.theWorld.getLoadedEntityList();
-            this.countEntitiesTotal = var5.size();
             int var6;
             Entity var7;
 
{'fraction_non_alphanumeric': 0.11496350364963503, 'fraction_numerical': 0.024635036496350366, 'mean_word_length': 2.687169629985584, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2498582', 'n_tokens_mistral': 2475, 'n_tokens_neox': 2422, 'n_words': 326}