    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import org.lwjgl.opengl.GL11;
    006
    007    @SideOnly(Side.CLIENT)
    008    public class TileEntityBeaconRenderer extends TileEntitySpecialRenderer
    009    {
    010        public void func_82398_a(TileEntityBeacon par1TileEntityBeacon, double par2, double par4, double par6, float par8)
    011        {
    012            float var9 = par1TileEntityBeacon.func_82125_v_();
    013
    014            if (var9 > 0.0F)
    015            {
    016                Tessellator var10 = Tessellator.instance;
    017                this.bindTextureByName("/misc/beam.png");
    018                GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
    019                GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
    020                GL11.glDisable(GL11.GL_LIGHTING);
    021                GL11.glDisable(GL11.GL_CULL_FACE);
    022                GL11.glDisable(GL11.GL_BLEND);
    023                GL11.glDepthMask(true);
    024                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
    025                float var11 = (float)par1TileEntityBeacon.getWorldObj().func_82737_E() + par8;
    026                float var12 = -var11 * 0.2F - (float)MathHelper.floor_float(-var11 * 0.1F);
    027                byte var13 = 1;
    028                double var14 = (double)var11 * 0.025D * (1.0D - (double)(var13 & 1) * 2.5D);
    029                var10.startDrawingQuads();
    030                var10.setColorRGBA(255, 255, 255, 32);
    031                double var16 = (double)var13 * 0.2D;
    032                double var18 = 0.5D + Math.cos(var14 + 2.356194490192345D) * var16;
    033                double var20 = 0.5D + Math.sin(var14 + 2.356194490192345D) * var16;
    034                double var22 = 0.5D + Math.cos(var14 + (Math.PI / 4D)) * var16;
    035                double var24 = 0.5D + Math.sin(var14 + (Math.PI / 4D)) * var16;
    036                double var26 = 0.5D + Math.cos(var14 + 3.9269908169872414D) * var16;
    037                double var28 = 0.5D + Math.sin(var14 + 3.9269908169872414D) * var16;
    038                double var30 = 0.5D + Math.cos(var14 + 5.497787143782138D) * var16;
    039                double var32 = 0.5D + Math.sin(var14 + 5.497787143782138D) * var16;
    040                double var34 = (double)(256.0F * var9);
    041                double var36 = 0.0D;
    042                double var38 = 1.0D;
    043                double var40 = (double)(-1.0F + var12);
    044                double var42 = (double)(256.0F * var9) * (0.5D / var16) + var40;
    045                var10.addVertexWithUV(par2 + var18, par4 + var34, par6 + var20, var38, var42);
    046                var10.addVertexWithUV(par2 + var18, par4, par6 + var20, var38, var40);
    047                var10.addVertexWithUV(par2 + var22, par4, par6 + var24, var36, var40);
    048                var10.addVertexWithUV(par2 + var22, par4 + var34, par6 + var24, var36, var42);
    049                var10.addVertexWithUV(par2 + var30, par4 + var34, par6 + var32, var38, var42);
    050                var10.addVertexWithUV(par2 + var30, par4, par6 + var32, var38, var40);
    051                var10.addVertexWithUV(par2 + var26, par4, par6 + var28, var36, var40);
    052                var10.addVertexWithUV(par2 + var26, par4 + var34, par6 + var28, var36, var42);
    053                var10.addVertexWithUV(par2 + var22, par4 + var34, par6 + var24, var38, var42);
    054                var10.addVertexWithUV(par2 + var22, par4, par6 + var24, var38, var40);
    055                var10.addVertexWithUV(par2 + var30, par4, par6 + var32, var36, var40);
    056                var10.addVertexWithUV(par2 + var30, par4 + var34, par6 + var32, var36, var42);
    057                var10.addVertexWithUV(par2 + var26, par4 + var34, par6 + var28, var38, var42);
    058                var10.addVertexWithUV(par2 + var26, par4, par6 + var28, var38, var40);
    059                var10.addVertexWithUV(par2 + var18, par4, par6 + var20, var36, var40);
    060                var10.addVertexWithUV(par2 + var18, par4 + var34, par6 + var20, var36, var42);
    061                var10.draw();
    062                GL11.glEnable(GL11.GL_BLEND);
    063                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    064                GL11.glDepthMask(false);
    065                var10.startDrawingQuads();
    066                var10.setColorRGBA(255, 255, 255, 32);
    067                double var44 = 0.2D;
    068                double var15 = 0.2D;
    069                double var17 = 0.8D;
    070                double var19 = 0.2D;
    071                double var21 = 0.2D;
    072                double var23 = 0.8D;
    073                double var25 = 0.8D;
    074                double var27 = 0.8D;
    075                double var29 = (double)(256.0F * var9);
    076                double var31 = 0.0D;
    077                double var33 = 1.0D;
    078                double var35 = (double)(-1.0F + var12);
    079                double var37 = (double)(256.0F * var9) + var35;
    080                var10.addVertexWithUV(par2 + var44, par4 + var29, par6 + var15, var33, var37);
    081                var10.addVertexWithUV(par2 + var44, par4, par6 + var15, var33, var35);
    082                var10.addVertexWithUV(par2 + var17, par4, par6 + var19, var31, var35);
    083                var10.addVertexWithUV(par2 + var17, par4 + var29, par6 + var19, var31, var37);
    084                var10.addVertexWithUV(par2 + var25, par4 + var29, par6 + var27, var33, var37);
    085                var10.addVertexWithUV(par2 + var25, par4, par6 + var27, var33, var35);
    086                var10.addVertexWithUV(par2 + var21, par4, par6 + var23, var31, var35);
    087                var10.addVertexWithUV(par2 + var21, par4 + var29, par6 + var23, var31, var37);
    088                var10.addVertexWithUV(par2 + var17, par4 + var29, par6 + var19, var33, var37);
    089                var10.addVertexWithUV(par2 + var17, par4, par6 + var19, var33, var35);
    090                var10.addVertexWithUV(par2 + var25, par4, par6 + var27, var31, var35);
    091                var10.addVertexWithUV(par2 + var25, par4 + var29, par6 + var27, var31, var37);
    092                var10.addVertexWithUV(par2 + var21, par4 + var29, par6 + var23, var33, var37);
    093                var10.addVertexWithUV(par2 + var21, par4, par6 + var23, var33, var35);
    094                var10.addVertexWithUV(par2 + var44, par4, par6 + var15, var31, var35);
    095                var10.addVertexWithUV(par2 + var44, par4 + var29, par6 + var15, var31, var37);
    096                var10.draw();
    097                GL11.glEnable(GL11.GL_LIGHTING);
    098                GL11.glEnable(GL11.GL_TEXTURE_2D);
    099                GL11.glDepthMask(true);
    100            }
    101        }
    102
    103        public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
    104        {
    105            this.func_82398_a((TileEntityBeacon)par1TileEntity, par2, par4, par6, par8);
    106        }
    107    }