Files
MinecraftForge/patches/minecraft/net/minecraft/client/renderer/WorldRenderer.java.patch
T
2019-06-24 19:01:03 -07:00

126 lines
7.5 KiB
Diff

--- a/net/minecraft/client/renderer/WorldRenderer.java
+++ b/net/minecraft/client/renderer/WorldRenderer.java
@@ -589,10 +589,12 @@
this.field_72769_h.func_217381_Z().func_219895_b("blockentities");
RenderHelper.func_74519_b();
+ TileEntityRendererDispatcher.field_147556_a.preDrawBatch();
for(WorldRenderer.LocalRenderInformationContainer worldrenderer$localrenderinformationcontainer : this.field_72755_R) {
List<TileEntity> list2 = worldrenderer$localrenderinformationcontainer.field_178036_a.func_178571_g().func_178485_b();
if (!list2.isEmpty()) {
for(TileEntity tileentity : list2) {
+ if (!p_215326_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, p_215326_3_, -1);
}
}
@@ -600,16 +602,18 @@
synchronized(this.field_181024_n) {
for(TileEntity tileentity1 : this.field_181024_n) {
+ if (!p_215326_2_.func_78546_a(tileentity1.getRenderBoundingBox())) continue;
TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity1, p_215326_3_, -1);
}
}
+ TileEntityRendererDispatcher.field_147556_a.drawBatch();
this.func_180443_s();
for(DestroyBlockProgress destroyblockprogress : this.field_72738_E.values()) {
BlockPos blockpos = destroyblockprogress.func_180246_b();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
- if (blockstate.func_177230_c().func_149716_u()) {
+ if (blockstate.hasTileEntity()) {
TileEntity tileentity2 = this.field_72769_h.func_175625_s(blockpos);
if (tileentity2 instanceof ChestTileEntity && blockstate.func_177229_b(ChestBlock.field_196314_b) == ChestType.LEFT) {
blockpos = blockpos.func_177972_a(blockstate.func_177229_b(ChestBlock.field_176459_a).func_176746_e());
@@ -730,7 +734,7 @@
for(int j = -this.field_72739_F; j <= this.field_72739_F; ++j) {
for(int k = -this.field_72739_F; k <= this.field_72739_F; ++k) {
ChunkRender chunkrender1 = this.field_175008_n.func_178161_a(new BlockPos((j << 4) + 8, i, (k << 4) + 8));
- if (chunkrender1 != null && p_215320_2_.func_78546_a(chunkrender1.field_178591_c)) {
+ if (chunkrender1 != null && p_215320_2_.func_78546_a(chunkrender1.field_178591_c.func_72321_a(0.0, blockpos1.func_177956_o() > 0 ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY, 0.0))) { // Forge: fix MC-73139
chunkrender1.func_178577_a(p_215320_3_);
queue.add(new WorldRenderer.LocalRenderInformationContainer(chunkrender1, (Direction)null, 0));
}
@@ -775,7 +779,7 @@
this.field_147595_R = true;
BlockPos blockpos2 = chunkrender4.func_178568_j().func_177982_a(8, 8, 8);
boolean flag3 = blockpos2.func_177951_i(blockpos1) < 768.0D;
- if (!chunkrender4.func_188281_o() && !flag3) {
+ if (net.minecraftforge.common.ForgeMod.alwaysSetupTerrainOffThread || !chunkrender4.func_188281_o() && !flag3) {
this.field_175009_l.add(chunkrender4);
} else {
this.field_72777_q.func_213239_aq().func_76320_a("build near");
@@ -969,6 +973,11 @@
}
public void func_195465_a(float p_195465_1_) {
+ net.minecraftforge.client.IRenderHandler renderer = this.field_72769_h.func_201675_m().getSkyRenderer();
+ if (renderer != null) {
+ renderer.render(p_195465_1_, field_72769_h, field_72777_q);
+ return;
+ }
if (this.field_72777_q.field_71441_e.field_73011_w.func_186058_p() == DimensionType.field_223229_c_) {
this.func_180448_r();
} else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
@@ -1113,6 +1122,7 @@
}
public void func_195466_a(float p_195466_1_, double p_195466_2_, double p_195466_4_, double p_195466_6_) {
+// if (net.minecraftforge.client.CloudRenderer.renderClouds(this.ticks, partialTicks, this.world, mc)) return;
if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
float f = 12.0F;
float f1 = 4.0F;
@@ -1488,7 +1498,11 @@
DestroyBlockProgress destroyblockprogress = iterator.next();
BlockPos blockpos = destroyblockprogress.func_180246_b();
Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
- if (!(block instanceof ChestBlock) && !(block instanceof EnderChestBlock) && !(block instanceof AbstractSignBlock) && !(block instanceof AbstractSkullBlock)) {
+ TileEntity te = this.field_72769_h.func_175625_s(blockpos);
+ boolean hasBreak = block instanceof ChestBlock || block instanceof EnderChestBlock || block instanceof AbstractSignBlock || block instanceof AbstractSkullBlock;
+ if (!hasBreak) hasBreak = te != null && te.canRenderBreaking();
+
+ if (!hasBreak) {
double d3 = (double)blockpos.func_177958_n() - d0;
double d4 = (double)blockpos.func_177956_o() - d1;
double d5 = (double)blockpos.func_177952_p() - d2;
@@ -1496,7 +1510,7 @@
iterator.remove();
} else {
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
- if (!blockstate.func_196958_f()) {
+ if (!blockstate.isAir(this.field_72769_h, blockpos)) {
int i = destroyblockprogress.func_73106_e();
TextureAtlasSprite textureatlassprite = this.field_94141_F[i];
BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab();
@@ -1517,7 +1531,7 @@
if (p_215325_3_ == 0 && p_215325_2_.func_216346_c() == RayTraceResult.Type.BLOCK) {
BlockPos blockpos = ((BlockRayTraceResult)p_215325_2_).func_216350_a();
BlockState blockstate = this.field_72769_h.func_180495_p(blockpos);
- if (!blockstate.func_196958_f() && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
+ if (!blockstate.isAir(this.field_72769_h, blockpos) && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
GlStateManager.enableBlend();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.lineWidth(Math.max(2.5F, (float)this.field_72777_q.field_195558_d.func_198109_k() / 1920.0F * 2.5F));
@@ -1984,7 +1998,7 @@
break;
case 2001:
BlockState blockstate = Block.func_196257_b(p_180439_4_);
- if (!blockstate.func_196958_f()) {
+ if (!blockstate.isAir(this.field_72769_h, p_180439_3_)) {
SoundType soundtype = blockstate.func_215695_r();
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);
}
@@ -2108,6 +2122,11 @@
}
}
+ @Override
+ public net.minecraftforge.resource.IResourceType getResourceType() {
+ return net.minecraftforge.resource.VanillaResourceType.MODELS;
+ }
+
@OnlyIn(Dist.CLIENT)
class LocalRenderInformationContainer {
private final ChunkRender field_178036_a;