Created
December 11, 2015 07:57
-
-
Save killjoy1221/47aefe98ab1d5b71cc1c to your computer and use it in GitHub Desktop.
Fixes cloud transparency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -69,37 +69,49 @@ | |
- flag = block.func_149716_u() && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; | |
+ flag = block.hasTileEntity(this.field_78531_r.field_71441_e.func_180495_p(blockpos)) && this.field_78531_r.field_71441_e.func_175625_s(blockpos) instanceof IInventory; | |
} | |
else | |
{ | |
-@@ -1314,7 +1311,9 @@ | |
+@@ -1276,11 +1273,6 @@ | |
+ this.func_78468_a(0, p_175068_2_); | |
+ GlStateManager.func_179103_j(7425); | |
+ | |
+- if (entity.field_70163_u + (double)entity.func_70047_e() < 128.0D) | |
+- { | |
+- this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_); | |
+- } | |
+- | |
+ this.field_78531_r.field_71424_I.func_76318_c("prepareterrain"); | |
+ this.func_78468_a(0, p_175068_2_); | |
+ this.field_78531_r.func_110434_K().func_110577_a(TextureMap.field_110575_b); | |
+@@ -1314,7 +1306,9 @@ | |
GlStateManager.func_179094_E(); | |
RenderHelper.func_74519_b(); | |
this.field_78531_r.field_71424_I.func_76318_c("entities"); | |
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); | |
renderglobal.func_180446_a(entity, icamera, p_175068_2_); | |
+ net.minecraftforge.client.ForgeHooksClient.setRenderPass(0); | |
RenderHelper.func_74518_a(); | |
this.func_175072_h(); | |
GlStateManager.func_179128_n(5888); | |
-@@ -1326,6 +1325,7 @@ | |
+@@ -1326,6 +1320,7 @@ | |
EntityPlayer entityplayer = (EntityPlayer)entity; | |
GlStateManager.func_179118_c(); | |
this.field_78531_r.field_71424_I.func_76318_c("outline"); | |
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer, field_78531_r.field_71476_x, 0, entityplayer.func_70694_bm(), p_175068_2_)) | |
renderglobal.func_72731_b(entityplayer, this.field_78531_r.field_71476_x, 0, p_175068_2_); | |
GlStateManager.func_179141_d(); | |
} | |
-@@ -1339,6 +1339,7 @@ | |
+@@ -1339,6 +1334,7 @@ | |
EntityPlayer entityplayer1 = (EntityPlayer)entity; | |
GlStateManager.func_179118_c(); | |
this.field_78531_r.field_71424_I.func_76318_c("outline"); | |
+ if (!net.minecraftforge.client.ForgeHooksClient.onDrawBlockHighlight(renderglobal, entityplayer1, field_78531_r.field_71476_x, 0, entityplayer1.func_70694_bm(), p_175068_2_)) | |
renderglobal.func_72731_b(entityplayer1, this.field_78531_r.field_71476_x, 0, p_175068_2_); | |
GlStateManager.func_179141_d(); | |
} | |
-@@ -1380,6 +1381,15 @@ | |
+@@ -1380,20 +1376,33 @@ | |
GlStateManager.func_179103_j(7425); | |
this.field_78531_r.field_71424_I.func_76318_c("translucent"); | |
renderglobal.func_174977_a(EnumWorldBlockLayer.TRANSLUCENT, (double)p_175068_2_, p_175068_1_, entity); | |
+ if (!this.field_175078_W) //Only render if render pass 0 happens as well. | |
+ { | |
@@ -111,11 +123,17 @@ | |
+ RenderHelper.func_74518_a(); | |
+ } | |
GlStateManager.func_179103_j(7424); | |
GlStateManager.func_179132_a(true); | |
GlStateManager.func_179089_o(); | |
-@@ -1392,8 +1402,12 @@ | |
+ GlStateManager.func_179084_k(); | |
+ GlStateManager.func_179106_n(); | |
+ | |
+- if (entity.field_70163_u + (double)entity.func_70047_e() >= 128.0D) | |
++ // Forge: Fix cloud rendering | |
+ { | |
+ this.field_78531_r.field_71424_I.func_76318_c("aboveClouds"); | |
this.func_180437_a(renderglobal, p_175068_2_, p_175068_1_); | |
} | |
+ this.field_78531_r.field_71424_I.func_76318_c("forge_render_last"); | |
+ net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(renderglobal, p_175068_2_); | |
@@ -124,11 +142,11 @@ | |
+ if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(renderglobal, p_175068_2_, p_175068_1_)) | |
if (this.field_175074_C) | |
{ | |
GlStateManager.func_179086_m(256); | |
-@@ -1505,6 +1519,13 @@ | |
+@@ -1505,6 +1514,13 @@ | |
protected void func_78474_d(float p_78474_1_) | |
{ | |
+ net.minecraftforge.client.IRenderHandler renderer = this.field_78531_r.field_71441_e.field_73011_w.getWeatherRenderer(); | |
+ if (renderer != null) | |
@@ -138,11 +156,11 @@ | |
+ } | |
+ | |
float f = this.field_78531_r.field_71441_e.func_72867_j(p_78474_1_); | |
if (f > 0.0F) | |
-@@ -1830,6 +1851,13 @@ | |
+@@ -1830,6 +1846,13 @@ | |
this.field_175081_S = f7; | |
} | |
+ net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(this, entity, block, p_78466_1_, this.field_175080_Q, this.field_175082_R, this.field_175081_S); | |
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event); | |
@@ -152,22 +170,22 @@ | |
+ this.field_175081_S = event.blue; | |
+ | |
GlStateManager.func_179082_a(this.field_175080_Q, this.field_175082_R, this.field_175081_S, 0.0F); | |
} | |
-@@ -1848,6 +1876,10 @@ | |
+@@ -1848,6 +1871,10 @@ | |
GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); | |
Block block = ActiveRenderInfo.func_180786_a(this.field_78531_r.field_71441_e, entity, p_78468_2_); | |
+ float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(this, entity, block, p_78468_2_, 0.1F); | |
+ if (hook >= 0) | |
+ GlStateManager.func_179095_a(hook); | |
+ else | |
if (entity instanceof EntityLivingBase && ((EntityLivingBase)entity).func_70644_a(Potion.field_76440_q)) | |
{ | |
float f1 = 5.0F; | |
-@@ -1925,6 +1957,7 @@ | |
+@@ -1925,6 +1952,7 @@ | |
GlStateManager.func_179102_b(f * 0.05F); | |
GlStateManager.func_179153_c(Math.min(f, 192.0F) * 0.5F); | |
} | |
+ net.minecraftforge.client.ForgeHooksClient.onFogRender(this, entity, block, p_78468_2_, p_78468_1_, f); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment