Files
MinecraftForge/patches/minecraft/net/minecraft/client/renderer/RenderGlobal.java.patch
T
2016-07-24 11:44:21 -05:00

145 lines
7.2 KiB
Diff

--- ../src-base/minecraft/net/minecraft/client/renderer/RenderGlobal.java
+++ ../src-work/minecraft/net/minecraft/client/renderer/RenderGlobal.java
@@ -548,8 +548,10 @@
public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float p_180446_3_)
{
+ int pass = net.minecraftforge.client.MinecraftForgeClient.getRenderPass();
if (this.field_72740_G > 0)
{
+ if (pass > 0) return;
--this.field_72740_G;
}
else
@@ -560,9 +562,12 @@
this.field_72769_h.field_72984_F.func_76320_a("prepare");
TileEntityRendererDispatcher.field_147556_a.func_190056_a(this.field_72769_h, this.field_72777_q.func_110434_K(), this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_71476_x, p_180446_3_);
this.field_175010_j.func_180597_a(this.field_72769_h, this.field_72777_q.field_71466_p, this.field_72777_q.func_175606_aa(), this.field_72777_q.field_147125_j, this.field_72777_q.field_71474_y, p_180446_3_);
+ if(pass == 0)
+ {
this.field_72748_H = 0;
this.field_72749_I = 0;
this.field_72750_J = 0;
+ }
Entity entity = this.field_72777_q.func_175606_aa();
double d3 = entity.field_70142_S + (entity.field_70165_t - entity.field_70142_S) * (double)p_180446_3_;
double d4 = entity.field_70137_T + (entity.field_70163_u - entity.field_70137_T) * (double)p_180446_3_;
@@ -574,11 +579,15 @@
this.field_72777_q.field_71460_t.func_180436_i();
this.field_72769_h.field_72984_F.func_76318_c("global");
List<Entity> list = this.field_72769_h.func_72910_y();
+ if (pass == 0)
+ {
this.field_72748_H = list.size();
+ }
for (int i = 0; i < this.field_72769_h.field_73007_j.size(); ++i)
{
Entity entity1 = (Entity)this.field_72769_h.field_73007_j.get(i);
+ if (!entity1.shouldRenderInPass(pass)) continue;
++this.field_72749_I;
if (entity1.func_145770_h(d0, d1, d2))
@@ -601,6 +610,7 @@
{
for (Entity entity2 : classinheritancemultimap)
{
+ if(!entity2.shouldRenderInPass(pass)) continue;
boolean flag = this.field_175010_j.func_178635_a(entity2, p_180446_2_, d0, d1, d2) || entity2.func_184215_y(this.field_72777_q.field_71439_g);
if (flag)
@@ -637,6 +647,7 @@
}
}
+ if(pass == 0)
if (this.func_174985_d() && (!list1.isEmpty() || this.field_184386_ad))
{
this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
@@ -676,6 +687,7 @@
this.field_72769_h.field_72984_F.func_76318_c("blockentities");
RenderHelper.func_74519_b();
+ TileEntityRendererDispatcher.field_147556_a.preDrawBatch();
for (RenderGlobal.ContainerLocalRenderInformation renderglobal$containerlocalrenderinformation1 : this.field_72755_R)
{
List<TileEntity> list3 = renderglobal$containerlocalrenderinformation1.field_178036_a.func_178571_g().func_178485_b();
@@ -684,6 +696,7 @@
{
for (TileEntity tileentity2 : list3)
{
+ if (!tileentity2.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity2.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity2, p_180446_3_, -1);
}
}
@@ -693,9 +706,11 @@
{
for (TileEntity tileentity : this.field_181024_n)
{
+ if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_180446_3_, -1);
}
}
+ TileEntityRendererDispatcher.field_147556_a.drawBatch(pass);
this.func_180443_s();
@@ -722,7 +737,7 @@
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
- if (tileentity1 != null && (block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull))
+ if (tileentity1 != null && tileentity1.shouldRenderInPass(pass) && tileentity1.canRenderBreaking() && p_180446_2_.func_78546_a(tileentity1.getRenderBoundingBox()))
{
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_180446_3_, destroyblockprogress.func_73106_e());
}
@@ -1213,6 +1228,13 @@
public void func_174976_a(float p_174976_1_, int p_174976_2_)
{
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_174976_1_, field_72769_h, field_72777_q);
+ return;
+ }
+
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p().func_186068_a() == 1)
{
this.func_180448_r();
@@ -1430,6 +1452,12 @@
public void func_180447_b(float p_180447_1_, int p_180447_2_)
{
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72777_q.field_71441_e.field_73011_w.getCloudRenderer();
+ if (renderer != null)
+ {
+ renderer.render(p_180447_1_, this.field_72777_q.field_71441_e, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d())
{
if (this.field_72777_q.field_71474_y.func_181147_e() == 2)
@@ -1857,8 +1885,11 @@
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
+ boolean hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
- if (!(block instanceof BlockChest) && !(block instanceof BlockEnderChest) && !(block instanceof BlockSign) && !(block instanceof BlockSkull))
+ if (!hasBreak)
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{
@@ -2304,7 +2335,7 @@
if (block.func_176223_P().func_185904_a() != Material.field_151579_a)
{
- SoundType soundtype = block.func_185467_w();
+ SoundType soundtype = block.getSoundType(Block.func_176220_d(p_180439_4_), field_72769_h, p_180439_3_, null);
this.field_72769_h.func_184156_a(p_180439_3_, soundtype.func_185845_c(), SoundCategory.BLOCKS, (soundtype.func_185843_a() + 1.0F) / 2.0F, soundtype.func_185847_b() * 0.8F, false);
}