Cleanup RenderEntityItem patch, fixes Z-fighting issue in EntityItems. Closes #1824

This commit is contained in:
Lex Manos 2015-04-23 23:46:55 -07:00
parent 3f59b560d7
commit 591971936d

View file

@ -9,37 +9,22 @@
GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f2 + 0.25F, (float)p_177077_6_); GlStateManager.func_179109_b((float)p_177077_2_, (float)p_177077_4_ + f2 + 0.25F, (float)p_177077_6_);
float f3; float f3;
@@ -109,6 +109,9 @@ @@ -129,6 +129,14 @@
IBakedModel ibakedmodel = this.field_177080_a.func_175037_a().func_178089_a(itemstack);
int i = this.func_177077_a(p_177075_1_, p_177075_2_, p_177075_4_, p_177075_6_, p_177075_9_, ibakedmodel);
+ // Forge: Call to IItemRenderer, For now Its disabled.
+ //i = net.minecraftforge.client.ForgeHooksClient.renderEntityItem(p_177075_1_, itemstack, this.field_177079_e, this.renderManager.renderEngine, i);
+
for (int j = 0; j < i; ++j)
{
if (ibakedmodel.func_177556_c())
@@ -129,8 +132,19 @@
} }
else else
{ {
+ GlStateManager.func_179094_E();
+ // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... + // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug...
+ if (j > 0 && shouldSpreadItems()) + if (j > 0 && shouldSpreadItems())
+ { + {
+ float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f2 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ float f3 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f3 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ float f4 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F; + float f4 = (this.field_177079_e.nextFloat() * 2.0F - 1.0F) * 0.15F;
+ GlStateManager.func_179109_b(f2, f3, 0.046875F); + GlStateManager.func_179109_b(f2, f3, 0);
+ } + }
this.field_177080_a.func_180454_a(itemstack, ibakedmodel); this.field_177080_a.func_180454_a(itemstack, ibakedmodel);
+ if (!shouldSpreadItems())
GlStateManager.func_179109_b(0.0F, 0.0F, 0.046875F); GlStateManager.func_179109_b(0.0F, 0.0F, 0.046875F);
+ GlStateManager.func_179121_F();
} }
} @@ -161,4 +169,25 @@
@@ -161,4 +175,25 @@
{ {
this.func_177075_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); this.func_177075_a((EntityItem)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
} }