CrushedPixel

With Optifine

Nov 8th, 2016
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 111.30 KB | None | 0 0
  1. /*
  2.  * Decompiled with CFR 0_118.
  3.  *
  4.  * Could not load the following classes:
  5.  *  com.google.common.collect.Lists
  6.  *  com.google.common.collect.Maps
  7.  *  com.google.common.collect.Sets
  8.  *  javax.vecmath.Matrix4f
  9.  *  javax.vecmath.Tuple4f
  10.  *  javax.vecmath.Vector3d
  11.  *  javax.vecmath.Vector3f
  12.  *  javax.vecmath.Vector4f
  13.  *  net.minecraft.client.renderer.DestroyBlockProgress
  14.  *  net.minecraft.client.renderer.RenderGlobal$SwitchEnumUsage
  15.  *  net.minecraft.client.renderer.chunk.VboChunkFactory
  16.  *  net.minecraftforge.client.IRenderHandler
  17.  *  net.minecraftforge.fml.relauncher.Side
  18.  *  net.minecraftforge.fml.relauncher.SideOnly
  19.  *  org.apache.logging.log4j.LogManager
  20.  *  org.apache.logging.log4j.Logger
  21.  *  org.lwjgl.opengl.GL11
  22.  *  org.spongepowered.asm.mixin.injection.callback.CallbackInfo
  23.  *  org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
  24.  *  org.spongepowered.asm.mixin.transformer.meta.MixinMerged
  25.  */
  26. package net.minecraft.client.renderer;
  27.  
  28. import com.google.common.collect.Lists;
  29. import com.google.common.collect.Maps;
  30. import com.google.common.collect.Sets;
  31. import com.google.gson.JsonSyntaxException;
  32. import com.replaymod.compat.shaders.ShaderReflection;
  33. import com.replaymod.recording.handler.RecordingEventHandler;
  34. import com.replaymod.render.hooks.ChunkLoadingRenderGlobal;
  35. import java.io.IOException;
  36. import java.lang.reflect.Field;
  37. import java.nio.ByteBuffer;
  38. import java.util.Collection;
  39. import java.util.EnumSet;
  40. import java.util.Iterator;
  41. import java.util.LinkedList;
  42. import java.util.List;
  43. import java.util.Map;
  44. import java.util.Random;
  45. import java.util.Set;
  46. import java.util.concurrent.BlockingQueue;
  47. import java.util.concurrent.Callable;
  48. import javax.vecmath.Matrix4f;
  49. import javax.vecmath.Tuple4f;
  50. import javax.vecmath.Vector3d;
  51. import javax.vecmath.Vector3f;
  52. import javax.vecmath.Vector4f;
  53. import net.minecraft.block.Block;
  54. import net.minecraft.block.BlockChest;
  55. import net.minecraft.block.BlockEnderChest;
  56. import net.minecraft.block.BlockLeaves;
  57. import net.minecraft.block.BlockSign;
  58. import net.minecraft.block.BlockSkull;
  59. import net.minecraft.block.material.Material;
  60. import net.minecraft.block.state.IBlockState;
  61. import net.minecraft.client.Minecraft;
  62. import net.minecraft.client.audio.ISound;
  63. import net.minecraft.client.audio.PositionedSoundRecord;
  64. import net.minecraft.client.audio.SoundHandler;
  65. import net.minecraft.client.entity.EntityPlayerSP;
  66. import net.minecraft.client.gui.FontRenderer;
  67. import net.minecraft.client.gui.GuiIngame;
  68. import net.minecraft.client.multiplayer.WorldClient;
  69. import net.minecraft.client.particle.EffectRenderer;
  70. import net.minecraft.client.particle.EntityFX;
  71. import net.minecraft.client.renderer.BlockRendererDispatcher;
  72. import net.minecraft.client.renderer.ChunkRenderContainer;
  73. import net.minecraft.client.renderer.DestroyBlockProgress;
  74. import net.minecraft.client.renderer.EntityRenderer;
  75. import net.minecraft.client.renderer.GLAllocation;
  76. import net.minecraft.client.renderer.GlStateManager;
  77. import net.minecraft.client.renderer.OpenGlHelper;
  78. import net.minecraft.client.renderer.RenderGlobal;
  79. import net.minecraft.client.renderer.RenderHelper;
  80. import net.minecraft.client.renderer.RenderList;
  81. import net.minecraft.client.renderer.Tessellator;
  82. import net.minecraft.client.renderer.VboRenderList;
  83. import net.minecraft.client.renderer.ViewFrustum;
  84. import net.minecraft.client.renderer.WorldRenderer;
  85. import net.minecraft.client.renderer.chunk.ChunkCompileTaskGenerator;
  86. import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher;
  87. import net.minecraft.client.renderer.chunk.CompiledChunk;
  88. import net.minecraft.client.renderer.chunk.IRenderChunkFactory;
  89. import net.minecraft.client.renderer.chunk.ListChunkFactory;
  90. import net.minecraft.client.renderer.chunk.RenderChunk;
  91. import net.minecraft.client.renderer.chunk.VboChunkFactory;
  92. import net.minecraft.client.renderer.chunk.VisGraph;
  93. import net.minecraft.client.renderer.culling.ClippingHelper;
  94. import net.minecraft.client.renderer.culling.ClippingHelperImpl;
  95. import net.minecraft.client.renderer.culling.Frustum;
  96. import net.minecraft.client.renderer.culling.ICamera;
  97. import net.minecraft.client.renderer.entity.RenderManager;
  98. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  99. import net.minecraft.client.renderer.texture.TextureManager;
  100. import net.minecraft.client.renderer.texture.TextureMap;
  101. import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
  102. import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
  103. import net.minecraft.client.renderer.vertex.VertexBuffer;
  104. import net.minecraft.client.renderer.vertex.VertexFormat;
  105. import net.minecraft.client.renderer.vertex.VertexFormatElement;
  106. import net.minecraft.client.resources.IResourceManager;
  107. import net.minecraft.client.resources.IResourceManagerReloadListener;
  108. import net.minecraft.client.settings.GameSettings;
  109. import net.minecraft.client.settings.KeyBinding;
  110. import net.minecraft.client.shader.Framebuffer;
  111. import net.minecraft.client.shader.ShaderGroup;
  112. import net.minecraft.client.shader.ShaderLinkHelper;
  113. import net.minecraft.crash.CrashReport;
  114. import net.minecraft.crash.CrashReportCategory;
  115. import net.minecraft.entity.Entity;
  116. import net.minecraft.entity.EntityLivingBase;
  117. import net.minecraft.entity.player.EntityPlayer;
  118. import net.minecraft.entity.projectile.EntityWitherSkull;
  119. import net.minecraft.init.Blocks;
  120. import net.minecraft.init.Items;
  121. import net.minecraft.item.Item;
  122. import net.minecraft.item.ItemDye;
  123. import net.minecraft.item.ItemPotion;
  124. import net.minecraft.item.ItemRecord;
  125. import net.minecraft.profiler.Profiler;
  126. import net.minecraft.tileentity.TileEntity;
  127. import net.minecraft.tileentity.TileEntityChest;
  128. import net.minecraft.util.AxisAlignedBB;
  129. import net.minecraft.util.BlockPos;
  130. import net.minecraft.util.BlockPos$MutableBlockPos;
  131. import net.minecraft.util.ClassInheritanceMultiMap;
  132. import net.minecraft.util.EnumFacing;
  133. import net.minecraft.util.EnumParticleTypes;
  134. import net.minecraft.util.EnumWorldBlockLayer;
  135. import net.minecraft.util.MathHelper;
  136. import net.minecraft.util.MovingObjectPosition;
  137. import net.minecraft.util.ReportedException;
  138. import net.minecraft.util.ResourceLocation;
  139. import net.minecraft.util.Vec3;
  140. import net.minecraft.world.IBlockAccess;
  141. import net.minecraft.world.IWorldAccess;
  142. import net.minecraft.world.World;
  143. import net.minecraft.world.WorldProvider;
  144. import net.minecraft.world.border.EnumBorderStatus;
  145. import net.minecraft.world.border.WorldBorder;
  146. import net.minecraft.world.chunk.Chunk;
  147. import net.minecraftforge.client.IRenderHandler;
  148. import net.minecraftforge.client.MinecraftForgeClient;
  149. import net.minecraftforge.fml.relauncher.Side;
  150. import net.minecraftforge.fml.relauncher.SideOnly;
  151. import org.apache.logging.log4j.LogManager;
  152. import org.apache.logging.log4j.Logger;
  153. import org.lwjgl.opengl.GL11;
  154. import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
  155. import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
  156. import org.spongepowered.asm.mixin.transformer.meta.MixinMerged;
  157.  
  158. @SideOnly(value=Side.CLIENT)
  159. public class RenderGlobal
  160. implements IWorldAccess,
  161. IResourceManagerReloadListener,
  162. RecordingEventHandler.RecordingEventSender {
  163.     private static final Logger field_147599_m = LogManager.getLogger();
  164.     private static final ResourceLocation field_110927_h = new ResourceLocation("textures/environment/moon_phases.png");
  165.     private static final ResourceLocation field_110928_i = new ResourceLocation("textures/environment/sun.png");
  166.     private static final ResourceLocation field_110925_j = new ResourceLocation("textures/environment/clouds.png");
  167.     private static final ResourceLocation field_110926_k = new ResourceLocation("textures/environment/end_sky.png");
  168.     private static final ResourceLocation field_175006_g = new ResourceLocation("textures/misc/forcefield.png");
  169.     private final Minecraft field_72777_q;
  170.     private final TextureManager field_72770_i;
  171.     private final RenderManager field_175010_j;
  172.     private WorldClient field_72769_h;
  173.     public Set field_175009_l = Sets.newLinkedHashSet();
  174.     public List field_72755_R = Lists.newArrayListWithCapacity((int)69696);
  175.     private ViewFrustum field_175008_n;
  176.     private int field_72772_v = -1;
  177.     private int field_72771_w = -1;
  178.     private int field_72781_x = -1;
  179.     private VertexFormat field_175014_r;
  180.     private VertexBuffer field_175013_s;
  181.     private VertexBuffer field_175012_t;
  182.     private VertexBuffer field_175011_u;
  183.     private int field_72773_u;
  184.     private final Map field_72738_E = Maps.newHashMap();
  185.     private final Map field_147593_P = Maps.newHashMap();
  186.     private final TextureAtlasSprite[] field_94141_F = new TextureAtlasSprite[10];
  187.     private Framebuffer field_175015_z;
  188.     private ShaderGroup field_174991_A;
  189.     private double field_174992_B = Double.MIN_VALUE;
  190.     private double field_174993_C = Double.MIN_VALUE;
  191.     private double field_174987_D = Double.MIN_VALUE;
  192.     private int field_174988_E = Integer.MIN_VALUE;
  193.     private int field_174989_F = Integer.MIN_VALUE;
  194.     private int field_174990_G = Integer.MIN_VALUE;
  195.     private double field_174997_H = Double.MIN_VALUE;
  196.     private double field_174998_I = Double.MIN_VALUE;
  197.     private double field_174999_J = Double.MIN_VALUE;
  198.     private double field_175000_K = Double.MIN_VALUE;
  199.     private double field_174994_L = Double.MIN_VALUE;
  200.     public final ChunkRenderDispatcher field_174995_M = new ChunkRenderDispatcher();
  201.     private ChunkRenderContainer field_174996_N;
  202.     private int field_72739_F = -1;
  203.     public int field_72740_G = 2;
  204.     private int field_72748_H;
  205.     private int field_72749_I;
  206.     private int field_72750_J;
  207.     private boolean field_175002_T = false;
  208.     private ClippingHelper field_175001_U;
  209.     private final Vector4f[] field_175004_V = new Vector4f[8];
  210.     private final Vector3d field_175003_W = new Vector3d();
  211.     private boolean field_175005_X = false;
  212.     IRenderChunkFactory field_175007_a;
  213.     private double field_147596_f;
  214.     private double field_147597_g;
  215.     private double field_147602_h;
  216.     public boolean field_147595_R = true;
  217.     private static final String __OBFID = "CL_00000954";
  218.     private RecordingEventHandler recordingEventHandler;
  219.     public ChunkLoadingRenderGlobal replayModRender_hook;
  220.     private boolean replayModRender_passThroughSetupTerrain;
  221.  
  222.     public RenderGlobal(Minecraft mcIn) {
  223.         this.field_72777_q = mcIn;
  224.         this.field_175010_j = mcIn.func_175598_ae();
  225.         this.field_72770_i = mcIn.func_110434_K();
  226.         this.field_72770_i.func_110577_a(field_175006_g);
  227.         GL11.glTexParameteri((int)3553, (int)10242, (int)10497);
  228.         GL11.glTexParameteri((int)3553, (int)10243, (int)10497);
  229.         GlStateManager.func_179144_i(0);
  230.         this.func_174971_n();
  231.         this.field_175005_X = OpenGlHelper.func_176075_f();
  232.         if (this.field_175005_X) {
  233.             this.field_174996_N = new VboRenderList();
  234.             this.field_175007_a = new VboChunkFactory();
  235.         } else {
  236.             this.field_174996_N = new RenderList();
  237.             this.field_175007_a = new ListChunkFactory();
  238.         }
  239.         this.field_175014_r = new VertexFormat();
  240.         this.field_175014_r.func_177349_a(new VertexFormatElement(0, VertexFormatElement.EnumType.FLOAT, VertexFormatElement.EnumUsage.POSITION, 3));
  241.         this.func_174963_q();
  242.         this.func_174980_p();
  243.         this.func_174964_o();
  244.     }
  245.  
  246.     @Override
  247.     public void func_110549_a(IResourceManager resourceManager) {
  248.         this.func_174971_n();
  249.     }
  250.  
  251.     private void func_174971_n() {
  252.         TextureMap texturemap = this.field_72777_q.func_147117_R();
  253.         for (int i = 0; i < this.field_94141_F.length; ++i) {
  254.             this.field_94141_F[i] = texturemap.func_110572_b("minecraft:blocks/destroy_stage_" + i);
  255.         }
  256.     }
  257.  
  258.     public void func_174966_b() {
  259.         if (OpenGlHelper.field_148824_g) {
  260.             if (ShaderLinkHelper.func_148074_b() == null) {
  261.                 ShaderLinkHelper.func_148076_a();
  262.             }
  263.             ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json");
  264.             try {
  265.                 this.field_174991_A = new ShaderGroup(this.field_72777_q.func_110434_K(), this.field_72777_q.func_110442_L(), this.field_72777_q.func_147110_a(), resourcelocation);
  266.                 this.field_174991_A.func_148026_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d);
  267.                 this.field_175015_z = this.field_174991_A.func_177066_a("final");
  268.             }
  269.             catch (IOException ioexception) {
  270.                 field_147599_m.warn("Failed to load shader: " + resourcelocation, (Throwable)ioexception);
  271.                 this.field_174991_A = null;
  272.                 this.field_175015_z = null;
  273.             }
  274.             catch (JsonSyntaxException jsonsyntaxexception) {
  275.                 field_147599_m.warn("Failed to load shader: " + resourcelocation, (Throwable)jsonsyntaxexception);
  276.                 this.field_174991_A = null;
  277.                 this.field_175015_z = null;
  278.             }
  279.         } else {
  280.             this.field_174991_A = null;
  281.             this.field_175015_z = null;
  282.         }
  283.     }
  284.  
  285.     public void func_174975_c() {
  286.         if (this.func_174985_d()) {
  287.             GlStateManager.func_179147_l();
  288.             GlStateManager.func_179120_a(770, 771, 0, 1);
  289.             this.field_175015_z.func_178038_a(this.field_72777_q.field_71443_c, this.field_72777_q.field_71440_d, false);
  290.             GlStateManager.func_179084_k();
  291.         }
  292.     }
  293.  
  294.     protected boolean func_174985_d() {
  295.         return this.field_175015_z != null && this.field_174991_A != null && this.field_72777_q.field_71439_g != null && this.field_72777_q.field_71439_g.func_175149_v() && this.field_72777_q.field_71474_y.field_178883_an.func_151470_d();
  296.     }
  297.  
  298.     private void func_174964_o() {
  299.         Tessellator tessellator = Tessellator.func_178181_a();
  300.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  301.         if (this.field_175011_u != null) {
  302.             this.field_175011_u.func_177362_c();
  303.         }
  304.         if (this.field_72781_x >= 0) {
  305.             GLAllocation.func_74523_b(this.field_72781_x);
  306.             this.field_72781_x = -1;
  307.         }
  308.         if (this.field_175005_X) {
  309.             this.field_175011_u = new VertexBuffer(this.field_175014_r);
  310.             this.func_174968_a(worldrenderer, -16.0f, true);
  311.             worldrenderer.func_178977_d();
  312.             worldrenderer.func_178965_a();
  313.             this.field_175011_u.func_177360_a(worldrenderer.func_178966_f(), worldrenderer.func_178976_e());
  314.         } else {
  315.             this.field_72781_x = GLAllocation.func_74526_a(1);
  316.             GL11.glNewList((int)this.field_72781_x, (int)4864);
  317.             this.func_174968_a(worldrenderer, -16.0f, true);
  318.             tessellator.func_78381_a();
  319.             GL11.glEndList();
  320.         }
  321.     }
  322.  
  323.     private void func_174980_p() {
  324.         Tessellator tessellator = Tessellator.func_178181_a();
  325.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  326.         if (this.field_175012_t != null) {
  327.             this.field_175012_t.func_177362_c();
  328.         }
  329.         if (this.field_72771_w >= 0) {
  330.             GLAllocation.func_74523_b(this.field_72771_w);
  331.             this.field_72771_w = -1;
  332.         }
  333.         if (this.field_175005_X) {
  334.             this.field_175012_t = new VertexBuffer(this.field_175014_r);
  335.             this.func_174968_a(worldrenderer, 16.0f, false);
  336.             worldrenderer.func_178977_d();
  337.             worldrenderer.func_178965_a();
  338.             this.field_175012_t.func_177360_a(worldrenderer.func_178966_f(), worldrenderer.func_178976_e());
  339.         } else {
  340.             this.field_72771_w = GLAllocation.func_74526_a(1);
  341.             GL11.glNewList((int)this.field_72771_w, (int)4864);
  342.             this.func_174968_a(worldrenderer, 16.0f, false);
  343.             tessellator.func_78381_a();
  344.             GL11.glEndList();
  345.         }
  346.     }
  347.  
  348.     private void func_174968_a(WorldRenderer worldRendererIn, float p_174968_2_, boolean p_174968_3_) {
  349.         boolean flag1 = true;
  350.         boolean flag2 = true;
  351.         worldRendererIn.func_178970_b();
  352.         for (int i = -384; i <= 384; i += 64) {
  353.             for (int j = -384; j <= 384; j += 64) {
  354.                 float f1 = i;
  355.                 float f2 = i + 64;
  356.                 if (p_174968_3_) {
  357.                     f2 = i;
  358.                     f1 = i + 64;
  359.                 }
  360.                 worldRendererIn.func_178984_b(f1, p_174968_2_, j);
  361.                 worldRendererIn.func_178984_b(f2, p_174968_2_, j);
  362.                 worldRendererIn.func_178984_b(f2, p_174968_2_, j + 64);
  363.                 worldRendererIn.func_178984_b(f1, p_174968_2_, j + 64);
  364.             }
  365.         }
  366.     }
  367.  
  368.     private void func_174963_q() {
  369.         Tessellator tessellator = Tessellator.func_178181_a();
  370.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  371.         if (this.field_175013_s != null) {
  372.             this.field_175013_s.func_177362_c();
  373.         }
  374.         if (this.field_72772_v >= 0) {
  375.             GLAllocation.func_74523_b(this.field_72772_v);
  376.             this.field_72772_v = -1;
  377.         }
  378.         if (this.field_175005_X) {
  379.             this.field_175013_s = new VertexBuffer(this.field_175014_r);
  380.             this.func_180444_a(worldrenderer);
  381.             worldrenderer.func_178977_d();
  382.             worldrenderer.func_178965_a();
  383.             this.field_175013_s.func_177360_a(worldrenderer.func_178966_f(), worldrenderer.func_178976_e());
  384.         } else {
  385.             this.field_72772_v = GLAllocation.func_74526_a(1);
  386.             GlStateManager.func_179094_E();
  387.             GL11.glNewList((int)this.field_72772_v, (int)4864);
  388.             this.func_180444_a(worldrenderer);
  389.             tessellator.func_78381_a();
  390.             GL11.glEndList();
  391.             GlStateManager.func_179121_F();
  392.         }
  393.     }
  394.  
  395.     private void func_180444_a(WorldRenderer worldRendererIn) {
  396.         Random random = new Random(10842);
  397.         worldRendererIn.func_178970_b();
  398.         for (int i = 0; i < 1500; ++i) {
  399.             double d0 = random.nextFloat() * 2.0f - 1.0f;
  400.             double d1 = random.nextFloat() * 2.0f - 1.0f;
  401.             double d2 = random.nextFloat() * 2.0f - 1.0f;
  402.             double d3 = 0.15f + random.nextFloat() * 0.1f;
  403.             double d4 = d0 * d0 + d1 * d1 + d2 * d2;
  404.             if (d4 >= 1.0 || d4 <= 0.01) continue;
  405.             d4 = 1.0 / Math.sqrt(d4);
  406.             double d5 = (d0 *= d4) * 100.0;
  407.             double d6 = (d1 *= d4) * 100.0;
  408.             double d7 = (d2 *= d4) * 100.0;
  409.             double d8 = Math.atan2(d0, d2);
  410.             double d9 = Math.sin(d8);
  411.             double d10 = Math.cos(d8);
  412.             double d11 = Math.atan2(Math.sqrt(d0 * d0 + d2 * d2), d1);
  413.             double d12 = Math.sin(d11);
  414.             double d13 = Math.cos(d11);
  415.             double d14 = random.nextDouble() * 3.141592653589793 * 2.0;
  416.             double d15 = Math.sin(d14);
  417.             double d16 = Math.cos(d14);
  418.             for (int j = 0; j < 4; ++j) {
  419.                 double d17 = 0.0;
  420.                 double d18 = (double)((j & 2) - 1) * d3;
  421.                 double d19 = (double)((j + 1 & 2) - 1) * d3;
  422.                 double d20 = 0.0;
  423.                 double d21 = d18 * d16 - d19 * d15;
  424.                 double d22 = d19 * d16 + d18 * d15;
  425.                 double d23 = d21 * d12 + 0.0 * d13;
  426.                 double d24 = 0.0 * d12 - d21 * d13;
  427.                 double d25 = d24 * d9 - d22 * d10;
  428.                 double d26 = d22 * d9 + d24 * d10;
  429.                 worldRendererIn.func_178984_b(d5 + d25, d6 + d23, d7 + d26);
  430.             }
  431.         }
  432.     }
  433.  
  434.     public void func_72732_a(WorldClient worldClientIn) {
  435.         if (this.field_72769_h != null) {
  436.             this.field_72769_h.func_72848_b(this);
  437.         }
  438.         this.field_174992_B = Double.MIN_VALUE;
  439.         this.field_174993_C = Double.MIN_VALUE;
  440.         this.field_174987_D = Double.MIN_VALUE;
  441.         this.field_174988_E = Integer.MIN_VALUE;
  442.         this.field_174989_F = Integer.MIN_VALUE;
  443.         this.field_174990_G = Integer.MIN_VALUE;
  444.         this.field_175010_j.func_78717_a(worldClientIn);
  445.         this.field_72769_h = worldClientIn;
  446.         if (worldClientIn != null) {
  447.             worldClientIn.func_72954_a(this);
  448.             this.func_72712_a();
  449.         }
  450.     }
  451.  
  452.     public void func_72712_a() {
  453.         if (this.field_72769_h != null) {
  454.             Entity entity;
  455.             this.field_147595_R = true;
  456.             Blocks.field_150362_t.func_150122_b(this.field_72777_q.field_71474_y.field_74347_j);
  457.             Blocks.field_150361_u.func_150122_b(this.field_72777_q.field_71474_y.field_74347_j);
  458.             this.field_72739_F = this.field_72777_q.field_71474_y.field_151451_c;
  459.             boolean flag = this.field_175005_X;
  460.             this.field_175005_X = OpenGlHelper.func_176075_f();
  461.             if (flag && !this.field_175005_X) {
  462.                 this.field_174996_N = new RenderList();
  463.                 this.field_175007_a = new ListChunkFactory();
  464.             } else if (!flag && this.field_175005_X) {
  465.                 this.field_174996_N = new VboRenderList();
  466.                 this.field_175007_a = new VboChunkFactory();
  467.             }
  468.             if (flag != this.field_175005_X) {
  469.                 this.func_174963_q();
  470.                 this.func_174980_p();
  471.                 this.func_174964_o();
  472.             }
  473.             if (this.field_175008_n != null) {
  474.                 this.field_175008_n.func_178160_a();
  475.             }
  476.             this.func_174986_e();
  477.             this.field_175008_n = new ViewFrustum(this.field_72769_h, this.field_72777_q.field_71474_y.field_151451_c, this, this.field_175007_a);
  478.             if (this.field_72769_h != null && (entity = this.field_72777_q.func_175606_aa()) != null) {
  479.                 this.field_175008_n.func_178163_a(entity.field_70165_t, entity.field_70161_v);
  480.             }
  481.             this.field_72740_G = 2;
  482.         }
  483.     }
  484.  
  485.     protected void func_174986_e() {
  486.         this.field_175009_l.clear();
  487.         this.field_174995_M.func_178514_b();
  488.     }
  489.  
  490.     public void func_72720_a(int p_72720_1_, int p_72720_2_) {
  491.         if (OpenGlHelper.field_148824_g && this.field_174991_A != null) {
  492.             this.field_174991_A.func_148026_a(p_72720_1_, p_72720_2_);
  493.         }
  494.     }
  495.  
  496.     public void func_180446_a(Entity p_180446_1_, ICamera p_180446_2_, float partialTicks) {
  497.         int pass = MinecraftForgeClient.getRenderPass();
  498.         if (this.field_72740_G > 0) {
  499.             if (pass > 0) {
  500.                 return;
  501.             }
  502.             --this.field_72740_G;
  503.         } else {
  504.             Entity entity2;
  505.             int i;
  506.             double d0 = p_180446_1_.field_70169_q + (p_180446_1_.field_70165_t - p_180446_1_.field_70169_q) * (double)partialTicks;
  507.             double d1 = p_180446_1_.field_70167_r + (p_180446_1_.field_70163_u - p_180446_1_.field_70167_r) * (double)partialTicks;
  508.             double d2 = p_180446_1_.field_70166_s + (p_180446_1_.field_70161_v - p_180446_1_.field_70166_s) * (double)partialTicks;
  509.             this.field_72769_h.field_72984_F.func_76320_a("prepare");
  510.             TileEntityRendererDispatcher.field_147556_a.func_178470_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(), partialTicks);
  511.             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, partialTicks);
  512.             if (pass == 0) {
  513.                 this.field_72748_H = 0;
  514.                 this.field_72749_I = 0;
  515.                 this.field_72750_J = 0;
  516.             }
  517.             Entity entity1 = this.field_72777_q.func_175606_aa();
  518.             double d3 = entity1.field_70142_S + (entity1.field_70165_t - entity1.field_70142_S) * (double)partialTicks;
  519.             double d4 = entity1.field_70137_T + (entity1.field_70163_u - entity1.field_70137_T) * (double)partialTicks;
  520.             double d5 = entity1.field_70136_U + (entity1.field_70161_v - entity1.field_70136_U) * (double)partialTicks;
  521.             TileEntityRendererDispatcher.field_147554_b = d3;
  522.             TileEntityRendererDispatcher.field_147555_c = d4;
  523.             TileEntityRendererDispatcher.field_147552_d = d5;
  524.             this.field_175010_j.func_178628_a(d3, d4, d5);
  525.             this.field_72777_q.field_71460_t.func_180436_i();
  526.             this.field_72769_h.field_72984_F.func_76318_c("global");
  527.             List list = this.field_72769_h.func_72910_y();
  528.             if (pass == 0) {
  529.                 this.field_72748_H = list.size();
  530.             }
  531.             for (i = 0; i < this.field_72769_h.field_73007_j.size(); ++i) {
  532.                 entity2 = (Entity)this.field_72769_h.field_73007_j.get(i);
  533.                 if (!entity2.shouldRenderInPass(pass)) continue;
  534.                 ++this.field_72749_I;
  535.                 if (!entity2.func_145770_h(d0, d1, d2)) continue;
  536.                 this.field_175010_j.func_147937_a(entity2, partialTicks);
  537.             }
  538.             if (this.func_174985_d()) {
  539.                 GlStateManager.func_179143_c(519);
  540.                 GlStateManager.func_179106_n();
  541.                 this.field_175015_z.func_147614_f();
  542.                 this.field_175015_z.func_147610_a(false);
  543.                 this.field_72769_h.field_72984_F.func_76318_c("entityOutlines");
  544.                 RenderHelper.func_74518_a();
  545.                 this.field_175010_j.func_178632_c(true);
  546.                 for (i = 0; i < list.size(); ++i) {
  547.                     boolean flag1;
  548.                     entity2 = (Entity)list.get(i);
  549.                     if (!entity2.shouldRenderInPass(pass)) continue;
  550.                     boolean flag = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase && ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn();
  551.                     boolean bl = flag1 = entity2.func_145770_h(d0, d1, d2) && (entity2.field_70158_ak || p_180446_2_.func_78546_a(entity2.func_174813_aQ()) || entity2.field_70153_n == this.field_72777_q.field_71439_g) && entity2 instanceof EntityPlayer;
  552.                     if (entity2 == this.field_72777_q.func_175606_aa() && this.field_72777_q.field_71474_y.field_74320_O == 0 && !flag || !flag1) continue;
  553.                     this.field_175010_j.func_147937_a(entity2, partialTicks);
  554.                 }
  555.                 this.field_175010_j.func_178632_c(false);
  556.                 RenderHelper.func_74519_b();
  557.                 GlStateManager.func_179132_a(false);
  558.                 this.field_174991_A.func_148018_a(partialTicks);
  559.                 GlStateManager.func_179132_a(true);
  560.                 this.field_72777_q.func_147110_a().func_147610_a(false);
  561.                 GlStateManager.func_179127_m();
  562.                 GlStateManager.func_179143_c(515);
  563.                 GlStateManager.func_179126_j();
  564.                 GlStateManager.func_179141_d();
  565.             }
  566.             this.field_72769_h.field_72984_F.func_76318_c("entities");
  567.             for (ContainerLocalRenderInformation containerlocalrenderinformation : this.field_72755_R) {
  568.                 Chunk chunk = this.field_72769_h.func_175726_f(containerlocalrenderinformation.field_178036_a.func_178568_j());
  569.                 for (Entity entity3 : chunk.func_177429_s()[containerlocalrenderinformation.field_178036_a.func_178568_j().func_177956_o() / 16]) {
  570.                     boolean flag2;
  571.                     if (!entity3.shouldRenderInPass(pass)) continue;
  572.                     boolean bl = flag2 = this.field_175010_j.func_178635_a(entity3, p_180446_2_, d0, d1, d2) || entity3.field_70153_n == this.field_72777_q.field_71439_g;
  573.                     if (flag2) {
  574.                         boolean flag3;
  575.                         boolean bl2 = flag3 = this.field_72777_q.func_175606_aa() instanceof EntityLivingBase ? ((EntityLivingBase)this.field_72777_q.func_175606_aa()).func_70608_bn() : false;
  576.                         if (entity3 == this.field_72777_q.func_175606_aa() && this.field_72777_q.field_71474_y.field_74320_O == 0 && !flag3 || entity3.field_70163_u >= 0.0 && entity3.field_70163_u < 256.0 && !this.field_72769_h.func_175667_e(new BlockPos(entity3))) continue;
  577.                         ++this.field_72749_I;
  578.                         this.field_175010_j.func_147937_a(entity3, partialTicks);
  579.                     }
  580.                     if (flag2 || !(entity3 instanceof EntityWitherSkull)) continue;
  581.                     this.field_72777_q.func_175598_ae().func_178630_b(entity3, partialTicks);
  582.                 }
  583.             }
  584.             this.field_72769_h.field_72984_F.func_76318_c("blockentities");
  585.             RenderHelper.func_74519_b();
  586.             for (ContainerLocalRenderInformation containerlocalrenderinformation2 : this.field_72755_R) {
  587.                 for (TileEntity tileentity : containerlocalrenderinformation2.field_178036_a.func_178571_g().func_178485_b()) {
  588.                     if (!tileentity.shouldRenderInPass(pass) || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
  589.                     TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, partialTicks, -1);
  590.                 }
  591.             }
  592.             this.func_180443_s();
  593.             for (DestroyBlockProgress destroyblockprogress : this.field_72738_E.values()) {
  594.                 TileEntity tileentity;
  595.                 BlockPos blockpos = destroyblockprogress.func_180246_b();
  596.                 tileentity = this.field_72769_h.func_175625_s(blockpos);
  597.                 if (tileentity instanceof TileEntityChest) {
  598.                     TileEntityChest tileentitychest = (TileEntityChest)tileentity;
  599.                     if (tileentitychest.field_145991_k != null) {
  600.                         blockpos = blockpos.func_177972_a(EnumFacing.WEST);
  601.                         tileentity = this.field_72769_h.func_175625_s(blockpos);
  602.                     } else if (tileentitychest.field_145992_i != null) {
  603.                         blockpos = blockpos.func_177972_a(EnumFacing.NORTH);
  604.                         tileentity = this.field_72769_h.func_175625_s(blockpos);
  605.                     }
  606.                 }
  607.                 Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
  608.                 if (tileentity == null || !tileentity.shouldRenderInPass(pass) || !tileentity.canRenderBreaking() || !p_180446_2_.func_78546_a(tileentity.getRenderBoundingBox())) continue;
  609.                 TileEntityRendererDispatcher.field_147556_a.func_180546_a(tileentity, partialTicks, destroyblockprogress.func_73106_e());
  610.             }
  611.             this.func_174969_t();
  612.             this.field_72777_q.field_71460_t.func_175072_h();
  613.             this.field_72777_q.field_71424_I.func_76319_b();
  614.         }
  615.     }
  616.  
  617.     public String func_72735_c() {
  618.         int i = this.field_175008_n.field_178164_f.length;
  619.         int j = 0;
  620.         for (ContainerLocalRenderInformation containerlocalrenderinformation : this.field_72755_R) {
  621.             CompiledChunk compiledchunk = containerlocalrenderinformation.field_178036_a.field_178590_b;
  622.             if (compiledchunk == CompiledChunk.field_178502_a || compiledchunk.func_178489_a()) continue;
  623.             ++j;
  624.         }
  625.         Object[] arrobject = new Object[5];
  626.         arrobject[0] = j;
  627.         arrobject[1] = i;
  628.         arrobject[2] = this.field_72777_q.field_175612_E ? "(s) " : "";
  629.         arrobject[3] = this.field_72739_F;
  630.         arrobject[4] = this.field_174995_M.func_178504_a();
  631.         return String.format("C: %d/%d %sD: %d, %s", arrobject);
  632.     }
  633.  
  634.     public String func_72723_d() {
  635.         return "E: " + this.field_72749_I + "/" + this.field_72748_H + ", B: " + this.field_72750_J + ", I: " + (this.field_72748_H - this.field_72750_J - this.field_72749_I);
  636.     }
  637.  
  638.     public void func_174970_a(Entity entity, double d, ICamera iCamera, int n, boolean bl) {
  639.         void partialTicks;
  640.         boolean flag1;
  641.         Frustum camera;
  642.         RenderChunk renderchunk3;
  643.         RenderGlobal renderGlobal;
  644.         void viewEntity;
  645.         CallbackInfo callbackInfo = new CallbackInfo("func_174970_a", true);
  646.         renderGlobal.replayModRender_setupTerrain(entity, d, iCamera, n, bl, callbackInfo);
  647.         if (callbackInfo.isCancelled()) {
  648.             return;
  649.         }
  650.         if (this.field_72777_q.field_71474_y.field_151451_c != this.field_72739_F) {
  651.             this.func_72712_a();
  652.         }
  653.         this.field_72769_h.field_72984_F.func_76320_a("camera");
  654.         double d1 = viewEntity.field_70165_t - this.field_174992_B;
  655.         double d2 = viewEntity.field_70163_u - this.field_174993_C;
  656.         double d3 = viewEntity.field_70161_v - this.field_174987_D;
  657.         if (this.field_174988_E != viewEntity.field_70176_ah || this.field_174989_F != viewEntity.field_70162_ai || this.field_174990_G != viewEntity.field_70164_aj || d1 * d1 + d2 * d2 + d3 * d3 > 16.0) {
  658.             this.field_174992_B = viewEntity.field_70165_t;
  659.             this.field_174993_C = viewEntity.field_70163_u;
  660.             this.field_174987_D = viewEntity.field_70161_v;
  661.             this.field_174988_E = viewEntity.field_70176_ah;
  662.             this.field_174989_F = viewEntity.field_70162_ai;
  663.             this.field_174990_G = viewEntity.field_70164_aj;
  664.             this.field_175008_n.func_178163_a(viewEntity.field_70165_t, viewEntity.field_70161_v);
  665.         }
  666.         this.field_72769_h.field_72984_F.func_76318_c("renderlistcamera");
  667.         double d4 = viewEntity.field_70142_S + (viewEntity.field_70165_t - viewEntity.field_70142_S) * partialTicks;
  668.         double d5 = viewEntity.field_70137_T + (viewEntity.field_70163_u - viewEntity.field_70137_T) * partialTicks;
  669.         double d6 = viewEntity.field_70136_U + (viewEntity.field_70161_v - viewEntity.field_70136_U) * partialTicks;
  670.         this.field_174996_N.func_178004_a(d4, d5, d6);
  671.         this.field_72769_h.field_72984_F.func_76318_c("cull");
  672.         if (this.field_175001_U != null) {
  673.             Frustum frustum = new Frustum(this.field_175001_U);
  674.             frustum.func_78547_a(this.field_175003_W.x, this.field_175003_W.y, this.field_175003_W.z);
  675.             camera = frustum;
  676.         }
  677.         this.field_72777_q.field_71424_I.func_76318_c("culling");
  678.         BlockPos blockpos1 = new BlockPos(d4, d5 + (double)viewEntity.func_70047_e(), d6);
  679.         RenderChunk renderchunk = this.field_175008_n.func_178161_a(blockpos1);
  680.         BlockPos blockpos = new BlockPos(MathHelper.func_76128_c(d4) / 16 * 16, MathHelper.func_76128_c(d5) / 16 * 16, MathHelper.func_76128_c(d6) / 16 * 16);
  681.         this.field_147595_R = this.field_147595_R || !this.field_175009_l.isEmpty() || viewEntity.field_70165_t != this.field_174997_H || viewEntity.field_70163_u != this.field_174998_I || viewEntity.field_70161_v != this.field_174999_J || (double)viewEntity.field_70125_A != this.field_175000_K || (double)viewEntity.field_70177_z != this.field_174994_L;
  682.         this.field_174997_H = viewEntity.field_70165_t;
  683.         this.field_174998_I = viewEntity.field_70163_u;
  684.         this.field_174999_J = viewEntity.field_70161_v;
  685.         this.field_175000_K = viewEntity.field_70125_A;
  686.         this.field_174994_L = viewEntity.field_70177_z;
  687.         boolean bl2 = flag1 = this.field_175001_U != null;
  688.         if (!flag1 && this.field_147595_R) {
  689.             void frameCount;
  690.             this.field_147595_R = false;
  691.             this.field_72755_R = Lists.newArrayList();
  692.             LinkedList linkedlist = Lists.newLinkedList();
  693.             boolean flag2 = this.field_72777_q.field_175612_E;
  694.             if (renderchunk == null) {
  695.                 int j = blockpos1.func_177956_o() > 0 ? 248 : 8;
  696.                 for (int k = - this.field_72739_F; k <= this.field_72739_F; ++k) {
  697.                     for (int l = - this.field_72739_F; l <= this.field_72739_F; ++l) {
  698.                         RenderChunk renderchunk1 = this.field_175008_n.func_178161_a(new BlockPos((k << 4) + 8, j, (l << 4) + 8));
  699.                         if (renderchunk1 == null || !camera.func_78546_a(renderchunk1.field_178591_c)) continue;
  700.                         renderchunk1.func_178577_a((int)frameCount);
  701.                         linkedlist.add(new ContainerLocalRenderInformation(renderchunk1, null, 0, null));
  702.                     }
  703.                 }
  704.             } else {
  705.                 void playerSpectator;
  706.                 boolean flag3 = false;
  707.                 ContainerLocalRenderInformation containerlocalrenderinformation2 = new ContainerLocalRenderInformation(renderchunk, null, 0, null);
  708.                 Set set1 = this.func_174978_c(blockpos1);
  709.                 if (!set1.isEmpty() && set1.size() == 1) {
  710.                     Vector3f vector3f = this.func_174962_a((Entity)viewEntity, (double)partialTicks);
  711.                     EnumFacing enumfacing = EnumFacing.func_176737_a(vector3f.x, vector3f.y, vector3f.z).func_176734_d();
  712.                     set1.remove(enumfacing);
  713.                 }
  714.                 if (set1.isEmpty()) {
  715.                     flag3 = true;
  716.                 }
  717.                 if (flag3 && playerSpectator == false) {
  718.                     this.field_72755_R.add(containerlocalrenderinformation2);
  719.                 } else {
  720.                     if (playerSpectator != false && this.field_72769_h.func_180495_p(blockpos1).func_177230_c().func_149662_c()) {
  721.                         flag2 = false;
  722.                     }
  723.                     renderchunk.func_178577_a((int)frameCount);
  724.                     linkedlist.add(containerlocalrenderinformation2);
  725.                 }
  726.             }
  727.             while (!linkedlist.isEmpty()) {
  728.                 ContainerLocalRenderInformation containerlocalrenderinformation1 = (ContainerLocalRenderInformation)linkedlist.poll();
  729.                 renderchunk3 = containerlocalrenderinformation1.field_178036_a;
  730.                 EnumFacing enumfacing2 = containerlocalrenderinformation1.field_178034_b;
  731.                 BlockPos blockpos2 = renderchunk3.func_178568_j();
  732.                 this.field_72755_R.add(containerlocalrenderinformation1);
  733.                 for (EnumFacing enumfacing1 : EnumFacing.values()) {
  734.                     RenderChunk renderchunk2 = this.func_174973_a(blockpos1, blockpos2, enumfacing1);
  735.                     if (flag2 && containerlocalrenderinformation1.field_178035_c.contains(enumfacing1.func_176734_d()) || flag2 && enumfacing2 != null && !renderchunk3.func_178571_g().func_178495_a(enumfacing2.func_176734_d(), enumfacing1) || renderchunk2 == null || !renderchunk2.func_178577_a((int)frameCount) || !camera.func_78546_a(renderchunk2.field_178591_c)) continue;
  736.                     ContainerLocalRenderInformation containerlocalrenderinformation = new ContainerLocalRenderInformation(renderchunk2, enumfacing1, containerlocalrenderinformation1.field_178032_d + 1, null);
  737.                     containerlocalrenderinformation.field_178035_c.addAll(containerlocalrenderinformation1.field_178035_c);
  738.                     containerlocalrenderinformation.field_178035_c.add(enumfacing1);
  739.                     linkedlist.add(containerlocalrenderinformation);
  740.                 }
  741.             }
  742.         }
  743.         if (this.field_175002_T) {
  744.             this.func_174984_a(d4, d5, d6);
  745.             this.field_175002_T = false;
  746.         }
  747.         this.field_174995_M.func_178513_e();
  748.         Set set = this.field_175009_l;
  749.         this.field_175009_l = Sets.newLinkedHashSet();
  750.         for (ContainerLocalRenderInformation containerlocalrenderinformation1 : this.field_72755_R) {
  751.             renderchunk3 = containerlocalrenderinformation1.field_178036_a;
  752.             if (!renderchunk3.func_178569_m() && !renderchunk3.func_178583_l() && !set.contains(renderchunk3)) continue;
  753.             this.field_147595_R = true;
  754.             if (this.func_174983_a(blockpos, containerlocalrenderinformation1.field_178036_a)) {
  755.                 this.field_72777_q.field_71424_I.func_76320_a("build near");
  756.                 this.field_174995_M.func_178505_b(renderchunk3);
  757.                 renderchunk3.func_178575_a(false);
  758.                 this.field_72777_q.field_71424_I.func_76319_b();
  759.                 continue;
  760.             }
  761.             this.field_175009_l.add(renderchunk3);
  762.         }
  763.         this.field_175009_l.addAll(set);
  764.         this.field_72777_q.field_71424_I.func_76319_b();
  765.     }
  766.  
  767.     private boolean func_174983_a(BlockPos blockPos, RenderChunk renderChunk) {
  768.         void p_174983_2_;
  769.         void p_174983_1_;
  770.         RenderGlobal renderGlobal;
  771.         CallbackInfoReturnable callbackInfoReturnable = new CallbackInfoReturnable("func_174983_a", true);
  772.         renderGlobal.replayModRender_isPositionInRenderChunk(blockPos, renderChunk, callbackInfoReturnable);
  773.         if (callbackInfoReturnable.isCancelled()) {
  774.             return callbackInfoReturnable.getReturnValueZ();
  775.         }
  776.         BlockPos blockpos1 = p_174983_2_.func_178568_j();
  777.         return MathHelper.func_76130_a(p_174983_1_.func_177958_n() - blockpos1.func_177958_n()) > 16 ? false : (MathHelper.func_76130_a(p_174983_1_.func_177956_o() - blockpos1.func_177956_o()) > 16 ? false : MathHelper.func_76130_a(p_174983_1_.func_177952_p() - blockpos1.func_177952_p()) <= 16);
  778.     }
  779.  
  780.     private Set func_174978_c(BlockPos p_174978_1_) {
  781.         VisGraph visgraph = new VisGraph();
  782.         BlockPos blockpos1 = new BlockPos(p_174978_1_.func_177958_n() >> 4 << 4, p_174978_1_.func_177956_o() >> 4 << 4, p_174978_1_.func_177952_p() >> 4 << 4);
  783.         Chunk chunk = this.field_72769_h.func_175726_f(blockpos1);
  784.         for (BlockPos$MutableBlockPos mutableblockpos : BlockPos.func_177975_b(blockpos1, blockpos1.func_177982_a(15, 15, 15))) {
  785.             if (!chunk.func_177428_a(mutableblockpos).func_149662_c()) continue;
  786.             visgraph.func_178606_a(mutableblockpos);
  787.         }
  788.         return visgraph.func_178609_b(p_174978_1_);
  789.     }
  790.  
  791.     private RenderChunk func_174973_a(BlockPos p_174973_1_, BlockPos p_174973_2_, EnumFacing p_174973_3_) {
  792.         BlockPos blockpos2 = p_174973_2_.func_177967_a(p_174973_3_, 16);
  793.         return MathHelper.func_76130_a(p_174973_1_.func_177958_n() - blockpos2.func_177958_n()) > this.field_72739_F * 16 ? null : (blockpos2.func_177956_o() >= 0 && blockpos2.func_177956_o() < 256 ? (MathHelper.func_76130_a(p_174973_1_.func_177952_p() - blockpos2.func_177952_p()) > this.field_72739_F * 16 ? null : this.field_175008_n.func_178161_a(blockpos2)) : null);
  794.     }
  795.  
  796.     private void func_174984_a(double p_174984_1_, double p_174984_3_, double p_174984_5_) {
  797.         this.field_175001_U = new ClippingHelperImpl();
  798.         ((ClippingHelperImpl)this.field_175001_U).func_78560_b();
  799.         Matrix4f matrix4f = new Matrix4f(this.field_175001_U.field_178626_c);
  800.         matrix4f.transpose();
  801.         Matrix4f matrix4f1 = new Matrix4f(this.field_175001_U.field_178625_b);
  802.         matrix4f1.transpose();
  803.         Matrix4f matrix4f2 = new Matrix4f();
  804.         matrix4f2.mul(matrix4f1, matrix4f);
  805.         matrix4f2.invert();
  806.         this.field_175003_W.x = p_174984_1_;
  807.         this.field_175003_W.y = p_174984_3_;
  808.         this.field_175003_W.z = p_174984_5_;
  809.         this.field_175004_V[0] = new Vector4f(-1.0f, -1.0f, -1.0f, 1.0f);
  810.         this.field_175004_V[1] = new Vector4f(1.0f, -1.0f, -1.0f, 1.0f);
  811.         this.field_175004_V[2] = new Vector4f(1.0f, 1.0f, -1.0f, 1.0f);
  812.         this.field_175004_V[3] = new Vector4f(-1.0f, 1.0f, -1.0f, 1.0f);
  813.         this.field_175004_V[4] = new Vector4f(-1.0f, -1.0f, 1.0f, 1.0f);
  814.         this.field_175004_V[5] = new Vector4f(1.0f, -1.0f, 1.0f, 1.0f);
  815.         this.field_175004_V[6] = new Vector4f(1.0f, 1.0f, 1.0f, 1.0f);
  816.         this.field_175004_V[7] = new Vector4f(-1.0f, 1.0f, 1.0f, 1.0f);
  817.         for (int i = 0; i < 8; ++i) {
  818.             matrix4f2.transform((Tuple4f)this.field_175004_V[i]);
  819.             this.field_175004_V[i].x /= this.field_175004_V[i].w;
  820.             this.field_175004_V[i].y /= this.field_175004_V[i].w;
  821.             this.field_175004_V[i].z /= this.field_175004_V[i].w;
  822.             this.field_175004_V[i].w = 1.0f;
  823.         }
  824.     }
  825.  
  826.     protected Vector3f func_174962_a(Entity entityIn, double partialTicks) {
  827.         float f = (float)((double)entityIn.field_70127_C + (double)(entityIn.field_70125_A - entityIn.field_70127_C) * partialTicks);
  828.         float f1 = (float)((double)entityIn.field_70126_B + (double)(entityIn.field_70177_z - entityIn.field_70126_B) * partialTicks);
  829.         if (Minecraft.func_71410_x().field_71474_y.field_74320_O == 2) {
  830.             f += 180.0f;
  831.         }
  832.         float f2 = MathHelper.func_76134_b((- f1) * 0.017453292f - 3.1415927f);
  833.         float f3 = MathHelper.func_76126_a((- f1) * 0.017453292f - 3.1415927f);
  834.         float f4 = - MathHelper.func_76134_b((- f) * 0.017453292f);
  835.         float f5 = MathHelper.func_76126_a((- f) * 0.017453292f);
  836.         return new Vector3f(f3 * f4, f5, f2 * f4);
  837.     }
  838.  
  839.     public int func_174977_a(EnumWorldBlockLayer blockLayerIn, double partialTicks, int pass, Entity entityIn) {
  840.         RenderHelper.func_74518_a();
  841.         if (blockLayerIn == EnumWorldBlockLayer.TRANSLUCENT) {
  842.             this.field_72777_q.field_71424_I.func_76320_a("translucent_sort");
  843.             double d1 = entityIn.field_70165_t - this.field_147596_f;
  844.             double d2 = entityIn.field_70163_u - this.field_147597_g;
  845.             double d3 = entityIn.field_70161_v - this.field_147602_h;
  846.             if (d1 * d1 + d2 * d2 + d3 * d3 > 1.0) {
  847.                 this.field_147596_f = entityIn.field_70165_t;
  848.                 this.field_147597_g = entityIn.field_70163_u;
  849.                 this.field_147602_h = entityIn.field_70161_v;
  850.                 int l = 0;
  851.                 for (ContainerLocalRenderInformation containerlocalrenderinformation : this.field_72755_R) {
  852.                     if (!containerlocalrenderinformation.field_178036_a.field_178590_b.func_178492_d(blockLayerIn) || l++ >= 15) continue;
  853.                     this.field_174995_M.func_178509_c(containerlocalrenderinformation.field_178036_a);
  854.                 }
  855.             }
  856.             this.field_72777_q.field_71424_I.func_76319_b();
  857.         }
  858.         this.field_72777_q.field_71424_I.func_76320_a("filterempty");
  859.         int i1 = 0;
  860.         boolean flag = blockLayerIn == EnumWorldBlockLayer.TRANSLUCENT;
  861.         int j1 = flag ? this.field_72755_R.size() - 1 : 0;
  862.         int j = flag ? -1 : this.field_72755_R.size();
  863.         int k1 = flag ? -1 : 1;
  864.         for (int k = j1; k != j; k += k1) {
  865.             RenderChunk renderchunk = ((ContainerLocalRenderInformation)this.field_72755_R.get((int)k)).field_178036_a;
  866.             if (renderchunk.func_178571_g().func_178491_b(blockLayerIn)) continue;
  867.             ++i1;
  868.             this.field_174996_N.func_178002_a(renderchunk, blockLayerIn);
  869.         }
  870.         this.field_72777_q.field_71424_I.func_76318_c("render_" + (Object)((Object)blockLayerIn));
  871.         this.func_174982_a(blockLayerIn);
  872.         this.field_72777_q.field_71424_I.func_76319_b();
  873.         return i1;
  874.     }
  875.  
  876.     private void func_174982_a(EnumWorldBlockLayer blockLayerIn) {
  877.         this.field_72777_q.field_71460_t.func_180436_i();
  878.         if (OpenGlHelper.func_176075_f()) {
  879.             GL11.glEnableClientState((int)32884);
  880.             OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
  881.             GL11.glEnableClientState((int)32888);
  882.             OpenGlHelper.func_77472_b(OpenGlHelper.field_77476_b);
  883.             GL11.glEnableClientState((int)32888);
  884.             OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
  885.             GL11.glEnableClientState((int)32886);
  886.         }
  887.         this.field_174996_N.func_178001_a(blockLayerIn);
  888.         if (OpenGlHelper.func_176075_f()) {
  889.             List list = DefaultVertexFormats.field_176600_a.func_177343_g();
  890.             for (VertexFormatElement vertexformatelement : list) {
  891.                 VertexFormatElement.EnumUsage enumusage = vertexformatelement.func_177375_c();
  892.                 int i = vertexformatelement.func_177369_e();
  893.                 switch (SwitchEnumUsage.field_178037_a[enumusage.ordinal()]) {
  894.                     case 1: {
  895.                         GL11.glDisableClientState((int)32884);
  896.                         break;
  897.                     }
  898.                     case 2: {
  899.                         OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a + i);
  900.                         GL11.glDisableClientState((int)32888);
  901.                         OpenGlHelper.func_77472_b(OpenGlHelper.field_77478_a);
  902.                         break;
  903.                     }
  904.                     case 3: {
  905.                         GL11.glDisableClientState((int)32886);
  906.                         GlStateManager.func_179117_G();
  907.                     }
  908.                 }
  909.             }
  910.         }
  911.         this.field_72777_q.field_71460_t.func_175072_h();
  912.     }
  913.  
  914.     private void func_174965_a(Iterator p_174965_1_) {
  915.         while (p_174965_1_.hasNext()) {
  916.             DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)p_174965_1_.next();
  917.             int i = destroyblockprogress.func_82743_f();
  918.             if (this.field_72773_u - i <= 400) continue;
  919.             p_174965_1_.remove();
  920.         }
  921.     }
  922.  
  923.     public void func_72734_e() {
  924.         ++this.field_72773_u;
  925.         if (this.field_72773_u % 20 == 0) {
  926.             this.func_174965_a(this.field_72738_E.values().iterator());
  927.         }
  928.     }
  929.  
  930.     private void func_180448_r() {
  931.         GlStateManager.func_179106_n();
  932.         GlStateManager.func_179118_c();
  933.         GlStateManager.func_179147_l();
  934.         GlStateManager.func_179120_a(770, 771, 1, 0);
  935.         RenderHelper.func_74518_a();
  936.         GlStateManager.func_179132_a(false);
  937.         this.field_72770_i.func_110577_a(field_110926_k);
  938.         Tessellator tessellator = Tessellator.func_178181_a();
  939.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  940.         for (int i = 0; i < 6; ++i) {
  941.             GlStateManager.func_179094_E();
  942.             if (i == 1) {
  943.                 GlStateManager.func_179114_b(90.0f, 1.0f, 0.0f, 0.0f);
  944.             }
  945.             if (i == 2) {
  946.                 GlStateManager.func_179114_b(-90.0f, 1.0f, 0.0f, 0.0f);
  947.             }
  948.             if (i == 3) {
  949.                 GlStateManager.func_179114_b(180.0f, 1.0f, 0.0f, 0.0f);
  950.             }
  951.             if (i == 4) {
  952.                 GlStateManager.func_179114_b(90.0f, 0.0f, 0.0f, 1.0f);
  953.             }
  954.             if (i == 5) {
  955.                 GlStateManager.func_179114_b(-90.0f, 0.0f, 0.0f, 1.0f);
  956.             }
  957.             worldrenderer.func_178970_b();
  958.             worldrenderer.func_178991_c(2631720);
  959.             worldrenderer.func_178985_a(-100.0, -100.0, -100.0, 0.0, 0.0);
  960.             worldrenderer.func_178985_a(-100.0, -100.0, 100.0, 0.0, 16.0);
  961.             worldrenderer.func_178985_a(100.0, -100.0, 100.0, 16.0, 16.0);
  962.             worldrenderer.func_178985_a(100.0, -100.0, -100.0, 16.0, 0.0);
  963.             tessellator.func_78381_a();
  964.             GlStateManager.func_179121_F();
  965.         }
  966.         GlStateManager.func_179132_a(true);
  967.         GlStateManager.func_179098_w();
  968.         GlStateManager.func_179141_d();
  969.     }
  970.  
  971.     public void func_174976_a(float partialTicks, int pass) {
  972.         IRenderHandler renderer = this.field_72769_h.field_73011_w.getSkyRenderer();
  973.         if (renderer != null) {
  974.             renderer.render(partialTicks, this.field_72769_h, this.field_72777_q);
  975.             return;
  976.         }
  977.         if (this.field_72777_q.field_71441_e.field_73011_w.func_177502_q() == 1) {
  978.             this.func_180448_r();
  979.         } else if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
  980.             float f7;
  981.             float f8;
  982.             float f9;
  983.             float f11;
  984.             float f10;
  985.             GlStateManager.func_179090_x();
  986.             Vec3 vec3 = this.field_72769_h.func_72833_a(this.field_72777_q.func_175606_aa(), partialTicks);
  987.             float f1 = (float)vec3.field_72450_a;
  988.             float f2 = (float)vec3.field_72448_b;
  989.             float f3 = (float)vec3.field_72449_c;
  990.             if (pass != 2) {
  991.                 float f4 = (f1 * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
  992.                 float f5 = (f1 * 30.0f + f2 * 70.0f) / 100.0f;
  993.                 float f6 = (f1 * 30.0f + f3 * 70.0f) / 100.0f;
  994.                 f1 = f4;
  995.                 f2 = f5;
  996.                 f3 = f6;
  997.             }
  998.             GlStateManager.func_179124_c(f1, f2, f3);
  999.             Tessellator tessellator = Tessellator.func_178181_a();
  1000.             WorldRenderer worldrenderer = tessellator.func_178180_c();
  1001.             GlStateManager.func_179132_a(false);
  1002.             GlStateManager.func_179127_m();
  1003.             GlStateManager.func_179124_c(f1, f2, f3);
  1004.             if (this.field_175005_X) {
  1005.                 this.field_175012_t.func_177359_a();
  1006.                 GL11.glEnableClientState((int)32884);
  1007.                 GL11.glVertexPointer((int)3, (int)5126, (int)12, (long)0);
  1008.                 this.field_175012_t.func_177358_a(7);
  1009.                 this.field_175012_t.func_177361_b();
  1010.                 GL11.glDisableClientState((int)32884);
  1011.             } else {
  1012.                 GlStateManager.func_179148_o(this.field_72771_w);
  1013.             }
  1014.             GlStateManager.func_179106_n();
  1015.             GlStateManager.func_179118_c();
  1016.             GlStateManager.func_179147_l();
  1017.             GlStateManager.func_179120_a(770, 771, 1, 0);
  1018.             RenderHelper.func_74518_a();
  1019.             float[] afloat = this.field_72769_h.field_73011_w.func_76560_a(this.field_72769_h.func_72826_c(partialTicks), partialTicks);
  1020.             if (afloat != null) {
  1021.                 float f12;
  1022.                 GlStateManager.func_179090_x();
  1023.                 GlStateManager.func_179103_j(7425);
  1024.                 GlStateManager.func_179094_E();
  1025.                 GlStateManager.func_179114_b(90.0f, 1.0f, 0.0f, 0.0f);
  1026.                 GlStateManager.func_179114_b(MathHelper.func_76126_a(this.field_72769_h.func_72929_e(partialTicks)) < 0.0f ? 180.0f : 0.0f, 0.0f, 0.0f, 1.0f);
  1027.                 GlStateManager.func_179114_b(90.0f, 0.0f, 0.0f, 1.0f);
  1028.                 f7 = afloat[0];
  1029.                 f8 = afloat[1];
  1030.                 f9 = afloat[2];
  1031.                 if (pass != 2) {
  1032.                     f10 = (f7 * 30.0f + f8 * 59.0f + f9 * 11.0f) / 100.0f;
  1033.                     f11 = (f7 * 30.0f + f8 * 70.0f) / 100.0f;
  1034.                     f12 = (f7 * 30.0f + f9 * 70.0f) / 100.0f;
  1035.                     f7 = f10;
  1036.                     f8 = f11;
  1037.                     f9 = f12;
  1038.                 }
  1039.                 worldrenderer.func_178964_a(6);
  1040.                 worldrenderer.func_178960_a(f7, f8, f9, afloat[3]);
  1041.                 worldrenderer.func_178984_b(0.0, 100.0, 0.0);
  1042.                 boolean flag = true;
  1043.                 worldrenderer.func_178960_a(afloat[0], afloat[1], afloat[2], 0.0f);
  1044.                 for (int j = 0; j <= 16; ++j) {
  1045.                     f12 = (float)j * 3.1415927f * 2.0f / 16.0f;
  1046.                     float f13 = MathHelper.func_76126_a(f12);
  1047.                     float f14 = MathHelper.func_76134_b(f12);
  1048.                     worldrenderer.func_178984_b(f13 * 120.0f, f14 * 120.0f, (- f14) * 40.0f * afloat[3]);
  1049.                 }
  1050.                 tessellator.func_78381_a();
  1051.                 GlStateManager.func_179121_F();
  1052.                 GlStateManager.func_179103_j(7424);
  1053.             }
  1054.             GlStateManager.func_179098_w();
  1055.             GlStateManager.func_179120_a(770, 1, 1, 0);
  1056.             GlStateManager.func_179094_E();
  1057.             f7 = 1.0f - this.field_72769_h.func_72867_j(partialTicks);
  1058.             f8 = 0.0f;
  1059.             f9 = 0.0f;
  1060.             f10 = 0.0f;
  1061.             GlStateManager.func_179131_c(1.0f, 1.0f, 1.0f, f7);
  1062.             GlStateManager.func_179109_b(0.0f, 0.0f, 0.0f);
  1063.             GlStateManager.func_179114_b(-90.0f, 0.0f, 1.0f, 0.0f);
  1064.             GlStateManager.func_179114_b(this.field_72769_h.func_72826_c(partialTicks) * 360.0f, 1.0f, 0.0f, 0.0f);
  1065.             f11 = 30.0f;
  1066.             this.field_72770_i.func_110577_a(field_110928_i);
  1067.             worldrenderer.func_178970_b();
  1068.             worldrenderer.func_178985_a(- f11, 100.0, - f11, 0.0, 0.0);
  1069.             worldrenderer.func_178985_a(f11, 100.0, - f11, 1.0, 0.0);
  1070.             worldrenderer.func_178985_a(f11, 100.0, f11, 1.0, 1.0);
  1071.             worldrenderer.func_178985_a(- f11, 100.0, f11, 0.0, 1.0);
  1072.             tessellator.func_78381_a();
  1073.             f11 = 20.0f;
  1074.             this.field_72770_i.func_110577_a(field_110927_h);
  1075.             int k = this.field_72769_h.func_72853_d();
  1076.             int l = k % 4;
  1077.             int i1 = k / 4 % 2;
  1078.             float f15 = (float)(l + 0) / 4.0f;
  1079.             float f16 = (float)(i1 + 0) / 2.0f;
  1080.             float f17 = (float)(l + 1) / 4.0f;
  1081.             float f18 = (float)(i1 + 1) / 2.0f;
  1082.             worldrenderer.func_178970_b();
  1083.             worldrenderer.func_178985_a(- f11, -100.0, f11, f17, f18);
  1084.             worldrenderer.func_178985_a(f11, -100.0, f11, f15, f18);
  1085.             worldrenderer.func_178985_a(f11, -100.0, - f11, f15, f16);
  1086.             worldrenderer.func_178985_a(- f11, -100.0, - f11, f17, f16);
  1087.             tessellator.func_78381_a();
  1088.             GlStateManager.func_179090_x();
  1089.             float f19 = this.field_72769_h.func_72880_h(partialTicks) * f7;
  1090.             if (f19 > 0.0f) {
  1091.                 GlStateManager.func_179131_c(f19, f19, f19, f19);
  1092.                 if (this.field_175005_X) {
  1093.                     this.field_175013_s.func_177359_a();
  1094.                     GL11.glEnableClientState((int)32884);
  1095.                     GL11.glVertexPointer((int)3, (int)5126, (int)12, (long)0);
  1096.                     this.field_175013_s.func_177358_a(7);
  1097.                     this.field_175013_s.func_177361_b();
  1098.                     GL11.glDisableClientState((int)32884);
  1099.                 } else {
  1100.                     GlStateManager.func_179148_o(this.field_72772_v);
  1101.                 }
  1102.             }
  1103.             GlStateManager.func_179131_c(1.0f, 1.0f, 1.0f, 1.0f);
  1104.             GlStateManager.func_179084_k();
  1105.             GlStateManager.func_179141_d();
  1106.             GlStateManager.func_179127_m();
  1107.             GlStateManager.func_179121_F();
  1108.             GlStateManager.func_179090_x();
  1109.             GlStateManager.func_179124_c(0.0f, 0.0f, 0.0f);
  1110.             double d0 = this.field_72777_q.field_71439_g.func_174824_e((float)partialTicks).field_72448_b - this.field_72769_h.func_72919_O();
  1111.             if (d0 < 0.0) {
  1112.                 GlStateManager.func_179094_E();
  1113.                 GlStateManager.func_179109_b(0.0f, 12.0f, 0.0f);
  1114.                 if (this.field_175005_X) {
  1115.                     this.field_175011_u.func_177359_a();
  1116.                     GL11.glEnableClientState((int)32884);
  1117.                     GL11.glVertexPointer((int)3, (int)5126, (int)12, (long)0);
  1118.                     this.field_175011_u.func_177358_a(7);
  1119.                     this.field_175011_u.func_177361_b();
  1120.                     GL11.glDisableClientState((int)32884);
  1121.                 } else {
  1122.                     GlStateManager.func_179148_o(this.field_72781_x);
  1123.                 }
  1124.                 GlStateManager.func_179121_F();
  1125.                 f9 = 1.0f;
  1126.                 f10 = - (float)(d0 + 65.0);
  1127.                 f11 = -1.0f;
  1128.                 worldrenderer.func_178970_b();
  1129.                 worldrenderer.func_178974_a(0, 255);
  1130.                 worldrenderer.func_178984_b(-1.0, f10, 1.0);
  1131.                 worldrenderer.func_178984_b(1.0, f10, 1.0);
  1132.                 worldrenderer.func_178984_b(1.0, -1.0, 1.0);
  1133.                 worldrenderer.func_178984_b(-1.0, -1.0, 1.0);
  1134.                 worldrenderer.func_178984_b(-1.0, -1.0, -1.0);
  1135.                 worldrenderer.func_178984_b(1.0, -1.0, -1.0);
  1136.                 worldrenderer.func_178984_b(1.0, f10, -1.0);
  1137.                 worldrenderer.func_178984_b(-1.0, f10, -1.0);
  1138.                 worldrenderer.func_178984_b(1.0, -1.0, -1.0);
  1139.                 worldrenderer.func_178984_b(1.0, -1.0, 1.0);
  1140.                 worldrenderer.func_178984_b(1.0, f10, 1.0);
  1141.                 worldrenderer.func_178984_b(1.0, f10, -1.0);
  1142.                 worldrenderer.func_178984_b(-1.0, f10, -1.0);
  1143.                 worldrenderer.func_178984_b(-1.0, f10, 1.0);
  1144.                 worldrenderer.func_178984_b(-1.0, -1.0, 1.0);
  1145.                 worldrenderer.func_178984_b(-1.0, -1.0, -1.0);
  1146.                 worldrenderer.func_178984_b(-1.0, -1.0, -1.0);
  1147.                 worldrenderer.func_178984_b(-1.0, -1.0, 1.0);
  1148.                 worldrenderer.func_178984_b(1.0, -1.0, 1.0);
  1149.                 worldrenderer.func_178984_b(1.0, -1.0, -1.0);
  1150.                 tessellator.func_78381_a();
  1151.             }
  1152.             if (this.field_72769_h.field_73011_w.func_76561_g()) {
  1153.                 GlStateManager.func_179124_c(f1 * 0.2f + 0.04f, f2 * 0.2f + 0.04f, f3 * 0.6f + 0.1f);
  1154.             } else {
  1155.                 GlStateManager.func_179124_c(f1, f2, f3);
  1156.             }
  1157.             GlStateManager.func_179094_E();
  1158.             GlStateManager.func_179109_b(0.0f, - (float)(d0 - 16.0), 0.0f);
  1159.             GlStateManager.func_179148_o(this.field_72781_x);
  1160.             GlStateManager.func_179121_F();
  1161.             GlStateManager.func_179098_w();
  1162.             GlStateManager.func_179132_a(true);
  1163.         }
  1164.     }
  1165.  
  1166.     public void func_180447_b(float p_180447_1_, int p_180447_2_) {
  1167.         IRenderHandler renderer = this.field_72777_q.field_71441_e.field_73011_w.getCloudRenderer();
  1168.         if (renderer != null) {
  1169.             renderer.render(p_180447_1_, this.field_72777_q.field_71441_e, this.field_72777_q);
  1170.             return;
  1171.         }
  1172.         if (this.field_72777_q.field_71441_e.field_73011_w.func_76569_d()) {
  1173.             if (this.field_72777_q.field_71474_y.field_74347_j) {
  1174.                 this.func_180445_c(p_180447_1_, p_180447_2_);
  1175.             } else {
  1176.                 float f5;
  1177.                 GlStateManager.func_179129_p();
  1178.                 float f1 = (float)(this.field_72777_q.func_175606_aa().field_70137_T + (this.field_72777_q.func_175606_aa().field_70163_u - this.field_72777_q.func_175606_aa().field_70137_T) * (double)p_180447_1_);
  1179.                 boolean flag = true;
  1180.                 boolean flag1 = true;
  1181.                 Tessellator tessellator = Tessellator.func_178181_a();
  1182.                 WorldRenderer worldrenderer = tessellator.func_178180_c();
  1183.                 this.field_72770_i.func_110577_a(field_110925_j);
  1184.                 GlStateManager.func_179147_l();
  1185.                 GlStateManager.func_179120_a(770, 771, 1, 0);
  1186.                 Vec3 vec3 = this.field_72769_h.func_72824_f(p_180447_1_);
  1187.                 float f2 = (float)vec3.field_72450_a;
  1188.                 float f3 = (float)vec3.field_72448_b;
  1189.                 float f4 = (float)vec3.field_72449_c;
  1190.                 if (p_180447_2_ != 2) {
  1191.                     f5 = (f2 * 30.0f + f3 * 59.0f + f4 * 11.0f) / 100.0f;
  1192.                     float f6 = (f2 * 30.0f + f3 * 70.0f) / 100.0f;
  1193.                     float f7 = (f2 * 30.0f + f4 * 70.0f) / 100.0f;
  1194.                     f2 = f5;
  1195.                     f3 = f6;
  1196.                     f4 = f7;
  1197.                 }
  1198.                 f5 = 4.8828125E-4f;
  1199.                 double d2 = (float)this.field_72773_u + p_180447_1_;
  1200.                 double d0 = this.field_72777_q.func_175606_aa().field_70169_q + (this.field_72777_q.func_175606_aa().field_70165_t - this.field_72777_q.func_175606_aa().field_70169_q) * (double)p_180447_1_ + d2 * 0.029999999329447746;
  1201.                 double d1 = this.field_72777_q.func_175606_aa().field_70166_s + (this.field_72777_q.func_175606_aa().field_70161_v - this.field_72777_q.func_175606_aa().field_70166_s) * (double)p_180447_1_;
  1202.                 int j = MathHelper.func_76128_c(d0 / 2048.0);
  1203.                 int k = MathHelper.func_76128_c(d1 / 2048.0);
  1204.                 float f8 = this.field_72769_h.field_73011_w.func_76571_f() - f1 + 0.33f;
  1205.                 float f9 = (float)((d0 -= (double)(j * 2048)) * 4.8828125E-4);
  1206.                 float f10 = (float)((d1 -= (double)(k * 2048)) * 4.8828125E-4);
  1207.                 worldrenderer.func_178970_b();
  1208.                 worldrenderer.func_178960_a(f2, f3, f4, 0.8f);
  1209.                 for (int l = -256; l < 256; l += 32) {
  1210.                     for (int i1 = -256; i1 < 256; i1 += 32) {
  1211.                         worldrenderer.func_178985_a(l + 0, f8, i1 + 32, (float)(l + 0) * 4.8828125E-4f + f9, (float)(i1 + 32) * 4.8828125E-4f + f10);
  1212.                         worldrenderer.func_178985_a(l + 32, f8, i1 + 32, (float)(l + 32) * 4.8828125E-4f + f9, (float)(i1 + 32) * 4.8828125E-4f + f10);
  1213.                         worldrenderer.func_178985_a(l + 32, f8, i1 + 0, (float)(l + 32) * 4.8828125E-4f + f9, (float)(i1 + 0) * 4.8828125E-4f + f10);
  1214.                         worldrenderer.func_178985_a(l + 0, f8, i1 + 0, (float)(l + 0) * 4.8828125E-4f + f9, (float)(i1 + 0) * 4.8828125E-4f + f10);
  1215.                     }
  1216.                 }
  1217.                 tessellator.func_78381_a();
  1218.                 GlStateManager.func_179131_c(1.0f, 1.0f, 1.0f, 1.0f);
  1219.                 GlStateManager.func_179084_k();
  1220.                 GlStateManager.func_179089_o();
  1221.             }
  1222.         }
  1223.     }
  1224.  
  1225.     public boolean func_72721_a(double p_72721_1_, double p_72721_3_, double p_72721_5_, float p_72721_7_) {
  1226.         return false;
  1227.     }
  1228.  
  1229.     private void func_180445_c(float p_180445_1_, int p_180445_2_) {
  1230.         float f9;
  1231.         float f8;
  1232.         float f10;
  1233.         GlStateManager.func_179129_p();
  1234.         float f1 = (float)(this.field_72777_q.func_175606_aa().field_70137_T + (this.field_72777_q.func_175606_aa().field_70163_u - this.field_72777_q.func_175606_aa().field_70137_T) * (double)p_180445_1_);
  1235.         Tessellator tessellator = Tessellator.func_178181_a();
  1236.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  1237.         float f2 = 12.0f;
  1238.         float f3 = 4.0f;
  1239.         double d0 = (float)this.field_72773_u + p_180445_1_;
  1240.         double d1 = (this.field_72777_q.func_175606_aa().field_70169_q + (this.field_72777_q.func_175606_aa().field_70165_t - this.field_72777_q.func_175606_aa().field_70169_q) * (double)p_180445_1_ + d0 * 0.029999999329447746) / 12.0;
  1241.         double d2 = (this.field_72777_q.func_175606_aa().field_70166_s + (this.field_72777_q.func_175606_aa().field_70161_v - this.field_72777_q.func_175606_aa().field_70166_s) * (double)p_180445_1_) / 12.0 + 0.33000001311302185;
  1242.         float f4 = this.field_72769_h.field_73011_w.func_76571_f() - f1 + 0.33f;
  1243.         int j = MathHelper.func_76128_c(d1 / 2048.0);
  1244.         int k = MathHelper.func_76128_c(d2 / 2048.0);
  1245.         d1 -= (double)(j * 2048);
  1246.         d2 -= (double)(k * 2048);
  1247.         this.field_72770_i.func_110577_a(field_110925_j);
  1248.         GlStateManager.func_179147_l();
  1249.         GlStateManager.func_179120_a(770, 771, 1, 0);
  1250.         Vec3 vec3 = this.field_72769_h.func_72824_f(p_180445_1_);
  1251.         float f5 = (float)vec3.field_72450_a;
  1252.         float f6 = (float)vec3.field_72448_b;
  1253.         float f7 = (float)vec3.field_72449_c;
  1254.         if (p_180445_2_ != 2) {
  1255.             f8 = (f5 * 30.0f + f6 * 59.0f + f7 * 11.0f) / 100.0f;
  1256.             f9 = (f5 * 30.0f + f6 * 70.0f) / 100.0f;
  1257.             f10 = (f5 * 30.0f + f7 * 70.0f) / 100.0f;
  1258.             f5 = f8;
  1259.             f6 = f9;
  1260.             f7 = f10;
  1261.         }
  1262.         f8 = 0.00390625f;
  1263.         f9 = (float)MathHelper.func_76128_c(d1) * 0.00390625f;
  1264.         f10 = (float)MathHelper.func_76128_c(d2) * 0.00390625f;
  1265.         float f11 = (float)(d1 - (double)MathHelper.func_76128_c(d1));
  1266.         float f12 = (float)(d2 - (double)MathHelper.func_76128_c(d2));
  1267.         boolean flag = true;
  1268.         boolean flag1 = true;
  1269.         float f13 = 9.765625E-4f;
  1270.         GlStateManager.func_179152_a(12.0f, 1.0f, 12.0f);
  1271.         for (int l = 0; l < 2; ++l) {
  1272.             if (l == 0) {
  1273.                 GlStateManager.func_179135_a(false, false, false, false);
  1274.             } else {
  1275.                 switch (p_180445_2_) {
  1276.                     case 0: {
  1277.                         GlStateManager.func_179135_a(false, true, true, true);
  1278.                         break;
  1279.                     }
  1280.                     case 1: {
  1281.                         GlStateManager.func_179135_a(true, false, false, true);
  1282.                         break;
  1283.                     }
  1284.                     case 2: {
  1285.                         GlStateManager.func_179135_a(true, true, true, true);
  1286.                     }
  1287.                 }
  1288.             }
  1289.             for (int i1 = -3; i1 <= 4; ++i1) {
  1290.                 for (int j1 = -3; j1 <= 4; ++j1) {
  1291.                     int k1;
  1292.                     worldrenderer.func_178970_b();
  1293.                     float f14 = i1 * 8;
  1294.                     float f15 = j1 * 8;
  1295.                     float f16 = f14 - f11;
  1296.                     float f17 = f15 - f12;
  1297.                     if (f4 > -5.0f) {
  1298.                         worldrenderer.func_178960_a(f5 * 0.7f, f6 * 0.7f, f7 * 0.7f, 0.8f);
  1299.                         worldrenderer.func_178980_d(0.0f, -1.0f, 0.0f);
  1300.                         worldrenderer.func_178985_a(f16 + 0.0f, f4 + 0.0f, f17 + 8.0f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1301.                         worldrenderer.func_178985_a(f16 + 8.0f, f4 + 0.0f, f17 + 8.0f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1302.                         worldrenderer.func_178985_a(f16 + 8.0f, f4 + 0.0f, f17 + 0.0f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1303.                         worldrenderer.func_178985_a(f16 + 0.0f, f4 + 0.0f, f17 + 0.0f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1304.                     }
  1305.                     if (f4 <= 5.0f) {
  1306.                         worldrenderer.func_178960_a(f5, f6, f7, 0.8f);
  1307.                         worldrenderer.func_178980_d(0.0f, 1.0f, 0.0f);
  1308.                         worldrenderer.func_178985_a(f16 + 0.0f, f4 + 4.0f - 9.765625E-4f, f17 + 8.0f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1309.                         worldrenderer.func_178985_a(f16 + 8.0f, f4 + 4.0f - 9.765625E-4f, f17 + 8.0f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1310.                         worldrenderer.func_178985_a(f16 + 8.0f, f4 + 4.0f - 9.765625E-4f, f17 + 0.0f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1311.                         worldrenderer.func_178985_a(f16 + 0.0f, f4 + 4.0f - 9.765625E-4f, f17 + 0.0f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1312.                     }
  1313.                     worldrenderer.func_178960_a(f5 * 0.9f, f6 * 0.9f, f7 * 0.9f, 0.8f);
  1314.                     if (i1 > -1) {
  1315.                         worldrenderer.func_178980_d(-1.0f, 0.0f, 0.0f);
  1316.                         for (k1 = 0; k1 < 8; ++k1) {
  1317.                             worldrenderer.func_178985_a(f16 + (float)k1 + 0.0f, f4 + 0.0f, f17 + 8.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1318.                             worldrenderer.func_178985_a(f16 + (float)k1 + 0.0f, f4 + 4.0f, f17 + 8.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1319.                             worldrenderer.func_178985_a(f16 + (float)k1 + 0.0f, f4 + 4.0f, f17 + 0.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1320.                             worldrenderer.func_178985_a(f16 + (float)k1 + 0.0f, f4 + 0.0f, f17 + 0.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1321.                         }
  1322.                     }
  1323.                     if (i1 <= 1) {
  1324.                         worldrenderer.func_178980_d(1.0f, 0.0f, 0.0f);
  1325.                         for (k1 = 0; k1 < 8; ++k1) {
  1326.                             worldrenderer.func_178985_a(f16 + (float)k1 + 1.0f - 9.765625E-4f, f4 + 0.0f, f17 + 8.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1327.                             worldrenderer.func_178985_a(f16 + (float)k1 + 1.0f - 9.765625E-4f, f4 + 4.0f, f17 + 8.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 8.0f) * 0.00390625f + f10);
  1328.                             worldrenderer.func_178985_a(f16 + (float)k1 + 1.0f - 9.765625E-4f, f4 + 4.0f, f17 + 0.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1329.                             worldrenderer.func_178985_a(f16 + (float)k1 + 1.0f - 9.765625E-4f, f4 + 0.0f, f17 + 0.0f, (f14 + (float)k1 + 0.5f) * 0.00390625f + f9, (f15 + 0.0f) * 0.00390625f + f10);
  1330.                         }
  1331.                     }
  1332.                     worldrenderer.func_178960_a(f5 * 0.8f, f6 * 0.8f, f7 * 0.8f, 0.8f);
  1333.                     if (j1 > -1) {
  1334.                         worldrenderer.func_178980_d(0.0f, 0.0f, -1.0f);
  1335.                         for (k1 = 0; k1 < 8; ++k1) {
  1336.                             worldrenderer.func_178985_a(f16 + 0.0f, f4 + 4.0f, f17 + (float)k1 + 0.0f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1337.                             worldrenderer.func_178985_a(f16 + 8.0f, f4 + 4.0f, f17 + (float)k1 + 0.0f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1338.                             worldrenderer.func_178985_a(f16 + 8.0f, f4 + 0.0f, f17 + (float)k1 + 0.0f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1339.                             worldrenderer.func_178985_a(f16 + 0.0f, f4 + 0.0f, f17 + (float)k1 + 0.0f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1340.                         }
  1341.                     }
  1342.                     if (j1 <= 1) {
  1343.                         worldrenderer.func_178980_d(0.0f, 0.0f, 1.0f);
  1344.                         for (k1 = 0; k1 < 8; ++k1) {
  1345.                             worldrenderer.func_178985_a(f16 + 0.0f, f4 + 4.0f, f17 + (float)k1 + 1.0f - 9.765625E-4f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1346.                             worldrenderer.func_178985_a(f16 + 8.0f, f4 + 4.0f, f17 + (float)k1 + 1.0f - 9.765625E-4f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1347.                             worldrenderer.func_178985_a(f16 + 8.0f, f4 + 0.0f, f17 + (float)k1 + 1.0f - 9.765625E-4f, (f14 + 8.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1348.                             worldrenderer.func_178985_a(f16 + 0.0f, f4 + 0.0f, f17 + (float)k1 + 1.0f - 9.765625E-4f, (f14 + 0.0f) * 0.00390625f + f9, (f15 + (float)k1 + 0.5f) * 0.00390625f + f10);
  1349.                         }
  1350.                     }
  1351.                     tessellator.func_78381_a();
  1352.                 }
  1353.             }
  1354.         }
  1355.         GlStateManager.func_179131_c(1.0f, 1.0f, 1.0f, 1.0f);
  1356.         GlStateManager.func_179084_k();
  1357.         GlStateManager.func_179089_o();
  1358.     }
  1359.  
  1360.     public void func_174967_a(long l) {
  1361.         void p_174967_1_;
  1362.         RenderChunk renderchunk;
  1363.         RenderGlobal renderGlobal;
  1364.         CallbackInfo callbackInfo = new CallbackInfo("func_174967_a", true);
  1365.         renderGlobal.replayModRender_updateChunks(l, callbackInfo);
  1366.         if (callbackInfo.isCancelled()) {
  1367.             return;
  1368.         }
  1369.         this.field_147595_R |= this.field_174995_M.func_178516_a((long)p_174967_1_);
  1370.         Iterator iterator = this.field_175009_l.iterator();
  1371.         while (iterator.hasNext() && this.field_174995_M.func_178507_a(renderchunk = (RenderChunk)iterator.next())) {
  1372.             renderchunk.func_178575_a(false);
  1373.             iterator.remove();
  1374.         }
  1375.     }
  1376.  
  1377.     public void func_180449_a(Entity p_180449_1_, float p_180449_2_) {
  1378.         Tessellator tessellator = Tessellator.func_178181_a();
  1379.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  1380.         WorldBorder worldborder = this.field_72769_h.func_175723_af();
  1381.         double d0 = this.field_72777_q.field_71474_y.field_151451_c * 16;
  1382.         if (p_180449_1_.field_70165_t >= worldborder.func_177728_d() - d0 || p_180449_1_.field_70165_t <= worldborder.func_177726_b() + d0 || p_180449_1_.field_70161_v >= worldborder.func_177733_e() - d0 || p_180449_1_.field_70161_v <= worldborder.func_177736_c() + d0) {
  1383.             float f9;
  1384.             double d7;
  1385.             float f8;
  1386.             double d8;
  1387.             double d1 = 1.0 - worldborder.func_177745_a(p_180449_1_) / d0;
  1388.             d1 = Math.pow(d1, 4.0);
  1389.             double d2 = p_180449_1_.field_70142_S + (p_180449_1_.field_70165_t - p_180449_1_.field_70142_S) * (double)p_180449_2_;
  1390.             double d3 = p_180449_1_.field_70137_T + (p_180449_1_.field_70163_u - p_180449_1_.field_70137_T) * (double)p_180449_2_;
  1391.             double d4 = p_180449_1_.field_70136_U + (p_180449_1_.field_70161_v - p_180449_1_.field_70136_U) * (double)p_180449_2_;
  1392.             GlStateManager.func_179147_l();
  1393.             GlStateManager.func_179120_a(770, 1, 1, 0);
  1394.             this.field_72770_i.func_110577_a(field_175006_g);
  1395.             GlStateManager.func_179132_a(false);
  1396.             GlStateManager.func_179094_E();
  1397.             int i = worldborder.func_177734_a().func_177766_a();
  1398.             float f1 = (float)(i >> 16 & 255) / 255.0f;
  1399.             float f2 = (float)(i >> 8 & 255) / 255.0f;
  1400.             float f3 = (float)(i & 255) / 255.0f;
  1401.             GlStateManager.func_179131_c(f1, f2, f3, (float)d1);
  1402.             GlStateManager.func_179136_a(-3.0f, -3.0f);
  1403.             GlStateManager.func_179088_q();
  1404.             GlStateManager.func_179092_a(516, 0.1f);
  1405.             GlStateManager.func_179141_d();
  1406.             GlStateManager.func_179129_p();
  1407.             float f4 = (float)(Minecraft.func_71386_F() % 3000) / 3000.0f;
  1408.             float f5 = 0.0f;
  1409.             float f6 = 0.0f;
  1410.             float f7 = 128.0f;
  1411.             worldrenderer.func_178970_b();
  1412.             worldrenderer.func_178969_c(- d2, - d3, - d4);
  1413.             worldrenderer.func_78914_f();
  1414.             double d5 = Math.max((double)MathHelper.func_76128_c(d4 - d0), worldborder.func_177736_c());
  1415.             double d6 = Math.min((double)MathHelper.func_76143_f(d4 + d0), worldborder.func_177733_e());
  1416.             if (d2 > worldborder.func_177728_d() - d0) {
  1417.                 f8 = 0.0f;
  1418.                 d7 = d5;
  1419.                 while (d7 < d6) {
  1420.                     d8 = Math.min(1.0, d6 - d7);
  1421.                     f9 = (float)d8 * 0.5f;
  1422.                     worldrenderer.func_178985_a(worldborder.func_177728_d(), 256.0, d7, f4 + f8, f4 + 0.0f);
  1423.                     worldrenderer.func_178985_a(worldborder.func_177728_d(), 256.0, d7 + d8, f4 + f9 + f8, f4 + 0.0f);
  1424.                     worldrenderer.func_178985_a(worldborder.func_177728_d(), 0.0, d7 + d8, f4 + f9 + f8, f4 + 128.0f);
  1425.                     worldrenderer.func_178985_a(worldborder.func_177728_d(), 0.0, d7, f4 + f8, f4 + 128.0f);
  1426.                     d7 += 1.0;
  1427.                     f8 += 0.5f;
  1428.                 }
  1429.             }
  1430.             if (d2 < worldborder.func_177726_b() + d0) {
  1431.                 f8 = 0.0f;
  1432.                 d7 = d5;
  1433.                 while (d7 < d6) {
  1434.                     d8 = Math.min(1.0, d6 - d7);
  1435.                     f9 = (float)d8 * 0.5f;
  1436.                     worldrenderer.func_178985_a(worldborder.func_177726_b(), 256.0, d7, f4 + f8, f4 + 0.0f);
  1437.                     worldrenderer.func_178985_a(worldborder.func_177726_b(), 256.0, d7 + d8, f4 + f9 + f8, f4 + 0.0f);
  1438.                     worldrenderer.func_178985_a(worldborder.func_177726_b(), 0.0, d7 + d8, f4 + f9 + f8, f4 + 128.0f);
  1439.                     worldrenderer.func_178985_a(worldborder.func_177726_b(), 0.0, d7, f4 + f8, f4 + 128.0f);
  1440.                     d7 += 1.0;
  1441.                     f8 += 0.5f;
  1442.                 }
  1443.             }
  1444.             d5 = Math.max((double)MathHelper.func_76128_c(d2 - d0), worldborder.func_177726_b());
  1445.             d6 = Math.min((double)MathHelper.func_76143_f(d2 + d0), worldborder.func_177728_d());
  1446.             if (d4 > worldborder.func_177733_e() - d0) {
  1447.                 f8 = 0.0f;
  1448.                 d7 = d5;
  1449.                 while (d7 < d6) {
  1450.                     d8 = Math.min(1.0, d6 - d7);
  1451.                     f9 = (float)d8 * 0.5f;
  1452.                     worldrenderer.func_178985_a(d7, 256.0, worldborder.func_177733_e(), f4 + f8, f4 + 0.0f);
  1453.                     worldrenderer.func_178985_a(d7 + d8, 256.0, worldborder.func_177733_e(), f4 + f9 + f8, f4 + 0.0f);
  1454.                     worldrenderer.func_178985_a(d7 + d8, 0.0, worldborder.func_177733_e(), f4 + f9 + f8, f4 + 128.0f);
  1455.                     worldrenderer.func_178985_a(d7, 0.0, worldborder.func_177733_e(), f4 + f8, f4 + 128.0f);
  1456.                     d7 += 1.0;
  1457.                     f8 += 0.5f;
  1458.                 }
  1459.             }
  1460.             if (d4 < worldborder.func_177736_c() + d0) {
  1461.                 f8 = 0.0f;
  1462.                 d7 = d5;
  1463.                 while (d7 < d6) {
  1464.                     d8 = Math.min(1.0, d6 - d7);
  1465.                     f9 = (float)d8 * 0.5f;
  1466.                     worldrenderer.func_178985_a(d7, 256.0, worldborder.func_177736_c(), f4 + f8, f4 + 0.0f);
  1467.                     worldrenderer.func_178985_a(d7 + d8, 256.0, worldborder.func_177736_c(), f4 + f9 + f8, f4 + 0.0f);
  1468.                     worldrenderer.func_178985_a(d7 + d8, 0.0, worldborder.func_177736_c(), f4 + f9 + f8, f4 + 128.0f);
  1469.                     worldrenderer.func_178985_a(d7, 0.0, worldborder.func_177736_c(), f4 + f8, f4 + 128.0f);
  1470.                     d7 += 1.0;
  1471.                     f8 += 0.5f;
  1472.                 }
  1473.             }
  1474.             tessellator.func_78381_a();
  1475.             worldrenderer.func_178969_c(0.0, 0.0, 0.0);
  1476.             GlStateManager.func_179089_o();
  1477.             GlStateManager.func_179118_c();
  1478.             GlStateManager.func_179136_a(0.0f, 0.0f);
  1479.             GlStateManager.func_179113_r();
  1480.             GlStateManager.func_179141_d();
  1481.             GlStateManager.func_179084_k();
  1482.             GlStateManager.func_179121_F();
  1483.             GlStateManager.func_179132_a(true);
  1484.         }
  1485.     }
  1486.  
  1487.     private void func_180443_s() {
  1488.         GlStateManager.func_179120_a(774, 768, 1, 0);
  1489.         GlStateManager.func_179147_l();
  1490.         GlStateManager.func_179131_c(1.0f, 1.0f, 1.0f, 0.5f);
  1491.         GlStateManager.func_179136_a(-3.0f, -3.0f);
  1492.         GlStateManager.func_179088_q();
  1493.         GlStateManager.func_179092_a(516, 0.1f);
  1494.         GlStateManager.func_179141_d();
  1495.         GlStateManager.func_179094_E();
  1496.     }
  1497.  
  1498.     private void func_174969_t() {
  1499.         GlStateManager.func_179118_c();
  1500.         GlStateManager.func_179136_a(0.0f, 0.0f);
  1501.         GlStateManager.func_179113_r();
  1502.         GlStateManager.func_179141_d();
  1503.         GlStateManager.func_179132_a(true);
  1504.         GlStateManager.func_179121_F();
  1505.     }
  1506.  
  1507.     public void func_174981_a(Tessellator p_174981_1_, WorldRenderer p_174981_2_, Entity p_174981_3_, float p_174981_4_) {
  1508.         double d0 = p_174981_3_.field_70142_S + (p_174981_3_.field_70165_t - p_174981_3_.field_70142_S) * (double)p_174981_4_;
  1509.         double d1 = p_174981_3_.field_70137_T + (p_174981_3_.field_70163_u - p_174981_3_.field_70137_T) * (double)p_174981_4_;
  1510.         double d2 = p_174981_3_.field_70136_U + (p_174981_3_.field_70161_v - p_174981_3_.field_70136_U) * (double)p_174981_4_;
  1511.         if (!this.field_72738_E.isEmpty()) {
  1512.             this.field_72770_i.func_110577_a(TextureMap.field_110575_b);
  1513.             this.func_180443_s();
  1514.             p_174981_2_.func_178970_b();
  1515.             p_174981_2_.func_178967_a(DefaultVertexFormats.field_176600_a);
  1516.             p_174981_2_.func_178969_c(- d0, - d1, - d2);
  1517.             p_174981_2_.func_78914_f();
  1518.             Iterator iterator = this.field_72738_E.values().iterator();
  1519.             while (iterator.hasNext()) {
  1520.                 boolean hasBreak;
  1521.                 DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)iterator.next();
  1522.                 BlockPos blockpos = destroyblockprogress.func_180246_b();
  1523.                 double d3 = (double)blockpos.func_177958_n() - d0;
  1524.                 double d4 = (double)blockpos.func_177956_o() - d1;
  1525.                 double d5 = (double)blockpos.func_177952_p() - d2;
  1526.                 Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
  1527.                 TileEntity te = this.field_72769_h.func_175625_s(blockpos);
  1528.                 boolean bl = hasBreak = block instanceof BlockChest || block instanceof BlockEnderChest || block instanceof BlockSign || block instanceof BlockSkull;
  1529.                 if (!hasBreak) {
  1530.                     boolean bl2 = hasBreak = te != null && te.canRenderBreaking();
  1531.                 }
  1532.                 if (hasBreak) continue;
  1533.                 if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0) {
  1534.                     iterator.remove();
  1535.                     continue;
  1536.                 }
  1537.                 IBlockState iblockstate = this.field_72769_h.func_180495_p(blockpos);
  1538.                 if (iblockstate.func_177230_c().func_149688_o() == Material.field_151579_a) continue;
  1539.                 int i = destroyblockprogress.func_73106_e();
  1540.                 TextureAtlasSprite textureatlassprite = this.field_94141_F[i];
  1541.                 BlockRendererDispatcher blockrendererdispatcher = this.field_72777_q.func_175602_ab();
  1542.                 blockrendererdispatcher.func_175020_a(iblockstate, blockpos, textureatlassprite, this.field_72769_h);
  1543.             }
  1544.             p_174981_1_.func_78381_a();
  1545.             p_174981_2_.func_178969_c(0.0, 0.0, 0.0);
  1546.             this.func_174969_t();
  1547.         }
  1548.     }
  1549.  
  1550.     public void func_72731_b(EntityPlayer p_72731_1_, MovingObjectPosition p_72731_2_, int p_72731_3_, float p_72731_4_) {
  1551.         if (p_72731_3_ == 0 && p_72731_2_.field_72313_a == MovingObjectPosition.MovingObjectType.BLOCK) {
  1552.             GlStateManager.func_179147_l();
  1553.             GlStateManager.func_179120_a(770, 771, 1, 0);
  1554.             GlStateManager.func_179131_c(0.0f, 0.0f, 0.0f, 0.4f);
  1555.             GL11.glLineWidth((float)2.0f);
  1556.             GlStateManager.func_179090_x();
  1557.             GlStateManager.func_179132_a(false);
  1558.             float f1 = 0.002f;
  1559.             BlockPos blockpos = p_72731_2_.func_178782_a();
  1560.             Block block = this.field_72769_h.func_180495_p(blockpos).func_177230_c();
  1561.             if (block.func_149688_o() != Material.field_151579_a && this.field_72769_h.func_175723_af().func_177746_a(blockpos)) {
  1562.                 block.func_180654_a(this.field_72769_h, blockpos);
  1563.                 double d0 = p_72731_1_.field_70142_S + (p_72731_1_.field_70165_t - p_72731_1_.field_70142_S) * (double)p_72731_4_;
  1564.                 double d1 = p_72731_1_.field_70137_T + (p_72731_1_.field_70163_u - p_72731_1_.field_70137_T) * (double)p_72731_4_;
  1565.                 double d2 = p_72731_1_.field_70136_U + (p_72731_1_.field_70161_v - p_72731_1_.field_70136_U) * (double)p_72731_4_;
  1566.                 RenderGlobal.func_147590_a(block.func_180646_a(this.field_72769_h, blockpos).func_72314_b(0.0020000000949949026, 0.0020000000949949026, 0.0020000000949949026).func_72317_d(- d0, - d1, - d2), -1);
  1567.             }
  1568.             GlStateManager.func_179132_a(true);
  1569.             GlStateManager.func_179098_w();
  1570.             GlStateManager.func_179084_k();
  1571.         }
  1572.     }
  1573.  
  1574.     public static void func_147590_a(AxisAlignedBB boundingBox, int p_147590_1_) {
  1575.         Tessellator tessellator = Tessellator.func_178181_a();
  1576.         WorldRenderer worldrenderer = tessellator.func_178180_c();
  1577.         worldrenderer.func_178964_a(3);
  1578.         if (p_147590_1_ != -1) {
  1579.             worldrenderer.func_178991_c(p_147590_1_);
  1580.         }
  1581.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72338_b, boundingBox.field_72339_c);
  1582.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72338_b, boundingBox.field_72339_c);
  1583.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72338_b, boundingBox.field_72334_f);
  1584.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72338_b, boundingBox.field_72334_f);
  1585.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72338_b, boundingBox.field_72339_c);
  1586.         tessellator.func_78381_a();
  1587.         worldrenderer.func_178964_a(3);
  1588.         if (p_147590_1_ != -1) {
  1589.             worldrenderer.func_178991_c(p_147590_1_);
  1590.         }
  1591.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72337_e, boundingBox.field_72339_c);
  1592.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72337_e, boundingBox.field_72339_c);
  1593.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72337_e, boundingBox.field_72334_f);
  1594.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72337_e, boundingBox.field_72334_f);
  1595.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72337_e, boundingBox.field_72339_c);
  1596.         tessellator.func_78381_a();
  1597.         worldrenderer.func_178964_a(1);
  1598.         if (p_147590_1_ != -1) {
  1599.             worldrenderer.func_178991_c(p_147590_1_);
  1600.         }
  1601.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72338_b, boundingBox.field_72339_c);
  1602.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72337_e, boundingBox.field_72339_c);
  1603.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72338_b, boundingBox.field_72339_c);
  1604.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72337_e, boundingBox.field_72339_c);
  1605.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72338_b, boundingBox.field_72334_f);
  1606.         worldrenderer.func_178984_b(boundingBox.field_72336_d, boundingBox.field_72337_e, boundingBox.field_72334_f);
  1607.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72338_b, boundingBox.field_72334_f);
  1608.         worldrenderer.func_178984_b(boundingBox.field_72340_a, boundingBox.field_72337_e, boundingBox.field_72334_f);
  1609.         tessellator.func_78381_a();
  1610.     }
  1611.  
  1612.     private void func_72725_b(int p_72725_1_, int p_72725_2_, int p_72725_3_, int p_72725_4_, int p_72725_5_, int p_72725_6_) {
  1613.         this.field_175008_n.func_178162_a(p_72725_1_, p_72725_2_, p_72725_3_, p_72725_4_, p_72725_5_, p_72725_6_);
  1614.     }
  1615.  
  1616.     @Override
  1617.     public void func_174960_a(BlockPos pos) {
  1618.         int i = pos.func_177958_n();
  1619.         int j = pos.func_177956_o();
  1620.         int k = pos.func_177952_p();
  1621.         this.func_72725_b(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1);
  1622.     }
  1623.  
  1624.     @Override
  1625.     public void func_174959_b(BlockPos pos) {
  1626.         int i = pos.func_177958_n();
  1627.         int j = pos.func_177956_o();
  1628.         int k = pos.func_177952_p();
  1629.         this.func_72725_b(i - 1, j - 1, k - 1, i + 1, j + 1, k + 1);
  1630.     }
  1631.  
  1632.     @Override
  1633.     public void func_147585_a(int x1, int y1, int z1, int x2, int y2, int z2) {
  1634.         this.func_72725_b(x1 - 1, y1 - 1, z1 - 1, x2 + 1, y2 + 1, z2 + 1);
  1635.     }
  1636.  
  1637.     @Override
  1638.     public void func_174961_a(String recordName, BlockPos blockPosIn) {
  1639.         ISound isound = (ISound)this.field_147593_P.get(blockPosIn);
  1640.         if (isound != null) {
  1641.             this.field_72777_q.func_147118_V().func_147683_b(isound);
  1642.             this.field_147593_P.remove(blockPosIn);
  1643.         }
  1644.         if (recordName != null) {
  1645.             ItemRecord itemrecord = ItemRecord.func_150926_b(recordName);
  1646.             ResourceLocation resource = null;
  1647.             if (itemrecord != null) {
  1648.                 this.field_72777_q.field_71456_v.func_73833_a(itemrecord.func_150927_i());
  1649.                 resource = itemrecord.getRecordResource(recordName);
  1650.             }
  1651.             if (resource == null) {
  1652.                 resource = new ResourceLocation(recordName);
  1653.             }
  1654.             PositionedSoundRecord positionedsoundrecord = PositionedSoundRecord.func_147675_a(resource, blockPosIn.func_177958_n(), blockPosIn.func_177956_o(), blockPosIn.func_177952_p());
  1655.             this.field_147593_P.put(blockPosIn, positionedsoundrecord);
  1656.             this.field_72777_q.func_147118_V().func_147682_a(positionedsoundrecord);
  1657.         }
  1658.     }
  1659.  
  1660.     @Override
  1661.     public void func_72704_a(String soundName, double x, double y, double z, float volume, float pitch) {
  1662.     }
  1663.  
  1664.     @Override
  1665.     public void func_85102_a(EntityPlayer except, String soundName, double x, double y, double z, float volume, float pitch) {
  1666.     }
  1667.  
  1668.     @Override
  1669.     public /* varargs */ void func_180442_a(int p_180442_1_, boolean p_180442_2_, final double p_180442_3_, final double p_180442_5_, final double p_180442_7_, double p_180442_9_, double p_180442_11_, double p_180442_13_, int ... p_180442_15_) {
  1670.         try {
  1671.             this.func_174974_b(p_180442_1_, p_180442_2_, p_180442_3_, p_180442_5_, p_180442_7_, p_180442_9_, p_180442_11_, p_180442_13_, p_180442_15_);
  1672.         }
  1673.         catch (Throwable throwable) {
  1674.             CrashReport crashreport = CrashReport.func_85055_a(throwable, "Exception while adding particle");
  1675.             CrashReportCategory crashreportcategory = crashreport.func_85058_a("Particle being added");
  1676.             crashreportcategory.func_71507_a("ID", p_180442_1_);
  1677.             if (p_180442_15_ != null) {
  1678.                 crashreportcategory.func_71507_a("Parameters", p_180442_15_);
  1679.             }
  1680.             crashreportcategory.func_71500_a("Position", new Callable(){
  1681.                 private static final String __OBFID = "CL_00000955";
  1682.  
  1683.                 public String call() {
  1684.                     return CrashReportCategory.func_85074_a(p_180442_3_, p_180442_5_, p_180442_7_);
  1685.                 }
  1686.             });
  1687.             throw new ReportedException(crashreport);
  1688.         }
  1689.     }
  1690.  
  1691.     private /* varargs */ void func_174972_a(EnumParticleTypes particleIn, double p_174972_2_, double p_174972_4_, double p_174972_6_, double p_174972_8_, double p_174972_10_, double p_174972_12_, int ... p_174972_14_) {
  1692.         this.func_180442_a(particleIn.func_179348_c(), particleIn.func_179344_e(), p_174972_2_, p_174972_4_, p_174972_6_, p_174972_8_, p_174972_10_, p_174972_12_, p_174972_14_);
  1693.     }
  1694.  
  1695.     private /* varargs */ EntityFX func_174974_b(int p_174974_1_, boolean p_174974_2_, double p_174974_3_, double p_174974_5_, double p_174974_7_, double p_174974_9_, double p_174974_11_, double p_174974_13_, int ... p_174974_15_) {
  1696.         if (this.field_72777_q != null && this.field_72777_q.func_175606_aa() != null && this.field_72777_q.field_71452_i != null) {
  1697.             int k = this.field_72777_q.field_71474_y.field_74362_aa;
  1698.             if (k == 1 && this.field_72769_h.field_73012_v.nextInt(3) == 0) {
  1699.                 k = 2;
  1700.             }
  1701.             double d6 = this.field_72777_q.func_175606_aa().field_70165_t - p_174974_3_;
  1702.             double d7 = this.field_72777_q.func_175606_aa().field_70163_u - p_174974_5_;
  1703.             double d8 = this.field_72777_q.func_175606_aa().field_70161_v - p_174974_7_;
  1704.             if (p_174974_2_) {
  1705.                 return this.field_72777_q.field_71452_i.func_178927_a(p_174974_1_, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_);
  1706.             }
  1707.             double d9 = 16.0;
  1708.             return d6 * d6 + d7 * d7 + d8 * d8 > 256.0 ? null : (k > 1 ? null : this.field_72777_q.field_71452_i.func_178927_a(p_174974_1_, p_174974_3_, p_174974_5_, p_174974_7_, p_174974_9_, p_174974_11_, p_174974_13_, p_174974_15_));
  1709.         }
  1710.         return null;
  1711.     }
  1712.  
  1713.     @Override
  1714.     public void func_72703_a(Entity entityIn) {
  1715.     }
  1716.  
  1717.     @Override
  1718.     public void func_72709_b(Entity entityIn) {
  1719.     }
  1720.  
  1721.     public void func_72728_f() {
  1722.     }
  1723.  
  1724.     @Override
  1725.     public void func_180440_a(int p_180440_1_, BlockPos p_180440_2_, int p_180440_3_) {
  1726.         switch (p_180440_1_) {
  1727.             case 1013:
  1728.             case 1018: {
  1729.                 if (this.field_72777_q.func_175606_aa() == null) break;
  1730.                 double d0 = (double)p_180440_2_.func_177958_n() - this.field_72777_q.func_175606_aa().field_70165_t;
  1731.                 double d1 = (double)p_180440_2_.func_177956_o() - this.field_72777_q.func_175606_aa().field_70163_u;
  1732.                 double d2 = (double)p_180440_2_.func_177952_p() - this.field_72777_q.func_175606_aa().field_70161_v;
  1733.                 double d3 = Math.sqrt(d0 * d0 + d1 * d1 + d2 * d2);
  1734.                 double d4 = this.field_72777_q.func_175606_aa().field_70165_t;
  1735.                 double d5 = this.field_72777_q.func_175606_aa().field_70163_u;
  1736.                 double d6 = this.field_72777_q.func_175606_aa().field_70161_v;
  1737.                 if (d3 > 0.0) {
  1738.                     d4 += d0 / d3 * 2.0;
  1739.                     d5 += d1 / d3 * 2.0;
  1740.                     d6 += d2 / d3 * 2.0;
  1741.                 }
  1742.                 if (p_180440_1_ == 1013) {
  1743.                     this.field_72769_h.func_72980_b(d4, d5, d6, "mob.wither.spawn", 1.0f, 1.0f, false);
  1744.                     break;
  1745.                 }
  1746.                 this.field_72769_h.func_72980_b(d4, d5, d6, "mob.enderdragon.end", 5.0f, 1.0f, false);
  1747.             }
  1748.         }
  1749.     }
  1750.  
  1751.     @Override
  1752.     public void func_180439_a(EntityPlayer p_180439_1_, int p_180439_2_, BlockPos blockPosIn, int p_180439_4_) {
  1753.         Random random = this.field_72769_h.field_73012_v;
  1754.         switch (p_180439_2_) {
  1755.             case 1000: {
  1756.                 this.field_72769_h.func_175731_a(blockPosIn, "random.click", 1.0f, 1.0f, false);
  1757.                 break;
  1758.             }
  1759.             case 1001: {
  1760.                 this.field_72769_h.func_175731_a(blockPosIn, "random.click", 1.0f, 1.2f, false);
  1761.                 break;
  1762.             }
  1763.             case 1002: {
  1764.                 this.field_72769_h.func_175731_a(blockPosIn, "random.bow", 1.0f, 1.2f, false);
  1765.                 break;
  1766.             }
  1767.             case 1003: {
  1768.                 this.field_72769_h.func_175731_a(blockPosIn, "random.door_open", 1.0f, this.field_72769_h.field_73012_v.nextFloat() * 0.1f + 0.9f, false);
  1769.                 break;
  1770.             }
  1771.             case 1004: {
  1772.                 this.field_72769_h.func_175731_a(blockPosIn, "random.fizz", 0.5f, 2.6f + (random.nextFloat() - random.nextFloat()) * 0.8f, false);
  1773.                 break;
  1774.             }
  1775.             case 1005: {
  1776.                 if (Item.func_150899_d(p_180439_4_) instanceof ItemRecord) {
  1777.                     this.field_72769_h.func_175717_a(blockPosIn, "records." + ((ItemRecord)Item.func_150899_d((int)p_180439_4_)).field_150929_a);
  1778.                     break;
  1779.                 }
  1780.                 this.field_72769_h.func_175717_a(blockPosIn, null);
  1781.                 break;
  1782.             }
  1783.             case 1006: {
  1784.                 this.field_72769_h.func_175731_a(blockPosIn, "random.door_close", 1.0f, this.field_72769_h.field_73012_v.nextFloat() * 0.1f + 0.9f, false);
  1785.                 break;
  1786.             }
  1787.             case 1007: {
  1788.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.ghast.charge", 10.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1789.                 break;
  1790.             }
  1791.             case 1008: {
  1792.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.ghast.fireball", 10.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1793.                 break;
  1794.             }
  1795.             case 1009: {
  1796.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.ghast.fireball", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1797.                 break;
  1798.             }
  1799.             case 1010: {
  1800.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.zombie.wood", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1801.                 break;
  1802.             }
  1803.             case 1011: {
  1804.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.zombie.metal", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1805.                 break;
  1806.             }
  1807.             case 1012: {
  1808.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.zombie.woodbreak", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1809.                 break;
  1810.             }
  1811.             case 1014: {
  1812.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.wither.shoot", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1813.                 break;
  1814.             }
  1815.             case 1015: {
  1816.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.bat.takeoff", 0.05f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1817.                 break;
  1818.             }
  1819.             case 1016: {
  1820.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.zombie.infect", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1821.                 break;
  1822.             }
  1823.             case 1017: {
  1824.                 this.field_72769_h.func_175731_a(blockPosIn, "mob.zombie.unfect", 2.0f, (random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f, false);
  1825.                 break;
  1826.             }
  1827.             case 1020: {
  1828.                 this.field_72769_h.func_175731_a(blockPosIn, "random.anvil_break", 1.0f, this.field_72769_h.field_73012_v.nextFloat() * 0.1f + 0.9f, false);
  1829.                 break;
  1830.             }
  1831.             case 1021: {
  1832.                 this.field_72769_h.func_175731_a(blockPosIn, "random.anvil_use", 1.0f, this.field_72769_h.field_73012_v.nextFloat() * 0.1f + 0.9f, false);
  1833.                 break;
  1834.             }
  1835.             case 1022: {
  1836.                 this.field_72769_h.func_175731_a(blockPosIn, "random.anvil_land", 0.3f, this.field_72769_h.field_73012_v.nextFloat() * 0.1f + 0.9f, false);
  1837.                 break;
  1838.             }
  1839.             case 2000: {
  1840.                 int j1 = p_180439_4_ % 3 - 1;
  1841.                 int k = p_180439_4_ / 3 % 3 - 1;
  1842.                 double d1 = (double)blockPosIn.func_177958_n() + (double)j1 * 0.6 + 0.5;
  1843.                 double d2 = (double)blockPosIn.func_177956_o() + 0.5;
  1844.                 double d13 = (double)blockPosIn.func_177952_p() + (double)k * 0.6 + 0.5;
  1845.                 for (int k1 = 0; k1 < 10; ++k1) {
  1846.                     double d14 = random.nextDouble() * 0.2 + 0.01;
  1847.                     double d15 = d1 + (double)j1 * 0.01 + (random.nextDouble() - 0.5) * (double)k * 0.5;
  1848.                     double d4 = d2 + (random.nextDouble() - 0.5) * 0.5;
  1849.                     double d6 = d13 + (double)k * 0.01 + (random.nextDouble() - 0.5) * (double)j1 * 0.5;
  1850.                     double d8 = (double)j1 * d14 + random.nextGaussian() * 0.01;
  1851.                     double d10 = -0.03 + random.nextGaussian() * 0.01;
  1852.                     double d12 = (double)k * d14 + random.nextGaussian() * 0.01;
  1853.                     this.func_174972_a(EnumParticleTypes.SMOKE_NORMAL, d15, d4, d6, d8, d10, d12, new int[0]);
  1854.                 }
  1855.                 return;
  1856.             }
  1857.             case 2001: {
  1858.                 Block block = Block.func_149729_e(p_180439_4_ & 4095);
  1859.                 if (block.func_149688_o() != Material.field_151579_a) {
  1860.                     this.field_72777_q.func_147118_V().func_147682_a(new PositionedSoundRecord(new ResourceLocation(block.field_149762_H.func_150495_a()), (block.field_149762_H.func_150497_c() + 1.0f) / 2.0f, block.field_149762_H.func_150494_d() * 0.8f, (float)blockPosIn.func_177958_n() + 0.5f, (float)blockPosIn.func_177956_o() + 0.5f, (float)blockPosIn.func_177952_p() + 0.5f));
  1861.                 }
  1862.                 this.field_72777_q.field_71452_i.func_180533_a(blockPosIn, block.func_176203_a(p_180439_4_ >> 12 & 255));
  1863.                 break;
  1864.             }
  1865.             case 2002: {
  1866.                 int l;
  1867.                 double d0 = blockPosIn.func_177958_n();
  1868.                 double d1 = blockPosIn.func_177956_o();
  1869.                 double d2 = blockPosIn.func_177952_p();
  1870.                 for (l = 0; l < 8; ++l) {
  1871.                     this.func_174972_a(EnumParticleTypes.ITEM_CRACK, d0, d1, d2, random.nextGaussian() * 0.15, random.nextDouble() * 0.2, random.nextGaussian() * 0.15, Item.func_150891_b(Items.field_151068_bn), p_180439_4_);
  1872.                 }
  1873.                 l = Items.field_151068_bn.func_77620_a(p_180439_4_);
  1874.                 float f = (float)(l >> 16 & 255) / 255.0f;
  1875.                 float f1 = (float)(l >> 8 & 255) / 255.0f;
  1876.                 float f2 = (float)(l >> 0 & 255) / 255.0f;
  1877.                 EnumParticleTypes enumparticletypes = EnumParticleTypes.SPELL;
  1878.                 if (Items.field_151068_bn.func_77833_h(p_180439_4_)) {
  1879.                     enumparticletypes = EnumParticleTypes.SPELL_INSTANT;
  1880.                 }
  1881.                 for (int i1 = 0; i1 < 100; ++i1) {
  1882.                     double d3 = random.nextDouble() * 4.0;
  1883.                     double d5 = random.nextDouble() * 3.141592653589793 * 2.0;
  1884.                     double d7 = Math.cos(d5) * d3;
  1885.                     double d9 = 0.01 + random.nextDouble() * 0.5;
  1886.                     double d11 = Math.sin(d5) * d3;
  1887.                     EntityFX entityfx = this.func_174974_b(enumparticletypes.func_179348_c(), enumparticletypes.func_179344_e(), d0 + d7 * 0.1, d1 + 0.3, d2 + d11 * 0.1, d7, d9, d11, new int[0]);
  1888.                     if (entityfx == null) continue;
  1889.                     float f3 = 0.75f + random.nextFloat() * 0.25f;
  1890.                     entityfx.func_70538_b(f * f3, f1 * f3, f2 * f3);
  1891.                     entityfx.func_70543_e((float)d3);
  1892.                 }
  1893.                 this.field_72769_h.func_175731_a(blockPosIn, "game.potion.smash", 1.0f, this.field_72769_h.field_73012_v.nextFloat() * 0.1f + 0.9f, false);
  1894.                 break;
  1895.             }
  1896.             case 2003: {
  1897.                 double d0 = (double)blockPosIn.func_177958_n() + 0.5;
  1898.                 double d1 = blockPosIn.func_177956_o();
  1899.                 double d2 = (double)blockPosIn.func_177952_p() + 0.5;
  1900.                 for (int l = 0; l < 8; ++l) {
  1901.                     this.func_174972_a(EnumParticleTypes.ITEM_CRACK, d0, d1, d2, random.nextGaussian() * 0.15, random.nextDouble() * 0.2, random.nextGaussian() * 0.15, Item.func_150891_b(Items.field_151061_bv));
  1902.                 }
  1903.                 for (double d13 = 0.0; d13 < 6.283185307179586; d13 += 0.15707963267948966) {
  1904.                     this.func_174972_a(EnumParticleTypes.PORTAL, d0 + Math.cos(d13) * 5.0, d1 - 0.4, d2 + Math.sin(d13) * 5.0, Math.cos(d13) * -5.0, 0.0, Math.sin(d13) * -5.0, new int[0]);
  1905.                     this.func_174972_a(EnumParticleTypes.PORTAL, d0 + Math.cos(d13) * 5.0, d1 - 0.4, d2 + Math.sin(d13) * 5.0, Math.cos(d13) * -7.0, 0.0, Math.sin(d13) * -7.0, new int[0]);
  1906.                 }
  1907.                 return;
  1908.             }
  1909.             case 2004: {
  1910.                 for (int i1 = 0; i1 < 20; ++i1) {
  1911.                     double d3 = (double)blockPosIn.func_177958_n() + 0.5 + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5) * 2.0;
  1912.                     double d5 = (double)blockPosIn.func_177956_o() + 0.5 + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5) * 2.0;
  1913.                     double d7 = (double)blockPosIn.func_177952_p() + 0.5 + ((double)this.field_72769_h.field_73012_v.nextFloat() - 0.5) * 2.0;
  1914.                     this.field_72769_h.func_175688_a(EnumParticleTypes.SMOKE_NORMAL, d3, d5, d7, 0.0, 0.0, 0.0, new int[0]);
  1915.                     this.field_72769_h.func_175688_a(EnumParticleTypes.FLAME, d3, d5, d7, 0.0, 0.0, 0.0, new int[0]);
  1916.                 }
  1917.                 return;
  1918.             }
  1919.             case 2005: {
  1920.                 ItemDye.func_180617_a(this.field_72769_h, blockPosIn, p_180439_4_);
  1921.             }
  1922.         }
  1923.     }
  1924.  
  1925.     @Override
  1926.     public void func_180441_b(int n, BlockPos blockPos, int n2) {
  1927.         void progress;
  1928.         void breakerId;
  1929.         RenderGlobal renderGlobal;
  1930.         CallbackInfo callbackInfo = new CallbackInfo("func_180441_b", false);
  1931.         renderGlobal.saveBlockBreakProgressPacket(n, blockPos, n2, callbackInfo);
  1932.         if (progress >= 0 && progress < 10) {
  1933.             void pos;
  1934.             DestroyBlockProgress destroyblockprogress = (DestroyBlockProgress)this.field_72738_E.get((int)breakerId);
  1935.             if (destroyblockprogress == null || destroyblockprogress.func_180246_b().func_177958_n() != pos.func_177958_n() || destroyblockprogress.func_180246_b().func_177956_o() != pos.func_177956_o() || destroyblockprogress.func_180246_b().func_177952_p() != pos.func_177952_p()) {
  1936.                 destroyblockprogress = new DestroyBlockProgress((int)breakerId, (BlockPos)pos);
  1937.                 this.field_72738_E.put((int)breakerId, destroyblockprogress);
  1938.             }
  1939.             destroyblockprogress.func_73107_a((int)progress);
  1940.             destroyblockprogress.func_82744_b(this.field_72773_u);
  1941.         } else {
  1942.             this.field_72738_E.remove((int)breakerId);
  1943.         }
  1944.     }
  1945.  
  1946.     public void func_174979_m() {
  1947.         this.field_147595_R = true;
  1948.     }
  1949.  
  1950.     @MixinMerged(mixin="com.replaymod.recording.mixin.MixinRenderGlobal", priority=1000, sessionId="6fd3d252-0c76-49ea-aa4c-a7307d0965a9")
  1951.     @Override
  1952.     public void setRecordingEventHandler(RecordingEventHandler recordingEventHandler) {
  1953.         this.recordingEventHandler = recordingEventHandler;
  1954.     }
  1955.  
  1956.     @MixinMerged(mixin="com.replaymod.recording.mixin.MixinRenderGlobal", priority=1000, sessionId="6fd3d252-0c76-49ea-aa4c-a7307d0965a9")
  1957.     @Override
  1958.     public RecordingEventHandler getRecordingEventHandler() {
  1959.         return this.recordingEventHandler;
  1960.     }
  1961.  
  1962.     @MixinMerged(mixin="com.replaymod.recording.mixin.MixinRenderGlobal", priority=1000, sessionId="6fd3d252-0c76-49ea-aa4c-a7307d0965a9")
  1963.     public void saveBlockBreakProgressPacket(int breakerId, BlockPos pos, int progress, CallbackInfo info) {
  1964.         if (this.recordingEventHandler != null) {
  1965.             this.recordingEventHandler.onBlockBreakAnim(breakerId, pos, progress);
  1966.         }
  1967.     }
  1968.  
  1969.     @MixinMerged(mixin="com.replaymod.render.mixin.MixinRenderGlobal", priority=1000, sessionId="6fd3d252-0c76-49ea-aa4c-a7307d0965a9")
  1970.     public void replayModRender_setupTerrain(Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator, CallbackInfo ci) {
  1971.         if (this.replayModRender_hook != null && !this.replayModRender_passThroughSetupTerrain) {
  1972.             this.replayModRender_passThroughSetupTerrain = true;
  1973.             do {
  1974.                 this.func_174970_a(viewEntity, partialTicks, camera, this.replayModRender_hook.nextFrameId(), playerSpectator);
  1975.             } while (this.field_147595_R);
  1976.             this.replayModRender_passThroughSetupTerrain = false;
  1977.             ci.cancel();
  1978.         }
  1979.     }
  1980.  
  1981.     @MixinMerged(mixin="com.replaymod.render.mixin.MixinRenderGlobal", priority=1000, sessionId="6fd3d252-0c76-49ea-aa4c-a7307d0965a9")
  1982.     public void replayModRender_isPositionInRenderChunk(BlockPos pos, RenderChunk chunk, CallbackInfoReturnable<Boolean> ci) {
  1983.         if (this.replayModRender_hook != null) {
  1984.             ci.setReturnValue((Object)true);
  1985.         }
  1986.     }
  1987.  
  1988.     @MixinMerged(mixin="com.replaymod.render.mixin.MixinRenderGlobal", priority=1000, sessionId="6fd3d252-0c76-49ea-aa4c-a7307d0965a9")
  1989.     public void replayModRender_updateChunks(long finishTimeNano, CallbackInfo ci) {
  1990.         if (this.replayModRender_hook != null) {
  1991.             if (ShaderReflection.renderGlobal_chunksToUpdateForced != null) {
  1992.                 try {
  1993.                     Set ctuf = (Set)ShaderReflection.renderGlobal_chunksToUpdateForced.get(this);
  1994.                     for (RenderChunk renderChunk : ctuf) {
  1995.                         this.replayModRender_hook.renderDispatcher.field_178519_d.add(renderChunk.func_178574_d());
  1996.                     }
  1997.                 }
  1998.                 catch (Exception e) {
  1999.                     e.printStackTrace();
  2000.                 }
  2001.             }
  2002.             this.replayModRender_hook.updateChunks();
  2003.             ci.cancel();
  2004.         }
  2005.     }
  2006.  
  2007.     @SideOnly(value=Side.CLIENT)
  2008.     public class ContainerLocalRenderInformation {
  2009.         final RenderChunk field_178036_a;
  2010.         final EnumFacing field_178034_b;
  2011.         final Set field_178035_c;
  2012.         final int field_178032_d;
  2013.         private static final String __OBFID = "CL_00002534";
  2014.  
  2015.         private ContainerLocalRenderInformation(RenderChunk p_i46248_2_, EnumFacing p_i46248_3_, int p_i46248_4_) {
  2016.             this.field_178035_c = EnumSet.noneOf(EnumFacing.class);
  2017.             this.field_178036_a = p_i46248_2_;
  2018.             this.field_178034_b = p_i46248_3_;
  2019.             this.field_178032_d = p_i46248_4_;
  2020.         }
  2021.  
  2022.         ContainerLocalRenderInformation(RenderChunk p_i46249_2_, EnumFacing p_i46249_3_, int p_i46249_4_, Object p_i46249_5_) {
  2023.             this(p_i46249_2_, p_i46249_3_, p_i46249_4_);
  2024.         }
  2025.     }
  2026.  
  2027. }
Advertisement
Add Comment
Please, Sign In to add comment