    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import net.minecraft.client.Minecraft;
    006    import static net.minecraftforge.common.ForgeDirection.*;
    007
    008    import org.lwjgl.opengl.GL11;
    009    import org.lwjgl.opengl.GL12;
    010
    011    @SideOnly(Side.CLIENT)
    012    public class RenderBlocks
    013    {
    014        /** The IBlockAccess used by this instance of RenderBlocks */
    015        public IBlockAccess blockAccess;
    016
    017        /**
    018         * If set to >=0, all block faces will be rendered using this texture index
    019         */
    020        public int overrideBlockTexture = -1;
    021
    022        /**
    023         * Set to true if the texture should be flipped horizontally during render*Face
    024         */
    025        public boolean flipTexture = false;
    026
    027        /**
    028         * If true, renders all faces on all blocks rather than using the logic in Block.shouldSideBeRendered.  Unused.
    029         */
    030        public boolean renderAllFaces = false;
    031
    032        /** Fancy grass side matching biome */
    033        public static boolean fancyGrass = true;
    034        public boolean useInventoryTint = true;
    035        public int uvRotateEast = 0;
    036        public int uvRotateWest = 0;
    037        public int uvRotateSouth = 0;
    038        public int uvRotateNorth = 0;
    039        public int uvRotateTop = 0;
    040        public int uvRotateBottom = 0;
    041
    042        /** Whether ambient occlusion is enabled or not */
    043        public boolean enableAO;
    044
    045        /** Light value of the block itself */
    046        public float lightValueOwn;
    047
    048        /** Light value one block less in x axis */
    049        public float aoLightValueXNeg;
    050
    051        /** Light value one block more in y axis */
    052        public float aoLightValueYNeg;
    053
    054        /** Light value one block more in z axis */
    055        public float aoLightValueZNeg;
    056
    057        /** Light value one block more in x axis */
    058        public float aoLightValueXPos;
    059
    060        /** Light value one block more in y axis */
    061        public float aoLightValueYPos;
    062
    063        /** Light value one block more in z axis */
    064        public float aoLightValueZPos;
    065
    066        /**
    067         * Used as a scratch variable for ambient occlusion on the north/bottom/east corner.
    068         */
    069        public float aoLightValueScratchXYZNNN;
    070
    071        /**
    072         * Used as a scratch variable for ambient occlusion between the bottom face and the north face.
    073         */
    074        public float aoLightValueScratchXYNN;
    075
    076        /**
    077         * Used as a scratch variable for ambient occlusion on the north/bottom/west corner.
    078         */
    079        public float aoLightValueScratchXYZNNP;
    080
    081        /**
    082         * Used as a scratch variable for ambient occlusion between the bottom face and the east face.
    083         */
    084        public float aoLightValueScratchYZNN;
    085
    086        /**
    087         * Used as a scratch variable for ambient occlusion between the bottom face and the west face.
    088         */
    089        public float aoLightValueScratchYZNP;
    090
    091        /**
    092         * Used as a scratch variable for ambient occlusion on the south/bottom/east corner.
    093         */
    094        public float aoLightValueScratchXYZPNN;
    095
    096        /**
    097         * Used as a scratch variable for ambient occlusion between the bottom face and the south face.
    098         */
    099        public float aoLightValueScratchXYPN;
    100
    101        /**
    102         * Used as a scratch variable for ambient occlusion on the south/bottom/west corner.
    103         */
    104        public float aoLightValueScratchXYZPNP;
    105
    106        /**
    107         * Used as a scratch variable for ambient occlusion on the north/top/east corner.
    108         */
    109        public float aoLightValueScratchXYZNPN;
    110
    111        /**
    112         * Used as a scratch variable for ambient occlusion between the top face and the north face.
    113         */
    114        public float aoLightValueScratchXYNP;
    115
    116        /**
    117         * Used as a scratch variable for ambient occlusion on the north/top/west corner.
    118         */
    119        public float aoLightValueScratchXYZNPP;
    120
    121        /**
    122         * Used as a scratch variable for ambient occlusion between the top face and the east face.
    123         */
    124        public float aoLightValueScratchYZPN;
    125
    126        /**
    127         * Used as a scratch variable for ambient occlusion on the south/top/east corner.
    128         */
    129        public float aoLightValueScratchXYZPPN;
    130
    131        /**
    132         * Used as a scratch variable for ambient occlusion between the top face and the south face.
    133         */
    134        public float aoLightValueScratchXYPP;
    135
    136        /**
    137         * Used as a scratch variable for ambient occlusion between the top face and the west face.
    138         */
    139        public float aoLightValueScratchYZPP;
    140
    141        /**
    142         * Used as a scratch variable for ambient occlusion on the south/top/west corner.
    143         */
    144        public float aoLightValueScratchXYZPPP;
    145
    146        /**
    147         * Used as a scratch variable for ambient occlusion between the north face and the east face.
    148         */
    149        public float aoLightValueScratchXZNN;
    150
    151        /**
    152         * Used as a scratch variable for ambient occlusion between the south face and the east face.
    153         */
    154        public float aoLightValueScratchXZPN;
    155
    156        /**
    157         * Used as a scratch variable for ambient occlusion between the north face and the west face.
    158         */
    159        public float aoLightValueScratchXZNP;
    160
    161        /**
    162         * Used as a scratch variable for ambient occlusion between the south face and the west face.
    163         */
    164        public float aoLightValueScratchXZPP;
    165
    166        /** Ambient occlusion brightness XYZNNN */
    167        public int aoBrightnessXYZNNN;
    168
    169        /** Ambient occlusion brightness XYNN */
    170        public int aoBrightnessXYNN;
    171
    172        /** Ambient occlusion brightness XYZNNP */
    173        public int aoBrightnessXYZNNP;
    174
    175        /** Ambient occlusion brightness YZNN */
    176        public int aoBrightnessYZNN;
    177
    178        /** Ambient occlusion brightness YZNP */
    179        public int aoBrightnessYZNP;
    180
    181        /** Ambient occlusion brightness XYZPNN */
    182        public int aoBrightnessXYZPNN;
    183
    184        /** Ambient occlusion brightness XYPN */
    185        public int aoBrightnessXYPN;
    186
    187        /** Ambient occlusion brightness XYZPNP */
    188        public int aoBrightnessXYZPNP;
    189
    190        /** Ambient occlusion brightness XYZNPN */
    191        public int aoBrightnessXYZNPN;
    192
    193        /** Ambient occlusion brightness XYNP */
    194        public int aoBrightnessXYNP;
    195
    196        /** Ambient occlusion brightness XYZNPP */
    197        public int aoBrightnessXYZNPP;
    198
    199        /** Ambient occlusion brightness YZPN */
    200        public int aoBrightnessYZPN;
    201
    202        /** Ambient occlusion brightness XYZPPN */
    203        public int aoBrightnessXYZPPN;
    204
    205        /** Ambient occlusion brightness XYPP */
    206        public int aoBrightnessXYPP;
    207
    208        /** Ambient occlusion brightness YZPP */
    209        public int aoBrightnessYZPP;
    210
    211        /** Ambient occlusion brightness XYZPPP */
    212        public int aoBrightnessXYZPPP;
    213
    214        /** Ambient occlusion brightness XZNN */
    215        public int aoBrightnessXZNN;
    216
    217        /** Ambient occlusion brightness XZPN */
    218        public int aoBrightnessXZPN;
    219
    220        /** Ambient occlusion brightness XZNP */
    221        public int aoBrightnessXZNP;
    222
    223        /** Ambient occlusion brightness XZPP */
    224        public int aoBrightnessXZPP;
    225
    226        /** Ambient occlusion type (0=simple, 1=complex) */
    227        public int aoType = 1;
    228
    229        /** Brightness top left */
    230        public int brightnessTopLeft;
    231
    232        /** Brightness bottom left */
    233        public int brightnessBottomLeft;
    234
    235        /** Brightness bottom right */
    236        public int brightnessBottomRight;
    237
    238        /** Brightness top right */
    239        public int brightnessTopRight;
    240
    241        /** Red color value for the top left corner */
    242        public float colorRedTopLeft;
    243
    244        /** Red color value for the bottom left corner */
    245        public float colorRedBottomLeft;
    246
    247        /** Red color value for the bottom right corner */
    248        public float colorRedBottomRight;
    249
    250        /** Red color value for the top right corner */
    251        public float colorRedTopRight;
    252
    253        /** Green color value for the top left corner */
    254        public float colorGreenTopLeft;
    255
    256        /** Green color value for the bottom left corner */
    257        public float colorGreenBottomLeft;
    258
    259        /** Green color value for the bottom right corner */
    260        public float colorGreenBottomRight;
    261
    262        /** Green color value for the top right corner */
    263        public float colorGreenTopRight;
    264
    265        /** Blue color value for the top left corner */
    266        public float colorBlueTopLeft;
    267
    268        /** Blue color value for the bottom left corner */
    269        public float colorBlueBottomLeft;
    270
    271        /** Blue color value for the bottom right corner */
    272        public float colorBlueBottomRight;
    273
    274        /** Blue color value for the top right corner */
    275        public float colorBlueTopRight;
    276
    277        /**
    278         * Grass flag for ambient occlusion on Center X, Positive Y, and Negative Z
    279         */
    280        public boolean aoGrassXYZCPN;
    281
    282        /**
    283         * Grass flag for ambient occlusion on Positive X, Positive Y, and Center Z
    284         */
    285        public boolean aoGrassXYZPPC;
    286
    287        /**
    288         * Grass flag for ambient occlusion on Negative X, Positive Y, and Center Z
    289         */
    290        public boolean aoGrassXYZNPC;
    291
    292        /**
    293         * Grass flag for ambient occlusion on Center X, Positive Y, and Positive Z
    294         */
    295        public boolean aoGrassXYZCPP;
    296
    297        /**
    298         * Grass flag for ambient occlusion on Negative X, Center Y, and Negative Z
    299         */
    300        public boolean aoGrassXYZNCN;
    301
    302        /**
    303         * Grass flag for ambient occlusion on Positive X, Center Y, and Positive Z
    304         */
    305        public boolean aoGrassXYZPCP;
    306
    307        /**
    308         * Grass flag for ambient occlusion on Negative X, Center Y, and Positive Z
    309         */
    310        public boolean aoGrassXYZNCP;
    311
    312        /**
    313         * Grass flag for ambient occlusion on Positive X, Center Y, and Negative Z
    314         */
    315        public boolean aoGrassXYZPCN;
    316
    317        /**
    318         * Grass flag for ambient occlusion on Center X, Negative Y, and Negative Z
    319         */
    320        public boolean aoGrassXYZCNN;
    321
    322        /**
    323         * Grass flag for ambient occlusion on Positive X, Negative Y, and Center Z
    324         */
    325        public boolean aoGrassXYZPNC;
    326
    327        /**
    328         * Grass flag for ambient occlusion on Negative X, Negative Y, and center Z
    329         */
    330        public boolean aoGrassXYZNNC;
    331
    332        /**
    333         * Grass flag for ambient occlusion on Center X, Negative Y, and Positive Z
    334         */
    335        public boolean aoGrassXYZCNP;
    336
    337        public RenderBlocks(IBlockAccess par1IBlockAccess)
    338        {
    339            this.blockAccess = par1IBlockAccess;
    340        }
    341
    342        public RenderBlocks() {}
    343
    344        public void func_82774_a(int par1)
    345        {
    346            this.overrideBlockTexture = par1;
    347        }
    348
    349        /**
    350         * Clear override block texture
    351         */
    352        public void clearOverrideBlockTexture()
    353        {
    354            this.overrideBlockTexture = -1;
    355        }
    356
    357        /**
    358         * Renders a block using the given texture instead of the block's own default texture
    359         */
    360        public void renderBlockUsingTexture(Block par1Block, int par2, int par3, int par4, int par5)
    361        {
    362            this.overrideBlockTexture = par5;
    363            this.renderBlockByRenderType(par1Block, par2, par3, par4);
    364            this.overrideBlockTexture = -1;
    365        }
    366
    367        /**
    368         * Render all faces of a block
    369         */
    370        public void renderBlockAllFaces(Block par1Block, int par2, int par3, int par4)
    371        {
    372            this.renderAllFaces = true;
    373            this.renderBlockByRenderType(par1Block, par2, par3, par4);
    374            this.renderAllFaces = false;
    375        }
    376
    377        /**
    378         * Renders the block at the given coordinates using the block's rendering type
    379         */
    380        public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4)
    381        {
    382            int var5 = par1Block.getRenderType();
    383            par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4);
    384            switch (var5)
    385            {
    386                case 0:
    387                    return this.renderStandardBlock(par1Block, par2, par3, par4);
    388                case 31:
    389                    return this.renderBlockLog(par1Block, par2, par3, par4);
    390                case 4:
    391                    return this.renderBlockFluids(par1Block, par2, par3, par4);
    392                case 13:
    393                    return this.renderBlockCactus(par1Block, par2, par3, par4);
    394                case 1:
    395                    return this.renderCrossedSquares(par1Block, par2, par3, par4);
    396                case 19:
    397                    return this.renderBlockStem(par1Block, par2, par3, par4);
    398                case 23:
    399                    return this.renderBlockLilyPad(par1Block, par2, par3, par4);
    400                case 6:
    401                    return this.renderBlockCrops(par1Block, par2, par3, par4);
    402                case 2:
    403                    return this.renderBlockTorch(par1Block, par2, par3, par4);
    404                case 3:
    405                    return this.renderBlockFire(par1Block, par2, par3, par4);
    406                case 5:
    407                    return this.renderBlockRedstoneWire(par1Block, par2, par3, par4);
    408                case 8:
    409                    return this.renderBlockLadder(par1Block, par2, par3, par4);
    410                case 7:
    411                    return this.renderBlockDoor(par1Block, par2, par3, par4);
    412                case 9:
    413                    return this.renderBlockMinecartTrack((BlockRail)par1Block, par2, par3, par4);
    414                case 10:
    415                    return this.renderBlockStairs((BlockStairs)par1Block, par2, par3, par4);
    416                case 27:
    417                    return this.renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4);
    418                case 11:
    419                    return this.renderBlockFence((BlockFence)par1Block, par2, par3, par4);
    420                case 32:
    421                    return this.func_82779_a((BlockWall)par1Block, par2, par3, par4);
    422                case 12:
    423                    return this.renderBlockLever(par1Block, par2, par3, par4);
    424                case 29:
    425                    return this.renderBlockTripWireSource(par1Block, par2, par3, par4);
    426                case 30:
    427                    return this.renderBlockTripWire(par1Block, par2, par3, par4);
    428                case 14:
    429                    return this.renderBlockBed(par1Block, par2, par3, par4);
    430                case 15:
    431                    return this.renderBlockRepeater(par1Block, par2, par3, par4);
    432                case 16:
    433                    return this.renderPistonBase(par1Block, par2, par3, par4, false);
    434                case 17:
    435                    return this.renderPistonExtension(par1Block, par2, par3, par4, true);
    436                case 18:
    437                    return this.renderBlockPane((BlockPane)par1Block, par2, par3, par4);
    438                case 20:
    439                    return this.renderBlockVine(par1Block, par2, par3, par4);
    440                case 21:
    441                    return this.renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4);
    442                case 24:
    443                    return this.renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4);
    444                case 33:
    445                    return this.func_82780_a((BlockFlowerPot)par1Block, par2, par3, par4);
    446                case 35:
    447                    return this.func_82775_a((BlockAnvil)par1Block, par2, par3, par4);
    448                case 25:
    449                    return this.renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4);
    450                case 26:
    451                    return this.renderBlockEndPortalFrame(par1Block, par2, par3, par4);
    452                case 28:
    453                    return this.renderBlockCocoa((BlockCocoa)par1Block, par2, par3, par4);
    454                case 34:
    455                    return this.func_82778_a((BlockBeacon)par1Block, par2, par3, par4);
    456                default:
    457                    return FMLRenderAccessLibrary.renderWorldBlock(this, blockAccess, par2, par3, par4, par1Block, var5);
    458            }
    459        }
    460
    461        /**
    462         * Render BlockEndPortalFrame
    463         */
    464        public boolean renderBlockEndPortalFrame(Block par1Block, int par2, int par3, int par4)
    465        {
    466            int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    467            int var6 = var5 & 3;
    468
    469            if (var6 == 0)
    470            {
    471                this.uvRotateTop = 3;
    472            }
    473            else if (var6 == 3)
    474            {
    475                this.uvRotateTop = 1;
    476            }
    477            else if (var6 == 1)
    478            {
    479                this.uvRotateTop = 2;
    480            }
    481
    482            if (!BlockEndPortalFrame.isEnderEyeInserted(var5))
    483            {
    484                par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F);
    485                this.renderStandardBlock(par1Block, par2, par3, par4);
    486                par1Block.setBlockBoundsForItemRender();
    487                this.uvRotateTop = 0;
    488                return true;
    489            }
    490            else
    491            {
    492                par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F);
    493                this.renderStandardBlock(par1Block, par2, par3, par4);
    494                this.overrideBlockTexture = 174;
    495                par1Block.setBlockBounds(0.25F, 0.8125F, 0.25F, 0.75F, 1.0F, 0.75F);
    496                this.renderStandardBlock(par1Block, par2, par3, par4);
    497                this.clearOverrideBlockTexture();
    498                par1Block.setBlockBoundsForItemRender();
    499                this.uvRotateTop = 0;
    500                return true;
    501            }
    502        }
    503
    504        /**
    505         * render a bed at the given coordinates
    506         */
    507        public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
    508        {
    509            Tessellator var5 = Tessellator.instance;
    510            int var7 = par1Block.getBedDirection(blockAccess, par2, par3, par4);
    511            boolean var8 = par1Block.isBedFoot(blockAccess, par2, par3, par4);
    512            float var9 = 0.5F;
    513            float var10 = 1.0F;
    514            float var11 = 0.8F;
    515            float var12 = 0.6F;
    516            int var25 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4);
    517            var5.setBrightness(var25);
    518            var5.setColorOpaque_F(var9, var9, var9);
    519            int var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0);
    520            if (overrideBlockTexture >= 0) var27 = overrideBlockTexture; //BugFix Proper breaking texture on underside
    521            int var28 = (var27 & 15) << 4;
    522            int var29 = var27 & 240;
    523            double var30 = (double)((float)var28 / 256.0F);
    524            double var32 = ((double)(var28 + 16) - 0.01D) / 256.0D;
    525            double var34 = (double)((float)var29 / 256.0F);
    526            double var36 = ((double)(var29 + 16) - 0.01D) / 256.0D;
    527            double var38 = (double)par2 + par1Block.minX;
    528            double var40 = (double)par2 + par1Block.maxX;
    529            double var42 = (double)par3 + par1Block.minY + 0.1875D;
    530            double var44 = (double)par4 + par1Block.minZ;
    531            double var46 = (double)par4 + par1Block.maxZ;
    532            var5.addVertexWithUV(var38, var42, var46, var30, var36);
    533            var5.addVertexWithUV(var38, var42, var44, var30, var34);
    534            var5.addVertexWithUV(var40, var42, var44, var32, var34);
    535            var5.addVertexWithUV(var40, var42, var46, var32, var36);
    536            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
    537            var5.setColorOpaque_F(var10, var10, var10);
    538            var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1);
    539            if (overrideBlockTexture >= 0) var27 = overrideBlockTexture; //BugFix Proper breaking texture on top
    540            var28 = (var27 & 15) << 4;
    541            var29 = var27 & 240;
    542            var30 = (double)((float)var28 / 256.0F);
    543            var32 = ((double)(var28 + 16) - 0.01D) / 256.0D;
    544            var34 = (double)((float)var29 / 256.0F);
    545            var36 = ((double)(var29 + 16) - 0.01D) / 256.0D;
    546            var38 = var30;
    547            var40 = var32;
    548            var42 = var34;
    549            var44 = var34;
    550            var46 = var30;
    551            double var48 = var32;
    552            double var50 = var36;
    553            double var52 = var36;
    554
    555            if (var7 == 0)
    556            {
    557                var40 = var30;
    558                var42 = var36;
    559                var46 = var32;
    560                var52 = var34;
    561            }
    562            else if (var7 == 2)
    563            {
    564                var38 = var32;
    565                var44 = var36;
    566                var48 = var30;
    567                var50 = var34;
    568            }
    569            else if (var7 == 3)
    570            {
    571                var38 = var32;
    572                var44 = var36;
    573                var48 = var30;
    574                var50 = var34;
    575                var40 = var30;
    576                var42 = var36;
    577                var46 = var32;
    578                var52 = var34;
    579            }
    580
    581            double var54 = (double)par2 + par1Block.minX;
    582            double var56 = (double)par2 + par1Block.maxX;
    583            double var58 = (double)par3 + par1Block.maxY;
    584            double var60 = (double)par4 + par1Block.minZ;
    585            double var62 = (double)par4 + par1Block.maxZ;
    586            var5.addVertexWithUV(var56, var58, var62, var46, var50);
    587            var5.addVertexWithUV(var56, var58, var60, var38, var42);
    588            var5.addVertexWithUV(var54, var58, var60, var40, var44);
    589            var5.addVertexWithUV(var54, var58, var62, var48, var52);
    590            int var64 = Direction.headInvisibleFace[var7];
    591
    592            if (var8)
    593            {
    594                var64 = Direction.headInvisibleFace[Direction.footInvisibleFaceRemap[var7]];
    595            }
    596
    597            byte var65 = 4;
    598
    599            switch (var7)
    600            {
    601                case 0:
    602                    var65 = 5;
    603                    break;
    604                case 1:
    605                    var65 = 3;
    606                case 2:
    607                default:
    608                    break;
    609                case 3:
    610                    var65 = 2;
    611            }
    612
    613            if (var64 != 2 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2)))
    614            {
    615                var5.setBrightness(par1Block.minZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1));
    616                var5.setColorOpaque_F(var11, var11, var11);
    617                this.flipTexture = var65 == 2;
    618                this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2));
    619            }
    620
    621            if (var64 != 3 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3)))
    622            {
    623                var5.setBrightness(par1Block.maxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1));
    624                var5.setColorOpaque_F(var11, var11, var11);
    625                this.flipTexture = var65 == 3;
    626                this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
    627            }
    628
    629            if (var64 != 4 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4)))
    630            {
    631                var5.setBrightness(par1Block.minZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4));
    632                var5.setColorOpaque_F(var12, var12, var12);
    633                this.flipTexture = var65 == 4;
    634                this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4));
    635            }
    636
    637            if (var64 != 5 && (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5)))
    638            {
    639                var5.setBrightness(par1Block.maxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4));
    640                var5.setColorOpaque_F(var12, var12, var12);
    641                this.flipTexture = var65 == 5;
    642                this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5));
    643            }
    644
    645            this.flipTexture = false;
    646            return true;
    647        }
    648
    649        /**
    650         * Render BlockBrewingStand
    651         */
    652        public boolean renderBlockBrewingStand(BlockBrewingStand par1BlockBrewingStand, int par2, int par3, int par4)
    653        {
    654            par1BlockBrewingStand.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F);
    655            this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4);
    656            this.overrideBlockTexture = 156;
    657            par1BlockBrewingStand.setBlockBounds(0.5625F, 0.0F, 0.3125F, 0.9375F, 0.125F, 0.6875F);
    658            this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4);
    659            par1BlockBrewingStand.setBlockBounds(0.125F, 0.0F, 0.0625F, 0.5F, 0.125F, 0.4375F);
    660            this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4);
    661            par1BlockBrewingStand.setBlockBounds(0.125F, 0.0F, 0.5625F, 0.5F, 0.125F, 0.9375F);
    662            this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4);
    663            this.clearOverrideBlockTexture();
    664            Tessellator var5 = Tessellator.instance;
    665            var5.setBrightness(par1BlockBrewingStand.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    666            float var6 = 1.0F;
    667            int var7 = par1BlockBrewingStand.colorMultiplier(this.blockAccess, par2, par3, par4);
    668            float var8 = (float)(var7 >> 16 & 255) / 255.0F;
    669            float var9 = (float)(var7 >> 8 & 255) / 255.0F;
    670            float var10 = (float)(var7 & 255) / 255.0F;
    671
    672            if (EntityRenderer.anaglyphEnable)
    673            {
    674                float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
    675                float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
    676                float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
    677                var8 = var11;
    678                var9 = var12;
    679                var10 = var13;
    680            }
    681
    682            var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10);
    683            int var34 = par1BlockBrewingStand.getBlockTextureFromSideAndMetadata(0, 0);
    684
    685            if (this.overrideBlockTexture >= 0)
    686            {
    687                var34 = this.overrideBlockTexture;
    688            }
    689
    690            int var35 = (var34 & 15) << 4;
    691            int var36 = var34 & 240;
    692            double var14 = (double)((float)var36 / 256.0F);
    693            double var16 = (double)(((float)var36 + 15.99F) / 256.0F);
    694            int var18 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    695
    696            for (int var19 = 0; var19 < 3; ++var19)
    697            {
    698                double var20 = (double)var19 * Math.PI * 2.0D / 3.0D + (Math.PI / 2D);
    699                double var22 = (double)(((float)var35 + 8.0F) / 256.0F);
    700                double var24 = (double)(((float)var35 + 15.99F) / 256.0F);
    701
    702                if ((var18 & 1 << var19) != 0)
    703                {
    704                    var22 = (double)(((float)var35 + 7.99F) / 256.0F);
    705                    var24 = (double)(((float)var35 + 0.0F) / 256.0F);
    706                }
    707
    708                double var26 = (double)par2 + 0.5D;
    709                double var28 = (double)par2 + 0.5D + Math.sin(var20) * 8.0D / 16.0D;
    710                double var30 = (double)par4 + 0.5D;
    711                double var32 = (double)par4 + 0.5D + Math.cos(var20) * 8.0D / 16.0D;
    712                var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var14);
    713                var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var16);
    714                var5.addVertexWithUV(var28, (double)(par3 + 0), var32, var24, var16);
    715                var5.addVertexWithUV(var28, (double)(par3 + 1), var32, var24, var14);
    716                var5.addVertexWithUV(var28, (double)(par3 + 1), var32, var24, var14);
    717                var5.addVertexWithUV(var28, (double)(par3 + 0), var32, var24, var16);
    718                var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var16);
    719                var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var14);
    720            }
    721
    722            par1BlockBrewingStand.setBlockBoundsForItemRender();
    723            return true;
    724        }
    725
    726        /**
    727         * Render block cauldron
    728         */
    729        public boolean renderBlockCauldron(BlockCauldron par1BlockCauldron, int par2, int par3, int par4)
    730        {
    731            this.renderStandardBlock(par1BlockCauldron, par2, par3, par4);
    732            Tessellator var5 = Tessellator.instance;
    733            var5.setBrightness(par1BlockCauldron.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    734            float var6 = 1.0F;
    735            int var7 = par1BlockCauldron.colorMultiplier(this.blockAccess, par2, par3, par4);
    736            float var8 = (float)(var7 >> 16 & 255) / 255.0F;
    737            float var9 = (float)(var7 >> 8 & 255) / 255.0F;
    738            float var10 = (float)(var7 & 255) / 255.0F;
    739            float var12;
    740
    741            if (EntityRenderer.anaglyphEnable)
    742            {
    743                float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
    744                var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
    745                float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
    746                var8 = var11;
    747                var9 = var12;
    748                var10 = var13;
    749            }
    750
    751            var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10);
    752            short var16 = 154;
    753            var12 = 0.125F;
    754            this.renderSouthFace(par1BlockCauldron, (double)((float)par2 - 1.0F + var12), (double)par3, (double)par4, var16);
    755            this.renderNorthFace(par1BlockCauldron, (double)((float)par2 + 1.0F - var12), (double)par3, (double)par4, var16);
    756            this.renderWestFace(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var12), var16);
    757            this.renderEastFace(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var12), var16);
    758            short var17 = 139;
    759            this.renderTopFace(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + 0.25F), (double)par4, var17);
    760            this.renderBottomFace(par1BlockCauldron, (double)par2, (double)((float)par3 + 1.0F - 0.75F), (double)par4, var17);
    761            int var14 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    762
    763            if (var14 > 0)
    764            {
    765                short var15 = 205;
    766
    767                if (var14 > 3)
    768                {
    769                    var14 = 3;
    770                }
    771
    772                this.renderTopFace(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)par4, var15);
    773            }
    774
    775            return true;
    776        }
    777
    778        public boolean func_82780_a(BlockFlowerPot par1BlockFlowerPot, int par2, int par3, int par4)
    779        {
    780            this.renderStandardBlock(par1BlockFlowerPot, par2, par3, par4);
    781            Tessellator var5 = Tessellator.instance;
    782            var5.setBrightness(par1BlockFlowerPot.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    783            float var6 = 1.0F;
    784            int var7 = par1BlockFlowerPot.colorMultiplier(this.blockAccess, par2, par3, par4);
    785            int var8 = par1BlockFlowerPot.getBlockTextureFromSide(0);
    786            float var9 = (float)(var7 >> 16 & 255) / 255.0F;
    787            float var10 = (float)(var7 >> 8 & 255) / 255.0F;
    788            float var11 = (float)(var7 & 255) / 255.0F;
    789            float var12;
    790            float var14;
    791
    792            if (EntityRenderer.anaglyphEnable)
    793            {
    794                var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F;
    795                float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F;
    796                var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F;
    797                var9 = var12;
    798                var10 = var13;
    799                var11 = var14;
    800            }
    801
    802            var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11);
    803            var12 = 0.1865F;
    804            this.renderSouthFace(par1BlockFlowerPot, (double)((float)par2 - 0.5F + var12), (double)par3, (double)par4, var8);
    805            this.renderNorthFace(par1BlockFlowerPot, (double)((float)par2 + 0.5F - var12), (double)par3, (double)par4, var8);
    806            this.renderWestFace(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 - 0.5F + var12), var8);
    807            this.renderEastFace(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 + 0.5F - var12), var8);
    808            this.renderTopFace(par1BlockFlowerPot, (double)par2, (double)((float)par3 - 0.5F + var12 + 0.1875F), (double)par4, Block.dirt.blockIndexInTexture);
    809            int var19 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    810
    811            if (var19 != 0)
    812            {
    813                var14 = 0.0F;
    814                float var15 = 4.0F;
    815                float var16 = 0.0F;
    816                BlockFlower var17 = null;
    817
    818                switch (var19)
    819                {
    820                    case 1:
    821                        var17 = Block.plantRed;
    822                        break;
    823                    case 2:
    824                        var17 = Block.plantYellow;
    825                    case 3:
    826                    case 4:
    827                    case 5:
    828                    case 6:
    829                    default:
    830                        break;
    831                    case 7:
    832                        var17 = Block.mushroomRed;
    833                        break;
    834                    case 8:
    835                        var17 = Block.mushroomBrown;
    836                }
    837
    838                var5.addTranslation(var14 / 16.0F, var15 / 16.0F, var16 / 16.0F);
    839
    840                if (var17 != null)
    841                {
    842                    this.renderBlockByRenderType(var17, par2, par3, par4);
    843                }
    844                else if (var19 == 9)
    845                {
    846                    float var18 = 0.125F;
    847                    Block.cactus.setBlockBounds(0.5F - var18, 0.0F, 0.5F - var18, 0.5F + var18, 0.25F, 0.5F + var18);
    848                    this.renderStandardBlock(Block.cactus, par2, par3, par4);
    849                    Block.cactus.setBlockBounds(0.5F - var18, 0.25F, 0.5F - var18, 0.5F + var18, 0.5F, 0.5F + var18);
    850                    this.renderStandardBlock(Block.cactus, par2, par3, par4);
    851                    Block.cactus.setBlockBounds(0.5F - var18, 0.5F, 0.5F - var18, 0.5F + var18, 0.75F, 0.5F + var18);
    852                    this.renderStandardBlock(Block.cactus, par2, par3, par4);
    853                    Block.cactus.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    854                }
    855                else if (var19 == 3)
    856                {
    857                    this.drawCrossedSquares(Block.sapling, 0, (double)par2, (double)par3, (double)par4, 0.75F);
    858                }
    859                else if (var19 == 5)
    860                {
    861                    this.drawCrossedSquares(Block.sapling, 2, (double)par2, (double)par3, (double)par4, 0.75F);
    862                }
    863                else if (var19 == 4)
    864                {
    865                    this.drawCrossedSquares(Block.sapling, 1, (double)par2, (double)par3, (double)par4, 0.75F);
    866                }
    867                else if (var19 == 6)
    868                {
    869                    this.drawCrossedSquares(Block.sapling, 3, (double)par2, (double)par3, (double)par4, 0.75F);
    870                }
    871                else if (var19 == 11)
    872                {
    873                    var7 = Block.tallGrass.colorMultiplier(this.blockAccess, par2, par3, par4);
    874                    var9 = (float)(var7 >> 16 & 255) / 255.0F;
    875                    var10 = (float)(var7 >> 8 & 255) / 255.0F;
    876                    var11 = (float)(var7 & 255) / 255.0F;
    877                    var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11);
    878                    this.drawCrossedSquares(Block.tallGrass, 2, (double)par2, (double)par3, (double)par4, 0.75F);
    879                }
    880                else if (var19 == 10)
    881                {
    882                    this.drawCrossedSquares(Block.deadBush, 2, (double)par2, (double)par3, (double)par4, 0.75F);
    883                }
    884
    885                var5.addTranslation(-var14 / 16.0F, -var15 / 16.0F, -var16 / 16.0F);
    886            }
    887
    888            return true;
    889        }
    890
    891        public boolean func_82775_a(BlockAnvil par1BlockAnvil, int par2, int par3, int par4)
    892        {
    893            Tessellator var5 = Tessellator.instance;
    894            var5.setBrightness(par1BlockAnvil.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    895            float var6 = 1.0F;
    896            int var7 = par1BlockAnvil.colorMultiplier(this.blockAccess, par2, par3, par4);
    897            float var8 = (float)(var7 >> 16 & 255) / 255.0F;
    898            float var9 = (float)(var7 >> 8 & 255) / 255.0F;
    899            float var10 = (float)(var7 & 255) / 255.0F;
    900
    901            if (EntityRenderer.anaglyphEnable)
    902            {
    903                float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
    904                float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
    905                float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
    906                var8 = var11;
    907                var9 = var12;
    908                var10 = var13;
    909            }
    910
    911            var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10);
    912            return this.func_82776_a(par1BlockAnvil, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4), false);
    913        }
    914
    915        public boolean func_82776_a(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, boolean par6)
    916        {
    917            int var7 = par6 ? 0 : par5 & 3;
    918            boolean var8 = false;
    919            float var9 = 0.0F;
    920
    921            switch (var7)
    922            {
    923                case 0:
    924                    this.uvRotateSouth = 2;
    925                    this.uvRotateNorth = 1;
    926                    this.uvRotateTop = 3;
    927                    this.uvRotateBottom = 3;
    928                    break;
    929                case 1:
    930                    this.uvRotateEast = 1;
    931                    this.uvRotateWest = 2;
    932                    this.uvRotateTop = 2;
    933                    this.uvRotateBottom = 1;
    934                    var8 = true;
    935                    break;
    936                case 2:
    937                    this.uvRotateSouth = 1;
    938                    this.uvRotateNorth = 2;
    939                    break;
    940                case 3:
    941                    this.uvRotateEast = 2;
    942                    this.uvRotateWest = 1;
    943                    this.uvRotateTop = 1;
    944                    this.uvRotateBottom = 2;
    945                    var8 = true;
    946            }
    947
    948            var9 = this.func_82777_a(par1BlockAnvil, par2, par3, par4, 0, var9, 0.75F, 0.25F, 0.75F, var8, par6, par5);
    949            var9 = this.func_82777_a(par1BlockAnvil, par2, par3, par4, 1, var9, 0.5F, 0.0625F, 0.625F, var8, par6, par5);
    950            var9 = this.func_82777_a(par1BlockAnvil, par2, par3, par4, 2, var9, 0.25F, 0.3125F, 0.5F, var8, par6, par5);
    951            this.func_82777_a(par1BlockAnvil, par2, par3, par4, 3, var9, 0.625F, 0.375F, 1.0F, var8, par6, par5);
    952            par1BlockAnvil.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    953            this.uvRotateEast = 0;
    954            this.uvRotateWest = 0;
    955            this.uvRotateSouth = 0;
    956            this.uvRotateNorth = 0;
    957            this.uvRotateTop = 0;
    958            this.uvRotateBottom = 0;
    959            return true;
    960        }
    961
    962        public float func_82777_a(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, float par6, float par7, float par8, float par9, boolean par10, boolean par11, int par12)
    963        {
    964            if (par10)
    965            {
    966                float var13 = par7;
    967                par7 = par9;
    968                par9 = var13;
    969            }
    970
    971            par7 /= 2.0F;
    972            par9 /= 2.0F;
    973            par1BlockAnvil.field_82521_b = par5;
    974            par1BlockAnvil.setBlockBounds(0.5F - par7, par6, 0.5F - par9, 0.5F + par7, par6 + par8, 0.5F + par9);
    975
    976            if (par11)
    977            {
    978                Tessellator var14 = Tessellator.instance;
    979                var14.startDrawingQuads();
    980                var14.setNormal(0.0F, 1.0F, 0.0F);
    981                this.renderTopFace(par1BlockAnvil, 0.0D, 0.0D, 0.0D, par1BlockAnvil.getBlockTextureFromSideAndMetadata(1, par12));
    982                var14.draw();
    983                var14.startDrawingQuads();
    984                var14.setNormal(0.0F, 0.0F, -1.0F);
    985                this.renderEastFace(par1BlockAnvil, 0.0D, 0.0D, 0.0D, par1BlockAnvil.getBlockTextureFromSideAndMetadata(2, par12));
    986                var14.draw();
    987                var14.startDrawingQuads();
    988                var14.setNormal(0.0F, 0.0F, 1.0F);
    989                this.renderWestFace(par1BlockAnvil, 0.0D, 0.0D, 0.0D, par1BlockAnvil.getBlockTextureFromSideAndMetadata(3, par12));
    990                var14.draw();
    991                var14.startDrawingQuads();
    992                var14.setNormal(-1.0F, 0.0F, 0.0F);
    993                this.renderNorthFace(par1BlockAnvil, 0.0D, 0.0D, 0.0D, par1BlockAnvil.getBlockTextureFromSideAndMetadata(4, par12));
    994                var14.draw();
    995                var14.startDrawingQuads();
    996                var14.setNormal(1.0F, 0.0F, 0.0F);
    997                this.renderSouthFace(par1BlockAnvil, 0.0D, 0.0D, 0.0D, par1BlockAnvil.getBlockTextureFromSideAndMetadata(5, par12));
    998                var14.draw();
    999            }
    1000            else
    1001            {
    1002                this.renderStandardBlock(par1BlockAnvil, par2, par3, par4);
    1003            }
    1004
    1005            return par6 + par8;
    1006        }
    1007
    1008        /**
    1009         * Renders a torch block at the given coordinates
    1010         */
    1011        public boolean renderBlockTorch(Block par1Block, int par2, int par3, int par4)
    1012        {
    1013            int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    1014            Tessellator var6 = Tessellator.instance;
    1015            var6.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    1016            var6.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    1017            double var7 = 0.4000000059604645D;
    1018            double var9 = 0.5D - var7;
    1019            double var11 = 0.20000000298023224D;
    1020
    1021            if (var5 == 1)
    1022            {
    1023                this.renderTorchAtAngle(par1Block, (double)par2 - var9, (double)par3 + var11, (double)par4, -var7, 0.0D);
    1024            }
    1025            else if (var5 == 2)
    1026            {
    1027                this.renderTorchAtAngle(par1Block, (double)par2 + var9, (double)par3 + var11, (double)par4, var7, 0.0D);
    1028            }
    1029            else if (var5 == 3)
    1030            {
    1031                this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 - var9, 0.0D, -var7);
    1032            }
    1033            else if (var5 == 4)
    1034            {
    1035                this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 + var9, 0.0D, var7);
    1036            }
    1037            else
    1038            {
    1039                this.renderTorchAtAngle(par1Block, (double)par2, (double)par3, (double)par4, 0.0D, 0.0D);
    1040            }
    1041
    1042            return true;
    1043        }
    1044
    1045        /**
    1046         * render a redstone repeater at the given coordinates
    1047         */
    1048        public boolean renderBlockRepeater(Block par1Block, int par2, int par3, int par4)
    1049        {
    1050            int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    1051            int var6 = var5 & 3;
    1052            int var7 = (var5 & 12) >> 2;
    1053            this.renderStandardBlock(par1Block, par2, par3, par4);
    1054            Tessellator var8 = Tessellator.instance;
    1055            var8.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    1056            var8.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    1057            double var9 = -0.1875D;
    1058            boolean var11 = ((BlockRedstoneRepeater)par1Block).func_82523_e(this.blockAccess, par2, par3, par4, var5);
    1059            double var12 = 0.0D;
    1060            double var14 = 0.0D;
    1061            double var16 = 0.0D;
    1062            double var18 = 0.0D;
    1063
    1064            switch (var6)
    1065            {
    1066                case 0:
    1067                    var18 = -0.3125D;
    1068                    var14 = BlockRedstoneRepeater.repeaterTorchOffset[var7];
    1069                    break;
    1070                case 1:
    1071                    var16 = 0.3125D;
    1072                    var12 = -BlockRedstoneRepeater.repeaterTorchOffset[var7];
    1073                    break;
    1074                case 2:
    1075                    var18 = 0.3125D;
    1076                    var14 = -BlockRedstoneRepeater.repeaterTorchOffset[var7];
    1077                    break;
    1078                case 3:
    1079                    var16 = -0.3125D;
    1080                    var12 = BlockRedstoneRepeater.repeaterTorchOffset[var7];
    1081            }
    1082
    1083            if (!var11)
    1084            {
    1085                this.renderTorchAtAngle(par1Block, (double)par2 + var12, (double)par3 + var9, (double)par4 + var14, 0.0D, 0.0D);
    1086            }
    1087            else
    1088            {
    1089                this.func_82774_a(17);
    1090                byte var20 = 16;
    1091                byte var21 = 16;
    1092                float var22 = 2.0F;
    1093                float var23 = 14.0F;
    1094                float var24 = 7.0F;
    1095                float var25 = 9.0F;
    1096
    1097                switch (var6)
    1098                {
    1099                    case 1:
    1100                    case 3:
    1101                        var22 = 7.0F;
    1102                        var23 = 9.0F;
    1103                        var24 = 2.0F;
    1104                        var25 = 14.0F;
    1105                    case 0:
    1106                    case 2:
    1107                    default:
    1108                        par1Block.setBlockBounds(var22 / 16.0F + (float)var12, 0.125F, var24 / 16.0F + (float)var14, var23 / 16.0F + (float)var12, 0.25F, var25 / 16.0F + (float)var14);
    1109                        var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, (double)(((float)var20 + var22) / 256.0F), (double)(((float)var21 + var24) / 256.0F));
    1110                        var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var25 / 16.0F) + var14, (double)(((float)var20 + var22) / 256.0F), (double)(((float)var21 + var25) / 256.0F));
    1111                        var8.addVertexWithUV((double)((float)par2 + var23 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var25 / 16.0F) + var14, (double)(((float)var20 + var23) / 256.0F), (double)(((float)var21 + var25) / 256.0F));
    1112                        var8.addVertexWithUV((double)((float)par2 + var23 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, (double)(((float)var20 + var23) / 256.0F), (double)(((float)var21 + var24) / 256.0F));
    1113                        this.renderStandardBlock(par1Block, par2, par3, par4);
    1114                        par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
    1115                        this.clearOverrideBlockTexture();
    1116                }
    1117            }
    1118
    1119            var8.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    1120            var8.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    1121            this.renderTorchAtAngle(par1Block, (double)par2 + var16, (double)par3 + var9, (double)par4 + var18, 0.0D, 0.0D);
    1122            int var51 = par1Block.getBlockTextureFromSide(1);
    1123            int var53 = (var51 & 15) << 4;
    1124            int var52 = var51 & 240;
    1125            double var55 = (double)((float)var53 / 256.0F);
    1126            double var54 = (double)(((float)var53 + 15.99F) / 256.0F);
    1127            double var27 = (double)((float)var52 / 256.0F);
    1128            double var29 = (double)(((float)var52 + 15.99F) / 256.0F);
    1129            double var31 = 0.125D;
    1130            double var33 = (double)(par2 + 1);
    1131            double var35 = (double)(par2 + 1);
    1132            double var37 = (double)(par2 + 0);
    1133            double var39 = (double)(par2 + 0);
    1134            double var41 = (double)(par4 + 0);
    1135            double var43 = (double)(par4 + 1);
    1136            double var45 = (double)(par4 + 1);
    1137            double var47 = (double)(par4 + 0);
    1138            double var49 = (double)par3 + var31;
    1139
    1140            if (var6 == 2)
    1141            {
    1142                var33 = var35 = (double)(par2 + 0);
    1143                var37 = var39 = (double)(par2 + 1);
    1144                var41 = var47 = (double)(par4 + 1);
    1145                var43 = var45 = (double)(par4 + 0);
    1146            }
    1147            else if (var6 == 3)
    1148            {
    1149                var33 = var39 = (double)(par2 + 0);
    1150                var35 = var37 = (double)(par2 + 1);
    1151                var41 = var43 = (double)(par4 + 0);
    1152                var45 = var47 = (double)(par4 + 1);
    1153            }
    1154            else if (var6 == 1)
    1155            {
    1156                var33 = var39 = (double)(par2 + 1);
    1157                var35 = var37 = (double)(par2 + 0);
    1158                var41 = var43 = (double)(par4 + 1);
    1159                var45 = var47 = (double)(par4 + 0);
    1160            }
    1161
    1162            var8.addVertexWithUV(var39, var49, var47, var55, var27);
    1163            var8.addVertexWithUV(var37, var49, var45, var55, var29);
    1164            var8.addVertexWithUV(var35, var49, var43, var54, var29);
    1165            var8.addVertexWithUV(var33, var49, var41, var54, var27);
    1166            return true;
    1167        }
    1168
    1169        /**
    1170         * Render all faces of the piston base
    1171         */
    1172        public void renderPistonBaseAllFaces(Block par1Block, int par2, int par3, int par4)
    1173        {
    1174            this.renderAllFaces = true;
    1175            this.renderPistonBase(par1Block, par2, par3, par4, true);
    1176            this.renderAllFaces = false;
    1177        }
    1178
    1179        /**
    1180         * renders a block as a piston base
    1181         */
    1182        public boolean renderPistonBase(Block par1Block, int par2, int par3, int par4, boolean par5)
    1183        {
    1184            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    1185            boolean var7 = par5 || (var6 & 8) != 0;
    1186            int var8 = BlockPistonBase.getOrientation(var6);
    1187
    1188            if (var7)
    1189            {
    1190                switch (var8)
    1191                {
    1192                    case 0:
    1193                        this.uvRotateEast = 3;
    1194                        this.uvRotateWest = 3;
    1195                        this.uvRotateSouth = 3;
    1196                        this.uvRotateNorth = 3;
    1197                        par1Block.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F);
    1198                        break;
    1199                    case 1:
    1200                        par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
    1201                        break;
    1202                    case 2:
    1203                        this.uvRotateSouth = 1;
    1204                        this.uvRotateNorth = 2;
    1205                        par1Block.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F);
    1206                        break;
    1207                    case 3:
    1208                        this.uvRotateSouth = 2;
    1209                        this.uvRotateNorth = 1;
    1210                        this.uvRotateTop = 3;
    1211                        this.uvRotateBottom = 3;
    1212                        par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F);
    1213                        break;
    1214                    case 4:
    1215                        this.uvRotateEast = 1;
    1216                        this.uvRotateWest = 2;
    1217                        this.uvRotateTop = 2;
    1218                        this.uvRotateBottom = 1;
    1219                        par1Block.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    1220                        break;
    1221                    case 5:
    1222                        this.uvRotateEast = 2;
    1223                        this.uvRotateWest = 1;
    1224                        this.uvRotateTop = 1;
    1225                        this.uvRotateBottom = 2;
    1226                        par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F);
    1227                }
    1228
    1229                this.renderStandardBlock(par1Block, par2, par3, par4);
    1230                this.uvRotateEast = 0;
    1231                this.uvRotateWest = 0;
    1232                this.uvRotateSouth = 0;
    1233                this.uvRotateNorth = 0;
    1234                this.uvRotateTop = 0;
    1235                this.uvRotateBottom = 0;
    1236                par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    1237            }
    1238            else
    1239            {
    1240                switch (var8)
    1241                {
    1242                    case 0:
    1243                        this.uvRotateEast = 3;
    1244                        this.uvRotateWest = 3;
    1245                        this.uvRotateSouth = 3;
    1246                        this.uvRotateNorth = 3;
    1247                    case 1:
    1248                    default:
    1249                        break;
    1250                    case 2:
    1251                        this.uvRotateSouth = 1;
    1252                        this.uvRotateNorth = 2;
    1253                        break;
    1254                    case 3:
    1255                        this.uvRotateSouth = 2;
    1256                        this.uvRotateNorth = 1;
    1257                        this.uvRotateTop = 3;
    1258                        this.uvRotateBottom = 3;
    1259                        break;
    1260                    case 4:
    1261                        this.uvRotateEast = 1;
    1262                        this.uvRotateWest = 2;
    1263                        this.uvRotateTop = 2;
    1264                        this.uvRotateBottom = 1;
    1265                        break;
    1266                    case 5:
    1267                        this.uvRotateEast = 2;
    1268                        this.uvRotateWest = 1;
    1269                        this.uvRotateTop = 1;
    1270                        this.uvRotateBottom = 2;
    1271                }
    1272
    1273                this.renderStandardBlock(par1Block, par2, par3, par4);
    1274                this.uvRotateEast = 0;
    1275                this.uvRotateWest = 0;
    1276                this.uvRotateSouth = 0;
    1277                this.uvRotateNorth = 0;
    1278                this.uvRotateTop = 0;
    1279                this.uvRotateBottom = 0;
    1280            }
    1281
    1282            return true;
    1283        }
    1284
    1285        /**
    1286         * Render piston rod up/down
    1287         */
    1288        public void renderPistonRodUD(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14)
    1289        {
    1290            int var16 = 108;
    1291
    1292            if (this.overrideBlockTexture >= 0)
    1293            {
    1294                var16 = this.overrideBlockTexture;
    1295            }
    1296
    1297            int var17 = (var16 & 15) << 4;
    1298            int var18 = var16 & 240;
    1299            Tessellator var19 = Tessellator.instance;
    1300            double var20 = (double)((float)(var17 + 0) / 256.0F);
    1301            double var22 = (double)((float)(var18 + 0) / 256.0F);
    1302            double var24 = ((double)var17 + par14 - 0.01D) / 256.0D;
    1303            double var26 = ((double)((float)var18 + 4.0F) - 0.01D) / 256.0D;
    1304            var19.setColorOpaque_F(par13, par13, par13);
    1305            var19.addVertexWithUV(par1, par7, par9, var24, var22);
    1306            var19.addVertexWithUV(par1, par5, par9, var20, var22);
    1307            var19.addVertexWithUV(par3, par5, par11, var20, var26);
    1308            var19.addVertexWithUV(par3, par7, par11, var24, var26);
    1309        }
    1310
    1311        /**
    1312         * Render piston rod south/north
    1313         */
    1314        public void renderPistonRodSN(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14)
    1315        {
    1316            int var16 = 108;
    1317
    1318            if (this.overrideBlockTexture >= 0)
    1319            {
    1320                var16 = this.overrideBlockTexture;
    1321            }
    1322
    1323            int var17 = (var16 & 15) << 4;
    1324            int var18 = var16 & 240;
    1325            Tessellator var19 = Tessellator.instance;
    1326            double var20 = (double)((float)(var17 + 0) / 256.0F);
    1327            double var22 = (double)((float)(var18 + 0) / 256.0F);
    1328            double var24 = ((double)var17 + par14 - 0.01D) / 256.0D;
    1329            double var26 = ((double)((float)var18 + 4.0F) - 0.01D) / 256.0D;
    1330            var19.setColorOpaque_F(par13, par13, par13);
    1331            var19.addVertexWithUV(par1, par5, par11, var24, var22);
    1332            var19.addVertexWithUV(par1, par5, par9, var20, var22);
    1333            var19.addVertexWithUV(par3, par7, par9, var20, var26);
    1334            var19.addVertexWithUV(par3, par7, par11, var24, var26);
    1335        }
    1336
    1337        /**
    1338         * Render piston rod east/west
    1339         */
    1340        public void renderPistonRodEW(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14)
    1341        {
    1342            int var16 = 108;
    1343
    1344            if (this.overrideBlockTexture >= 0)
    1345            {
    1346                var16 = this.overrideBlockTexture;
    1347            }
    1348
    1349            int var17 = (var16 & 15) << 4;
    1350            int var18 = var16 & 240;
    1351            Tessellator var19 = Tessellator.instance;
    1352            double var20 = (double)((float)(var17 + 0) / 256.0F);
    1353            double var22 = (double)((float)(var18 + 0) / 256.0F);
    1354            double var24 = ((double)var17 + par14 - 0.01D) / 256.0D;
    1355            double var26 = ((double)((float)var18 + 4.0F) - 0.01D) / 256.0D;
    1356            var19.setColorOpaque_F(par13, par13, par13);
    1357            var19.addVertexWithUV(par3, par5, par9, var24, var22);
    1358            var19.addVertexWithUV(par1, par5, par9, var20, var22);
    1359            var19.addVertexWithUV(par1, par7, par11, var20, var26);
    1360            var19.addVertexWithUV(par3, par7, par11, var24, var26);
    1361        }
    1362
    1363        /**
    1364         * Render all faces of the piston extension
    1365         */
    1366        public void renderPistonExtensionAllFaces(Block par1Block, int par2, int par3, int par4, boolean par5)
    1367        {
    1368            this.renderAllFaces = true;
    1369            this.renderPistonExtension(par1Block, par2, par3, par4, par5);
    1370            this.renderAllFaces = false;
    1371        }
    1372
    1373        /**
    1374         * renders the pushing part of a piston
    1375         */
    1376        public boolean renderPistonExtension(Block par1Block, int par2, int par3, int par4, boolean par5)
    1377        {
    1378            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    1379            int var7 = BlockPistonExtension.getDirectionMeta(var6);
    1380            float var11 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4);
    1381            float var12 = par5 ? 1.0F : 0.5F;
    1382            double var13 = par5 ? 16.0D : 8.0D;
    1383
    1384            switch (var7)
    1385            {
    1386                case 0:
    1387                    this.uvRotateEast = 3;
    1388                    this.uvRotateWest = 3;
    1389                    this.uvRotateSouth = 3;
    1390                    this.uvRotateNorth = 3;
    1391                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F);
    1392                    this.renderStandardBlock(par1Block, par2, par3, par4);
    1393                    this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13);
    1394                    this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13);
    1395                    this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13);
    1396                    this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13);
    1397                    break;
    1398                case 1:
    1399                    par1Block.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F);
    1400                    this.renderStandardBlock(par1Block, par2, par3, par4);
    1401                    this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13);
    1402                    this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13);
    1403                    this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13);
    1404                    this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13);
    1405                    break;
    1406                case 2:
    1407                    this.uvRotateSouth = 1;
    1408                    this.uvRotateNorth = 2;
    1409                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F);
    1410                    this.renderStandardBlock(par1Block, par2, par3, par4);
    1411                    this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13);
    1412                    this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13);
    1413                    this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.5F, var13);
    1414                    this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11, var13);
    1415                    break;
    1416                case 3:
    1417                    this.uvRotateSouth = 2;
    1418                    this.uvRotateNorth = 1;
    1419                    this.uvRotateTop = 3;
    1420                    this.uvRotateBottom = 3;
    1421                    par1Block.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F);
    1422                    this.renderStandardBlock(par1Block, par2, par3, par4);
    1423                    this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13);
    1424                    this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13);
    1425                    this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.5F, var13);
    1426                    this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11, var13);
    1427                    break;
    1428                case 4:
    1429                    this.uvRotateEast = 1;
    1430                    this.uvRotateWest = 2;
    1431                    this.uvRotateTop = 2;
    1432                    this.uvRotateBottom = 1;
    1433                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F);
    1434                    this.renderStandardBlock(par1Block, par2, par3, par4);
    1435                    this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13);
    1436                    this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13);
    1437                    this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13);
    1438                    this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13);
    1439                    break;
    1440                case 5:
    1441                    this.uvRotateEast = 2;
    1442                    this.uvRotateWest = 1;
    1443                    this.uvRotateTop = 1;
    1444                    this.uvRotateBottom = 2;
    1445                    par1Block.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    1446                    this.renderStandardBlock(par1Block, par2, par3, par4);
    1447                    this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13);
    1448                    this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13);
    1449                    this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13);
    1450                    this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13);
    1451            }
    1452
    1453            this.uvRotateEast = 0;
    1454            this.uvRotateWest = 0;
    1455            this.uvRotateSouth = 0;
    1456            this.uvRotateNorth = 0;
    1457            this.uvRotateTop = 0;
    1458            this.uvRotateBottom = 0;
    1459            par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    1460            return true;
    1461        }
    1462
    1463        /**
    1464         * Renders a lever block at the given coordinates
    1465         */
    1466        public boolean renderBlockLever(Block par1Block, int par2, int par3, int par4)
    1467        {
    1468            int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    1469            int var6 = var5 & 7;
    1470            boolean var7 = (var5 & 8) > 0;
    1471            Tessellator var8 = Tessellator.instance;
    1472            boolean var9 = this.overrideBlockTexture >= 0;
    1473
    1474            if (!var9)
    1475            {
    1476                this.overrideBlockTexture = Block.cobblestone.blockIndexInTexture;
    1477            }
    1478
    1479            float var10 = 0.25F;
    1480            float var11 = 0.1875F;
    1481            float var12 = 0.1875F;
    1482
    1483            if (var6 == 5)
    1484            {
    1485                par1Block.setBlockBounds(0.5F - var11, 0.0F, 0.5F - var10, 0.5F + var11, var12, 0.5F + var10);
    1486            }
    1487            else if (var6 == 6)
    1488            {
    1489                par1Block.setBlockBounds(0.5F - var10, 0.0F, 0.5F - var11, 0.5F + var10, var12, 0.5F + var11);
    1490            }
    1491            else if (var6 == 4)
    1492            {
    1493                par1Block.setBlockBounds(0.5F - var11, 0.5F - var10, 1.0F - var12, 0.5F + var11, 0.5F + var10, 1.0F);
    1494            }
    1495            else if (var6 == 3)
    1496            {
    1497                par1Block.setBlockBounds(0.5F - var11, 0.5F - var10, 0.0F, 0.5F + var11, 0.5F + var10, var12);
    1498            }
    1499            else if (var6 == 2)
    1500            {
    1501                par1Block.setBlockBounds(1.0F - var12, 0.5F - var10, 0.5F - var11, 1.0F, 0.5F + var10, 0.5F + var11);
    1502            }
    1503            else if (var6 == 1)
    1504            {
    1505                par1Block.setBlockBounds(0.0F, 0.5F - var10, 0.5F - var11, var12, 0.5F + var10, 0.5F + var11);
    1506            }
    1507            else if (var6 == 0)
    1508            {
    1509                par1Block.setBlockBounds(0.5F - var10, 1.0F - var12, 0.5F - var11, 0.5F + var10, 1.0F, 0.5F + var11);
    1510            }
    1511            else if (var6 == 7)
    1512            {
    1513                par1Block.setBlockBounds(0.5F - var11, 1.0F - var12, 0.5F - var10, 0.5F + var11, 1.0F, 0.5F + var10);
    1514            }
    1515
    1516            this.renderStandardBlock(par1Block, par2, par3, par4);
    1517
    1518            if (!var9)
    1519            {
    1520                this.overrideBlockTexture = -1;
    1521            }
    1522
    1523            var8.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    1524            float var13 = 1.0F;
    1525
    1526            if (Block.lightValue[par1Block.blockID] > 0)
    1527            {
    1528                var13 = 1.0F;
    1529            }
    1530
    1531            var8.setColorOpaque_F(var13, var13, var13);
    1532            int var14 = par1Block.getBlockTextureFromSide(0);
    1533
    1534            if (this.overrideBlockTexture >= 0)
    1535            {
    1536                var14 = this.overrideBlockTexture;
    1537            }
    1538
    1539            int var15 = (var14 & 15) << 4;
    1540            int var16 = var14 & 240;
    1541            float var17 = (float)var15 / 256.0F;
    1542            float var18 = ((float)var15 + 15.99F) / 256.0F;
    1543            float var19 = (float)var16 / 256.0F;
    1544            float var20 = ((float)var16 + 15.99F) / 256.0F;
    1545            Vec3[] var21 = new Vec3[8];
    1546            float var22 = 0.0625F;
    1547            float var23 = 0.0625F;
    1548            float var24 = 0.625F;
    1549            var21[0] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var22), 0.0D, (double)(-var23));
    1550            var21[1] = this.blockAccess.func_82732_R().getVecFromPool((double)var22, 0.0D, (double)(-var23));
    1551            var21[2] = this.blockAccess.func_82732_R().getVecFromPool((double)var22, 0.0D, (double)var23);
    1552            var21[3] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var22), 0.0D, (double)var23);
    1553            var21[4] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var22), (double)var24, (double)(-var23));
    1554            var21[5] = this.blockAccess.func_82732_R().getVecFromPool((double)var22, (double)var24, (double)(-var23));
    1555            var21[6] = this.blockAccess.func_82732_R().getVecFromPool((double)var22, (double)var24, (double)var23);
    1556            var21[7] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var22), (double)var24, (double)var23);
    1557
    1558            for (int var25 = 0; var25 < 8; ++var25)
    1559            {
    1560                if (var7)
    1561                {
    1562                    var21[var25].zCoord -= 0.0625D;
    1563                    var21[var25].rotateAroundX(((float)Math.PI * 2F / 9F));
    1564                }
    1565                else
    1566                {
    1567                    var21[var25].zCoord += 0.0625D;
    1568                    var21[var25].rotateAroundX(-((float)Math.PI * 2F / 9F));
    1569                }
    1570
    1571                if (var6 == 0 || var6 == 7)
    1572                {
    1573                    var21[var25].rotateAroundZ((float)Math.PI);
    1574                }
    1575
    1576                if (var6 == 6 || var6 == 0)
    1577                {
    1578                    var21[var25].rotateAroundY(((float)Math.PI / 2F));
    1579                }
    1580
    1581                if (var6 > 0 && var6 < 5)
    1582                {
    1583                    var21[var25].yCoord -= 0.375D;
    1584                    var21[var25].rotateAroundX(((float)Math.PI / 2F));
    1585
    1586                    if (var6 == 4)
    1587                    {
    1588                        var21[var25].rotateAroundY(0.0F);
    1589                    }
    1590
    1591                    if (var6 == 3)
    1592                    {
    1593                        var21[var25].rotateAroundY((float)Math.PI);
    1594                    }
    1595
    1596                    if (var6 == 2)
    1597                    {
    1598                        var21[var25].rotateAroundY(((float)Math.PI / 2F));
    1599                    }
    1600
    1601                    if (var6 == 1)
    1602                    {
    1603                        var21[var25].rotateAroundY(-((float)Math.PI / 2F));
    1604                    }
    1605
    1606                    var21[var25].xCoord += (double)par2 + 0.5D;
    1607                    var21[var25].yCoord += (double)((float)par3 + 0.5F);
    1608                    var21[var25].zCoord += (double)par4 + 0.5D;
    1609                }
    1610                else if (var6 != 0 && var6 != 7)
    1611                {
    1612                    var21[var25].xCoord += (double)par2 + 0.5D;
    1613                    var21[var25].yCoord += (double)((float)par3 + 0.125F);
    1614                    var21[var25].zCoord += (double)par4 + 0.5D;
    1615                }
    1616                else
    1617                {
    1618                    var21[var25].xCoord += (double)par2 + 0.5D;
    1619                    var21[var25].yCoord += (double)((float)par3 + 0.875F);
    1620                    var21[var25].zCoord += (double)par4 + 0.5D;
    1621                }
    1622            }
    1623
    1624            Vec3 var30 = null;
    1625            Vec3 var26 = null;
    1626            Vec3 var27 = null;
    1627            Vec3 var28 = null;
    1628
    1629            for (int var29 = 0; var29 < 6; ++var29)
    1630            {
    1631                if (var29 == 0)
    1632                {
    1633                    var17 = (float)(var15 + 7) / 256.0F;
    1634                    var18 = ((float)(var15 + 9) - 0.01F) / 256.0F;
    1635                    var19 = (float)(var16 + 6) / 256.0F;
    1636                    var20 = ((float)(var16 + 8) - 0.01F) / 256.0F;
    1637                }
    1638                else if (var29 == 2)
    1639                {
    1640                    var17 = (float)(var15 + 7) / 256.0F;
    1641                    var18 = ((float)(var15 + 9) - 0.01F) / 256.0F;
    1642                    var19 = (float)(var16 + 6) / 256.0F;
    1643                    var20 = ((float)(var16 + 16) - 0.01F) / 256.0F;
    1644                }
    1645
    1646                if (var29 == 0)
    1647                {
    1648                    var30 = var21[0];
    1649                    var26 = var21[1];
    1650                    var27 = var21[2];
    1651                    var28 = var21[3];
    1652                }
    1653                else if (var29 == 1)
    1654                {
    1655                    var30 = var21[7];
    1656                    var26 = var21[6];
    1657                    var27 = var21[5];
    1658                    var28 = var21[4];
    1659                }
    1660                else if (var29 == 2)
    1661                {
    1662                    var30 = var21[1];
    1663                    var26 = var21[0];
    1664                    var27 = var21[4];
    1665                    var28 = var21[5];
    1666                }
    1667                else if (var29 == 3)
    1668                {
    1669                    var30 = var21[2];
    1670                    var26 = var21[1];
    1671                    var27 = var21[5];
    1672                    var28 = var21[6];
    1673                }
    1674                else if (var29 == 4)
    1675                {
    1676                    var30 = var21[3];
    1677                    var26 = var21[2];
    1678                    var27 = var21[6];
    1679                    var28 = var21[7];
    1680                }
    1681                else if (var29 == 5)
    1682                {
    1683                    var30 = var21[0];
    1684                    var26 = var21[3];
    1685                    var27 = var21[7];
    1686                    var28 = var21[4];
    1687                }
    1688
    1689                var8.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, (double)var17, (double)var20);
    1690                var8.addVertexWithUV(var26.xCoord, var26.yCoord, var26.zCoord, (double)var18, (double)var20);
    1691                var8.addVertexWithUV(var27.xCoord, var27.yCoord, var27.zCoord, (double)var18, (double)var19);
    1692                var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, (double)var17, (double)var19);
    1693            }
    1694
    1695            return true;
    1696        }
    1697
    1698        /**
    1699         * Renders a trip wire source block at the given coordinates
    1700         */
    1701        public boolean renderBlockTripWireSource(Block par1Block, int par2, int par3, int par4)
    1702        {
    1703            Tessellator var5 = Tessellator.instance;
    1704            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    1705            int var7 = var6 & 3;
    1706            boolean var8 = (var6 & 4) == 4;
    1707            boolean var9 = (var6 & 8) == 8;
    1708            boolean var10 = !this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4);
    1709            boolean var11 = this.overrideBlockTexture >= 0;
    1710
    1711            if (!var11)
    1712            {
    1713                this.overrideBlockTexture = Block.planks.blockIndexInTexture;
    1714            }
    1715
    1716            float var12 = 0.25F;
    1717            float var13 = 0.125F;
    1718            float var14 = 0.125F;
    1719            float var15 = 0.3F - var12;
    1720            float var16 = 0.3F + var12;
    1721
    1722            if (var7 == 2)
    1723            {
    1724                par1Block.setBlockBounds(0.5F - var13, var15, 1.0F - var14, 0.5F + var13, var16, 1.0F);
    1725            }
    1726            else if (var7 == 0)
    1727            {
    1728                par1Block.setBlockBounds(0.5F - var13, var15, 0.0F, 0.5F + var13, var16, var14);
    1729            }
    1730            else if (var7 == 1)
    1731            {
    1732                par1Block.setBlockBounds(1.0F - var14, var15, 0.5F - var13, 1.0F, var16, 0.5F + var13);
    1733            }
    1734            else if (var7 == 3)
    1735            {
    1736                par1Block.setBlockBounds(0.0F, var15, 0.5F - var13, var14, var16, 0.5F + var13);
    1737            }
    1738
    1739            this.renderStandardBlock(par1Block, par2, par3, par4);
    1740
    1741            if (!var11)
    1742            {
    1743                this.overrideBlockTexture = -1;
    1744            }
    1745
    1746            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    1747            float var17 = 1.0F;
    1748
    1749            if (Block.lightValue[par1Block.blockID] > 0)
    1750            {
    1751                var17 = 1.0F;
    1752            }
    1753
    1754            var5.setColorOpaque_F(var17, var17, var17);
    1755            int var18 = par1Block.getBlockTextureFromSide(0);
    1756
    1757            if (this.overrideBlockTexture >= 0)
    1758            {
    1759                var18 = this.overrideBlockTexture;
    1760            }
    1761
    1762            int var19 = (var18 & 15) << 4;
    1763            int var20 = var18 & 240;
    1764            float var21 = (float)var19 / 256.0F;
    1765            float var22 = ((float)var19 + 15.99F) / 256.0F;
    1766            float var23 = (float)var20 / 256.0F;
    1767            float var24 = ((float)var20 + 15.99F) / 256.0F;
    1768            Vec3[] var25 = new Vec3[8];
    1769            float var26 = 0.046875F;
    1770            float var27 = 0.046875F;
    1771            float var28 = 0.3125F;
    1772            var25[0] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var26), 0.0D, (double)(-var27));
    1773            var25[1] = this.blockAccess.func_82732_R().getVecFromPool((double)var26, 0.0D, (double)(-var27));
    1774            var25[2] = this.blockAccess.func_82732_R().getVecFromPool((double)var26, 0.0D, (double)var27);
    1775            var25[3] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var26), 0.0D, (double)var27);
    1776            var25[4] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var26), (double)var28, (double)(-var27));
    1777            var25[5] = this.blockAccess.func_82732_R().getVecFromPool((double)var26, (double)var28, (double)(-var27));
    1778            var25[6] = this.blockAccess.func_82732_R().getVecFromPool((double)var26, (double)var28, (double)var27);
    1779            var25[7] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var26), (double)var28, (double)var27);
    1780
    1781            for (int var29 = 0; var29 < 8; ++var29)
    1782            {
    1783                var25[var29].zCoord += 0.0625D;
    1784
    1785                if (var9)
    1786                {
    1787                    var25[var29].rotateAroundX(0.5235988F);
    1788                    var25[var29].yCoord -= 0.4375D;
    1789                }
    1790                else if (var8)
    1791                {
    1792                    var25[var29].rotateAroundX(0.08726647F);
    1793                    var25[var29].yCoord -= 0.4375D;
    1794                }
    1795                else
    1796                {
    1797                    var25[var29].rotateAroundX(-((float)Math.PI * 2F / 9F));
    1798                    var25[var29].yCoord -= 0.375D;
    1799                }
    1800
    1801                var25[var29].rotateAroundX(((float)Math.PI / 2F));
    1802
    1803                if (var7 == 2)
    1804                {
    1805                    var25[var29].rotateAroundY(0.0F);
    1806                }
    1807
    1808                if (var7 == 0)
    1809                {
    1810                    var25[var29].rotateAroundY((float)Math.PI);
    1811                }
    1812
    1813                if (var7 == 1)
    1814                {
    1815                    var25[var29].rotateAroundY(((float)Math.PI / 2F));
    1816                }
    1817
    1818                if (var7 == 3)
    1819                {
    1820                    var25[var29].rotateAroundY(-((float)Math.PI / 2F));
    1821                }
    1822
    1823                var25[var29].xCoord += (double)par2 + 0.5D;
    1824                var25[var29].yCoord += (double)((float)par3 + 0.3125F);
    1825                var25[var29].zCoord += (double)par4 + 0.5D;
    1826            }
    1827
    1828            Vec3 var61 = null;
    1829            Vec3 var30 = null;
    1830            Vec3 var31 = null;
    1831            Vec3 var32 = null;
    1832            byte var33 = 7;
    1833            byte var34 = 9;
    1834            byte var35 = 9;
    1835            byte var36 = 16;
    1836
    1837            for (int var37 = 0; var37 < 6; ++var37)
    1838            {
    1839                if (var37 == 0)
    1840                {
    1841                    var61 = var25[0];
    1842                    var30 = var25[1];
    1843                    var31 = var25[2];
    1844                    var32 = var25[3];
    1845                    var21 = (float)(var19 + var33) / 256.0F;
    1846                    var22 = (float)(var19 + var34) / 256.0F;
    1847                    var23 = (float)(var20 + var35) / 256.0F;
    1848                    var24 = (float)(var20 + var35 + 2) / 256.0F;
    1849                }
    1850                else if (var37 == 1)
    1851                {
    1852                    var61 = var25[7];
    1853                    var30 = var25[6];
    1854                    var31 = var25[5];
    1855                    var32 = var25[4];
    1856                }
    1857                else if (var37 == 2)
    1858                {
    1859                    var61 = var25[1];
    1860                    var30 = var25[0];
    1861                    var31 = var25[4];
    1862                    var32 = var25[5];
    1863                    var21 = (float)(var19 + var33) / 256.0F;
    1864                    var22 = (float)(var19 + var34) / 256.0F;
    1865                    var23 = (float)(var20 + var35) / 256.0F;
    1866                    var24 = (float)(var20 + var36) / 256.0F;
    1867                }
    1868                else if (var37 == 3)
    1869                {
    1870                    var61 = var25[2];
    1871                    var30 = var25[1];
    1872                    var31 = var25[5];
    1873                    var32 = var25[6];
    1874                }
    1875                else if (var37 == 4)
    1876                {
    1877                    var61 = var25[3];
    1878                    var30 = var25[2];
    1879                    var31 = var25[6];
    1880                    var32 = var25[7];
    1881                }
    1882                else if (var37 == 5)
    1883                {
    1884                    var61 = var25[0];
    1885                    var30 = var25[3];
    1886                    var31 = var25[7];
    1887                    var32 = var25[4];
    1888                }
    1889
    1890                var5.addVertexWithUV(var61.xCoord, var61.yCoord, var61.zCoord, (double)var21, (double)var24);
    1891                var5.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, (double)var22, (double)var24);
    1892                var5.addVertexWithUV(var31.xCoord, var31.yCoord, var31.zCoord, (double)var22, (double)var23);
    1893                var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, (double)var21, (double)var23);
    1894            }
    1895
    1896            float var62 = 0.09375F;
    1897            float var38 = 0.09375F;
    1898            float var39 = 0.03125F;
    1899            var25[0] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var62), 0.0D, (double)(-var38));
    1900            var25[1] = this.blockAccess.func_82732_R().getVecFromPool((double)var62, 0.0D, (double)(-var38));
    1901            var25[2] = this.blockAccess.func_82732_R().getVecFromPool((double)var62, 0.0D, (double)var38);
    1902            var25[3] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var62), 0.0D, (double)var38);
    1903            var25[4] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var62), (double)var39, (double)(-var38));
    1904            var25[5] = this.blockAccess.func_82732_R().getVecFromPool((double)var62, (double)var39, (double)(-var38));
    1905            var25[6] = this.blockAccess.func_82732_R().getVecFromPool((double)var62, (double)var39, (double)var38);
    1906            var25[7] = this.blockAccess.func_82732_R().getVecFromPool((double)(-var62), (double)var39, (double)var38);
    1907
    1908            for (int var40 = 0; var40 < 8; ++var40)
    1909            {
    1910                var25[var40].zCoord += 0.21875D;
    1911
    1912                if (var9)
    1913                {
    1914                    var25[var40].yCoord -= 0.09375D;
    1915                    var25[var40].zCoord -= 0.1625D;
    1916                    var25[var40].rotateAroundX(0.0F);
    1917                }
    1918                else if (var8)
    1919                {
    1920                    var25[var40].yCoord += 0.015625D;
    1921                    var25[var40].zCoord -= 0.171875D;
    1922                    var25[var40].rotateAroundX(0.17453294F);
    1923                }
    1924                else
    1925                {
    1926                    var25[var40].rotateAroundX(0.87266463F);
    1927                }
    1928
    1929                if (var7 == 2)
    1930                {
    1931                    var25[var40].rotateAroundY(0.0F);
    1932                }
    1933
    1934                if (var7 == 0)
    1935                {
    1936                    var25[var40].rotateAroundY((float)Math.PI);
    1937                }
    1938
    1939                if (var7 == 1)
    1940                {
    1941                    var25[var40].rotateAroundY(((float)Math.PI / 2F));
    1942                }
    1943
    1944                if (var7 == 3)
    1945                {
    1946                    var25[var40].rotateAroundY(-((float)Math.PI / 2F));
    1947                }
    1948
    1949                var25[var40].xCoord += (double)par2 + 0.5D;
    1950                var25[var40].yCoord += (double)((float)par3 + 0.3125F);
    1951                var25[var40].zCoord += (double)par4 + 0.5D;
    1952            }
    1953
    1954            byte var63 = 5;
    1955            byte var41 = 11;
    1956            byte var42 = 3;
    1957            byte var43 = 9;
    1958
    1959            for (int var44 = 0; var44 < 6; ++var44)
    1960            {
    1961                if (var44 == 0)
    1962                {
    1963                    var61 = var25[0];
    1964                    var30 = var25[1];
    1965                    var31 = var25[2];
    1966                    var32 = var25[3];
    1967                    var21 = (float)(var19 + var63) / 256.0F;
    1968                    var22 = (float)(var19 + var41) / 256.0F;
    1969                    var23 = (float)(var20 + var42) / 256.0F;
    1970                    var24 = (float)(var20 + var43) / 256.0F;
    1971                }
    1972                else if (var44 == 1)
    1973                {
    1974                    var61 = var25[7];
    1975                    var30 = var25[6];
    1976                    var31 = var25[5];
    1977                    var32 = var25[4];
    1978                }
    1979                else if (var44 == 2)
    1980                {
    1981                    var61 = var25[1];
    1982                    var30 = var25[0];
    1983                    var31 = var25[4];
    1984                    var32 = var25[5];
    1985                    var21 = (float)(var19 + var63) / 256.0F;
    1986                    var22 = (float)(var19 + var41) / 256.0F;
    1987                    var23 = (float)(var20 + var42) / 256.0F;
    1988                    var24 = (float)(var20 + var42 + 2) / 256.0F;
    1989                }
    1990                else if (var44 == 3)
    1991                {
    1992                    var61 = var25[2];
    1993                    var30 = var25[1];
    1994                    var31 = var25[5];
    1995                    var32 = var25[6];
    1996                }
    1997                else if (var44 == 4)
    1998                {
    1999                    var61 = var25[3];
    2000                    var30 = var25[2];
    2001                    var31 = var25[6];
    2002                    var32 = var25[7];
    2003                }
    2004                else if (var44 == 5)
    2005                {
    2006                    var61 = var25[0];
    2007                    var30 = var25[3];
    2008                    var31 = var25[7];
    2009                    var32 = var25[4];
    2010                }
    2011
    2012                var5.addVertexWithUV(var61.xCoord, var61.yCoord, var61.zCoord, (double)var21, (double)var24);
    2013                var5.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, (double)var22, (double)var24);
    2014                var5.addVertexWithUV(var31.xCoord, var31.yCoord, var31.zCoord, (double)var22, (double)var23);
    2015                var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, (double)var21, (double)var23);
    2016            }
    2017
    2018            if (var8)
    2019            {
    2020                double var64 = var25[0].yCoord;
    2021                float var46 = 0.03125F;
    2022                float var47 = 0.5F - var46 / 2.0F;
    2023                float var48 = var47 + var46;
    2024                int var49 = (Block.tripWire.blockIndexInTexture & 15) << 4;
    2025                int var50 = Block.tripWire.blockIndexInTexture & 240;
    2026                double var51 = (double)((float)var49 / 256.0F);
    2027                double var53 = (double)((float)(var49 + 16) / 256.0F);
    2028                double var55 = (double)((float)(var50 + (var8 ? 2 : 0)) / 256.0F);
    2029                double var57 = (double)((float)(var50 + (var8 ? 4 : 2)) / 256.0F);
    2030                double var59 = (double)(var10 ? 3.5F : 1.5F) / 16.0D;
    2031                var17 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F;
    2032                var5.setColorOpaque_F(var17, var17, var17);
    2033
    2034                if (var7 == 2)
    2035                {
    2036                    var5.addVertexWithUV((double)((float)par2 + var47), (double)par3 + var59, (double)par4 + 0.25D, var51, var55);
    2037                    var5.addVertexWithUV((double)((float)par2 + var48), (double)par3 + var59, (double)par4 + 0.25D, var51, var57);
    2038                    var5.addVertexWithUV((double)((float)par2 + var48), (double)par3 + var59, (double)par4, var53, var57);
    2039                    var5.addVertexWithUV((double)((float)par2 + var47), (double)par3 + var59, (double)par4, var53, var55);
    2040                    var5.addVertexWithUV((double)((float)par2 + var47), var64, (double)par4 + 0.5D, var51, var55);
    2041                    var5.addVertexWithUV((double)((float)par2 + var48), var64, (double)par4 + 0.5D, var51, var57);
    2042                    var5.addVertexWithUV((double)((float)par2 + var48), (double)par3 + var59, (double)par4 + 0.25D, var53, var57);
    2043                    var5.addVertexWithUV((double)((float)par2 + var47), (double)par3 + var59, (double)par4 + 0.25D, var53, var55);
    2044                }
    2045                else if (var7 == 0)
    2046                {
    2047                    var5.addVertexWithUV((double)((float)par2 + var47), (double)par3 + var59, (double)par4 + 0.75D, var51, var55);
    2048                    var5.addVertexWithUV((double)((float)par2 + var48), (double)par3 + var59, (double)par4 + 0.75D, var51, var57);
    2049                    var5.addVertexWithUV((double)((float)par2 + var48), var64, (double)par4 + 0.5D, var53, var57);
    2050                    var5.addVertexWithUV((double)((float)par2 + var47), var64, (double)par4 + 0.5D, var53, var55);
    2051                    var5.addVertexWithUV((double)((float)par2 + var47), (double)par3 + var59, (double)(par4 + 1), var51, var55);
    2052                    var5.addVertexWithUV((double)((float)par2 + var48), (double)par3 + var59, (double)(par4 + 1), var51, var57);
    2053                    var5.addVertexWithUV((double)((float)par2 + var48), (double)par3 + var59, (double)par4 + 0.75D, var53, var57);
    2054                    var5.addVertexWithUV((double)((float)par2 + var47), (double)par3 + var59, (double)par4 + 0.75D, var53, var55);
    2055                }
    2056                else if (var7 == 1)
    2057                {
    2058                    var5.addVertexWithUV((double)par2, (double)par3 + var59, (double)((float)par4 + var48), var51, var57);
    2059                    var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var59, (double)((float)par4 + var48), var53, var57);
    2060                    var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var59, (double)((float)par4 + var47), var53, var55);
    2061                    var5.addVertexWithUV((double)par2, (double)par3 + var59, (double)((float)par4 + var47), var51, var55);
    2062                    var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var59, (double)((float)par4 + var48), var51, var57);
    2063                    var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var48), var53, var57);
    2064                    var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var47), var53, var55);
    2065                    var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var59, (double)((float)par4 + var47), var51, var55);
    2066                }
    2067                else
    2068                {
    2069                    var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var48), var51, var57);
    2070                    var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var59, (double)((float)par4 + var48), var53, var57);
    2071                    var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var59, (double)((float)par4 + var47), var53, var55);
    2072                    var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var47), var51, var55);
    2073                    var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var59, (double)((float)par4 + var48), var51, var57);
    2074                    var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var59, (double)((float)par4 + var48), var53, var57);
    2075                    var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var59, (double)((float)par4 + var47), var53, var55);
    2076                    var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var59, (double)((float)par4 + var47), var51, var55);
    2077                }
    2078            }
    2079
    2080            return true;
    2081        }
    2082
    2083        /**
    2084         * Renders a trip wire block at the given coordinates
    2085         */
    2086        public boolean renderBlockTripWire(Block par1Block, int par2, int par3, int par4)
    2087        {
    2088            Tessellator var5 = Tessellator.instance;
    2089            int var6 = par1Block.getBlockTextureFromSide(0);
    2090            int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    2091            boolean var8 = (var7 & 4) == 4;
    2092            boolean var9 = (var7 & 2) == 2;
    2093
    2094            if (this.overrideBlockTexture >= 0)
    2095            {
    2096                var6 = this.overrideBlockTexture;
    2097            }
    2098
    2099            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2100            float var10 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F;
    2101            var5.setColorOpaque_F(var10, var10, var10);
    2102            int var11 = (var6 & 15) << 4;
    2103            int var12 = var6 & 240;
    2104            double var13 = (double)((float)var11 / 256.0F);
    2105            double var15 = (double)((float)(var11 + 16) / 256.0F);
    2106            double var17 = (double)((float)(var12 + (var8 ? 2 : 0)) / 256.0F);
    2107            double var19 = (double)((float)(var12 + (var8 ? 4 : 2)) / 256.0F);
    2108            double var21 = (double)(var9 ? 3.5F : 1.5F) / 16.0D;
    2109            boolean var23 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 1);
    2110            boolean var24 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 3);
    2111            boolean var25 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 2);
    2112            boolean var26 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 0);
    2113            float var27 = 0.03125F;
    2114            float var28 = 0.5F - var27 / 2.0F;
    2115            float var29 = var28 + var27;
    2116
    2117            if (!var25 && !var24 && !var26 && !var23)
    2118            {
    2119                var25 = true;
    2120                var26 = true;
    2121            }
    2122
    2123            if (var25)
    2124            {
    2125                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.25D, var13, var17);
    2126                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.25D, var13, var19);
    2127                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4, var15, var19);
    2128                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4, var15, var17);
    2129                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4, var15, var17);
    2130                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4, var15, var19);
    2131                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.25D, var13, var19);
    2132                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.25D, var13, var17);
    2133            }
    2134
    2135            if (var25 || var26 && !var24 && !var23)
    2136            {
    2137                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.5D, var13, var17);
    2138                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.5D, var13, var19);
    2139                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.25D, var15, var19);
    2140                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.25D, var15, var17);
    2141                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.25D, var15, var17);
    2142                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.25D, var15, var19);
    2143                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.5D, var13, var19);
    2144                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.5D, var13, var17);
    2145            }
    2146
    2147            if (var26 || var25 && !var24 && !var23)
    2148            {
    2149                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.75D, var13, var17);
    2150                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.75D, var13, var19);
    2151                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.5D, var15, var19);
    2152                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.5D, var15, var17);
    2153                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.5D, var15, var17);
    2154                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.5D, var15, var19);
    2155                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.75D, var13, var19);
    2156                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.75D, var13, var17);
    2157            }
    2158
    2159            if (var26)
    2160            {
    2161                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)(par4 + 1), var13, var17);
    2162                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)(par4 + 1), var13, var19);
    2163                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.75D, var15, var19);
    2164                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.75D, var15, var17);
    2165                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)par4 + 0.75D, var15, var17);
    2166                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)par4 + 0.75D, var15, var19);
    2167                var5.addVertexWithUV((double)((float)par2 + var29), (double)par3 + var21, (double)(par4 + 1), var13, var19);
    2168                var5.addVertexWithUV((double)((float)par2 + var28), (double)par3 + var21, (double)(par4 + 1), var13, var17);
    2169            }
    2170
    2171            if (var23)
    2172            {
    2173                var5.addVertexWithUV((double)par2, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2174                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2175                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2176                var5.addVertexWithUV((double)par2, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2177                var5.addVertexWithUV((double)par2, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2178                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2179                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2180                var5.addVertexWithUV((double)par2, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2181            }
    2182
    2183            if (var23 || var24 && !var25 && !var26)
    2184            {
    2185                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2186                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2187                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2188                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2189                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2190                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2191                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2192                var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2193            }
    2194
    2195            if (var24 || var23 && !var25 && !var26)
    2196            {
    2197                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2198                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2199                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2200                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2201                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2202                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2203                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2204                var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2205            }
    2206
    2207            if (var24)
    2208            {
    2209                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2210                var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2211                var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2212                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2213                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var28), var13, var17);
    2214                var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var21, (double)((float)par4 + var28), var15, var17);
    2215                var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var21, (double)((float)par4 + var29), var15, var19);
    2216                var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var21, (double)((float)par4 + var29), var13, var19);
    2217            }
    2218
    2219            return true;
    2220        }
    2221
    2222        /**
    2223         * Renders a fire block at the given coordinates
    2224         */
    2225        public boolean renderBlockFire(Block par1Block, int par2, int par3, int par4)
    2226        {
    2227            Tessellator var5 = Tessellator.instance;
    2228            int var6 = par1Block.getBlockTextureFromSide(0);
    2229
    2230            if (this.overrideBlockTexture >= 0)
    2231            {
    2232                var6 = this.overrideBlockTexture;
    2233            }
    2234
    2235            var5.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    2236            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2237            int var7 = (var6 & 15) << 4;
    2238            int var8 = var6 & 240;
    2239            double var9 = (double)((float)var7 / 256.0F);
    2240            double var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2241            double var13 = (double)((float)var8 / 256.0F);
    2242            double var15 = (double)(((float)var8 + 15.99F) / 256.0F);
    2243            float var17 = 1.4F;
    2244            double var32;
    2245            double var20;
    2246            double var22;
    2247            double var24;
    2248            double var26;
    2249            double var28;
    2250            double var30;
    2251
    2252            if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4, UP))
    2253            {
    2254                float var36 = 0.2F;
    2255                float var19 = 0.0625F;
    2256
    2257                if ((par2 + par3 + par4 & 1) == 1)
    2258                {
    2259                    var9 = (double)((float)var7 / 256.0F);
    2260                    var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2261                    var13 = (double)((float)(var8 + 16) / 256.0F);
    2262                    var15 = (double)(((float)var8 + 15.99F + 16.0F) / 256.0F);
    2263                }
    2264
    2265                if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1)
    2266                {
    2267                    var20 = var11;
    2268                    var11 = var9;
    2269                    var9 = var20;
    2270                }
    2271
    2272                if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4, EAST))
    2273                {
    2274                    var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
    2275                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
    2276                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
    2277                    var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
    2278                    var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
    2279                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
    2280                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
    2281                    var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
    2282                }
    2283
    2284                if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4, WEST))
    2285                {
    2286                    var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
    2287                    var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
    2288                    var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
    2289                    var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
    2290                    var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
    2291                    var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
    2292                    var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
    2293                    var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
    2294                }
    2295
    2296                if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1, SOUTH))
    2297                {
    2298                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
    2299                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15);
    2300                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
    2301                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var13);
    2302                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var13);
    2303                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
    2304                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15);
    2305                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
    2306                }
    2307
    2308                if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1, NORTH))
    2309                {
    2310                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
    2311                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15);
    2312                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var11, var15);
    2313                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var11, var13);
    2314                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var11, var13);
    2315                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var11, var15);
    2316                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15);
    2317                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
    2318                }
    2319
    2320                if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4, DOWN))
    2321                {
    2322                    var20 = (double)par2 + 0.5D + 0.5D;
    2323                    var22 = (double)par2 + 0.5D - 0.5D;
    2324                    var24 = (double)par4 + 0.5D + 0.5D;
    2325                    var26 = (double)par4 + 0.5D - 0.5D;
    2326                    var28 = (double)par2 + 0.5D - 0.5D;
    2327                    var30 = (double)par2 + 0.5D + 0.5D;
    2328                    var32 = (double)par4 + 0.5D - 0.5D;
    2329                    double var34 = (double)par4 + 0.5D + 0.5D;
    2330                    var9 = (double)((float)var7 / 256.0F);
    2331                    var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2332                    var13 = (double)((float)var8 / 256.0F);
    2333                    var15 = (double)(((float)var8 + 15.99F) / 256.0F);
    2334                    ++par3;
    2335                    var17 = -0.2F;
    2336
    2337                    if ((par2 + par3 + par4 & 1) == 0)
    2338                    {
    2339                        var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var11, var13);
    2340                        var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var11, var15);
    2341                        var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15);
    2342                        var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var13);
    2343                        var9 = (double)((float)var7 / 256.0F);
    2344                        var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2345                        var13 = (double)((float)(var8 + 16) / 256.0F);
    2346                        var15 = (double)(((float)var8 + 15.99F + 16.0F) / 256.0F);
    2347                        var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 1), var11, var13);
    2348                        var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 1), var11, var15);
    2349                        var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 0), var9, var15);
    2350                        var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 0), var9, var13);
    2351                    }
    2352                    else
    2353                    {
    2354                        var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var34, var11, var13);
    2355                        var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var26, var11, var15);
    2356                        var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var26, var9, var15);
    2357                        var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var34, var9, var13);
    2358                        var9 = (double)((float)var7 / 256.0F);
    2359                        var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2360                        var13 = (double)((float)(var8 + 16) / 256.0F);
    2361                        var15 = (double)(((float)var8 + 15.99F + 16.0F) / 256.0F);
    2362                        var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var11, var13);
    2363                        var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var11, var15);
    2364                        var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15);
    2365                        var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var13);
    2366                    }
    2367                }
    2368            }
    2369            else
    2370            {
    2371                double var18 = (double)par2 + 0.5D + 0.2D;
    2372                var20 = (double)par2 + 0.5D - 0.2D;
    2373                var22 = (double)par4 + 0.5D + 0.2D;
    2374                var24 = (double)par4 + 0.5D - 0.2D;
    2375                var26 = (double)par2 + 0.5D - 0.3D;
    2376                var28 = (double)par2 + 0.5D + 0.3D;
    2377                var30 = (double)par4 + 0.5D - 0.3D;
    2378                var32 = (double)par4 + 0.5D + 0.3D;
    2379                var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var11, var13);
    2380                var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var11, var15);
    2381                var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15);
    2382                var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var13);
    2383                var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var11, var13);
    2384                var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var11, var15);
    2385                var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15);
    2386                var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var13);
    2387                var9 = (double)((float)var7 / 256.0F);
    2388                var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2389                var13 = (double)((float)(var8 + 16) / 256.0F);
    2390                var15 = (double)(((float)var8 + 15.99F + 16.0F) / 256.0F);
    2391                var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var11, var13);
    2392                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var11, var15);
    2393                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15);
    2394                var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var13);
    2395                var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var11, var13);
    2396                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var11, var15);
    2397                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15);
    2398                var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var13);
    2399                var18 = (double)par2 + 0.5D - 0.5D;
    2400                var20 = (double)par2 + 0.5D + 0.5D;
    2401                var22 = (double)par4 + 0.5D - 0.5D;
    2402                var24 = (double)par4 + 0.5D + 0.5D;
    2403                var26 = (double)par2 + 0.5D - 0.4D;
    2404                var28 = (double)par2 + 0.5D + 0.4D;
    2405                var30 = (double)par4 + 0.5D - 0.4D;
    2406                var32 = (double)par4 + 0.5D + 0.4D;
    2407                var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var13);
    2408                var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15);
    2409                var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var11, var15);
    2410                var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var11, var13);
    2411                var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var13);
    2412                var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15);
    2413                var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var11, var15);
    2414                var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var11, var13);
    2415                var9 = (double)((float)var7 / 256.0F);
    2416                var11 = (double)(((float)var7 + 15.99F) / 256.0F);
    2417                var13 = (double)((float)var8 / 256.0F);
    2418                var15 = (double)(((float)var8 + 15.99F) / 256.0F);
    2419                var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var13);
    2420                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15);
    2421                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var11, var15);
    2422                var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var11, var13);
    2423                var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var13);
    2424                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15);
    2425                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var11, var15);
    2426                var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var11, var13);
    2427            }
    2428
    2429            return true;
    2430        }
    2431
    2432        /**
    2433         * Renders a redstone wire block at the given coordinates
    2434         */
    2435        public boolean renderBlockRedstoneWire(Block par1Block, int par2, int par3, int par4)
    2436        {
    2437            Tessellator var5 = Tessellator.instance;
    2438            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    2439            int var7 = par1Block.getBlockTextureFromSideAndMetadata(1, var6);
    2440
    2441            if (this.overrideBlockTexture >= 0)
    2442            {
    2443                var7 = this.overrideBlockTexture;
    2444            }
    2445
    2446            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2447            float var8 = 1.0F;
    2448            float var9 = (float)var6 / 15.0F;
    2449            float var10 = var9 * 0.6F + 0.4F;
    2450
    2451            if (var6 == 0)
    2452            {
    2453                var10 = 0.3F;
    2454            }
    2455
    2456            float var11 = var9 * var9 * 0.7F - 0.5F;
    2457            float var12 = var9 * var9 * 0.6F - 0.7F;
    2458
    2459            if (var11 < 0.0F)
    2460            {
    2461                var11 = 0.0F;
    2462            }
    2463
    2464            if (var12 < 0.0F)
    2465            {
    2466                var12 = 0.0F;
    2467            }
    2468
    2469            var5.setColorOpaque_F(var10, var11, var12);
    2470            int var13 = (var7 & 15) << 4;
    2471            int var14 = var7 & 240;
    2472            double var15 = (double)((float)var13 / 256.0F);
    2473            double var17 = (double)(((float)var13 + 15.99F) / 256.0F);
    2474            double var19 = (double)((float)var14 / 256.0F);
    2475            double var21 = (double)(((float)var14 + 15.99F) / 256.0F);
    2476            boolean var29 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3, par4, 1) || !this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 - 1, par4, -1);
    2477            boolean var30 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3, par4, 3) || !this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 - 1, par4, -1);
    2478            boolean var31 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 - 1, 2) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 - 1, -1);
    2479            boolean var32 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 + 1, 0) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 + 1, -1);
    2480
    2481            if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4))
    2482            {
    2483                if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 + 1, par4, -1))
    2484                {
    2485                    var29 = true;
    2486                }
    2487
    2488                if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 + 1, par4, -1))
    2489                {
    2490                    var30 = true;
    2491                }
    2492
    2493                if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 - 1, -1))
    2494                {
    2495                    var31 = true;
    2496                }
    2497
    2498                if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 + 1, -1))
    2499                {
    2500                    var32 = true;
    2501                }
    2502            }
    2503
    2504            float var34 = (float)(par2 + 0);
    2505            float var35 = (float)(par2 + 1);
    2506            float var36 = (float)(par4 + 0);
    2507            float var37 = (float)(par4 + 1);
    2508            byte var38 = 0;
    2509
    2510            if ((var29 || var30) && !var31 && !var32)
    2511            {
    2512                var38 = 1;
    2513            }
    2514
    2515            if ((var31 || var32) && !var30 && !var29)
    2516            {
    2517                var38 = 2;
    2518            }
    2519
    2520            if (var38 != 0)
    2521            {
    2522                var15 = (double)((float)(var13 + 16) / 256.0F);
    2523                var17 = (double)(((float)(var13 + 16) + 15.99F) / 256.0F);
    2524                var19 = (double)((float)var14 / 256.0F);
    2525                var21 = (double)(((float)var14 + 15.99F) / 256.0F);
    2526            }
    2527
    2528            if (var38 == 0)
    2529            {
    2530                if (!var29)
    2531                {
    2532                    var34 += 0.3125F;
    2533                }
    2534
    2535                if (!var29)
    2536                {
    2537                    var15 += 0.01953125D;
    2538                }
    2539
    2540                if (!var30)
    2541                {
    2542                    var35 -= 0.3125F;
    2543                }
    2544
    2545                if (!var30)
    2546                {
    2547                    var17 -= 0.01953125D;
    2548                }
    2549
    2550                if (!var31)
    2551                {
    2552                    var36 += 0.3125F;
    2553                }
    2554
    2555                if (!var31)
    2556                {
    2557                    var19 += 0.01953125D;
    2558                }
    2559
    2560                if (!var32)
    2561                {
    2562                    var37 -= 0.3125F;
    2563                }
    2564
    2565                if (!var32)
    2566                {
    2567                    var21 -= 0.01953125D;
    2568                }
    2569
    2570                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var37, var17, var21);
    2571                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var36, var17, var19);
    2572                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var36, var15, var19);
    2573                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var37, var15, var21);
    2574                var5.setColorOpaque_F(var8, var8, var8);
    2575                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var37, var17, var21 + 0.0625D);
    2576                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var36, var17, var19 + 0.0625D);
    2577                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var36, var15, var19 + 0.0625D);
    2578                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var37, var15, var21 + 0.0625D);
    2579            }
    2580            else if (var38 == 1)
    2581            {
    2582                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var37, var17, var21);
    2583                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var36, var17, var19);
    2584                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var36, var15, var19);
    2585                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var37, var15, var21);
    2586                var5.setColorOpaque_F(var8, var8, var8);
    2587                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var37, var17, var21 + 0.0625D);
    2588                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var36, var17, var19 + 0.0625D);
    2589                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var36, var15, var19 + 0.0625D);
    2590                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var37, var15, var21 + 0.0625D);
    2591            }
    2592            else if (var38 == 2)
    2593            {
    2594                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var37, var17, var21);
    2595                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var36, var15, var21);
    2596                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var36, var15, var19);
    2597                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var37, var17, var19);
    2598                var5.setColorOpaque_F(var8, var8, var8);
    2599                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var37, var17, var21 + 0.0625D);
    2600                var5.addVertexWithUV((double)var35, (double)par3 + 0.015625D, (double)var36, var15, var21 + 0.0625D);
    2601                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var36, var15, var19 + 0.0625D);
    2602                var5.addVertexWithUV((double)var34, (double)par3 + 0.015625D, (double)var37, var17, var19 + 0.0625D);
    2603            }
    2604
    2605            if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4))
    2606            {
    2607                var15 = (double)((float)(var13 + 16) / 256.0F);
    2608                var17 = (double)(((float)(var13 + 16) + 15.99F) / 256.0F);
    2609                var19 = (double)((float)var14 / 256.0F);
    2610                var21 = (double)(((float)var14 + 15.99F) / 256.0F);
    2611
    2612                if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID)
    2613                {
    2614                    var5.setColorOpaque_F(var8 * var10, var8 * var11, var8 * var12);
    2615                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), var17, var19);
    2616                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), var15, var19);
    2617                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), var15, var21);
    2618                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), var17, var21);
    2619                    var5.setColorOpaque_F(var8, var8, var8);
    2620                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), var17, var19 + 0.0625D);
    2621                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), var15, var19 + 0.0625D);
    2622                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), var15, var21 + 0.0625D);
    2623                    var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), var17, var21 + 0.0625D);
    2624                }
    2625
    2626                if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID)
    2627                {
    2628                    var5.setColorOpaque_F(var8 * var10, var8 * var11, var8 * var12);
    2629                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), var15, var21);
    2630                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), var17, var21);
    2631                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), var17, var19);
    2632                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), var15, var19);
    2633                    var5.setColorOpaque_F(var8, var8, var8);
    2634                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), var15, var21 + 0.0625D);
    2635                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), var17, var21 + 0.0625D);
    2636                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), var17, var19 + 0.0625D);
    2637                    var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), var15, var19 + 0.0625D);
    2638                }
    2639
    2640                if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID)
    2641                {
    2642                    var5.setColorOpaque_F(var8 * var10, var8 * var11, var8 * var12);
    2643                    var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, var15, var21);
    2644                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, var17, var21);
    2645                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, var17, var19);
    2646                    var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, var15, var19);
    2647                    var5.setColorOpaque_F(var8, var8, var8);
    2648                    var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, var15, var21 + 0.0625D);
    2649                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, var17, var21 + 0.0625D);
    2650                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, var17, var19 + 0.0625D);
    2651                    var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, var15, var19 + 0.0625D);
    2652                }
    2653
    2654                if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID)
    2655                {
    2656                    var5.setColorOpaque_F(var8 * var10, var8 * var11, var8 * var12);
    2657                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, var17, var19);
    2658                    var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, var15, var19);
    2659                    var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, var15, var21);
    2660                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, var17, var21);
    2661                    var5.setColorOpaque_F(var8, var8, var8);
    2662                    var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, var17, var19 + 0.0625D);
    2663                    var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, var15, var19 + 0.0625D);
    2664                    var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, var15, var21 + 0.0625D);
    2665                    var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, var17, var21 + 0.0625D);
    2666                }
    2667            }
    2668
    2669            return true;
    2670        }
    2671
    2672        /**
    2673         * Renders a minecart track block at the given coordinates
    2674         */
    2675        public boolean renderBlockMinecartTrack(BlockRail par1BlockRail, int par2, int par3, int par4)
    2676        {
    2677            Tessellator var5 = Tessellator.instance;
    2678            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    2679            int var7 = par1BlockRail.getBlockTextureFromSideAndMetadata(0, var6);
    2680
    2681            if (this.overrideBlockTexture >= 0)
    2682            {
    2683                var7 = this.overrideBlockTexture;
    2684            }
    2685
    2686            if (par1BlockRail.isPowered())
    2687            {
    2688                var6 &= 7;
    2689            }
    2690
    2691            var5.setBrightness(par1BlockRail.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2692            var5.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    2693            int var8 = (var7 & 15) << 4;
    2694            int var9 = var7 & 240;
    2695            double var10 = (double)((float)var8 / 256.0F);
    2696            double var12 = (double)(((float)var8 + 15.99F) / 256.0F);
    2697            double var14 = (double)((float)var9 / 256.0F);
    2698            double var16 = (double)(((float)var9 + 15.99F) / 256.0F);
    2699            double var18 = 0.0625D;
    2700            double var20 = (double)(par2 + 1);
    2701            double var22 = (double)(par2 + 1);
    2702            double var24 = (double)(par2 + 0);
    2703            double var26 = (double)(par2 + 0);
    2704            double var28 = (double)(par4 + 0);
    2705            double var30 = (double)(par4 + 1);
    2706            double var32 = (double)(par4 + 1);
    2707            double var34 = (double)(par4 + 0);
    2708            double var36 = (double)par3 + var18;
    2709            double var38 = (double)par3 + var18;
    2710            double var40 = (double)par3 + var18;
    2711            double var42 = (double)par3 + var18;
    2712
    2713            if (var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7)
    2714            {
    2715                if (var6 == 8)
    2716                {
    2717                    var20 = var22 = (double)(par2 + 0);
    2718                    var24 = var26 = (double)(par2 + 1);
    2719                    var28 = var34 = (double)(par4 + 1);
    2720                    var30 = var32 = (double)(par4 + 0);
    2721                }
    2722                else if (var6 == 9)
    2723                {
    2724                    var20 = var26 = (double)(par2 + 0);
    2725                    var22 = var24 = (double)(par2 + 1);
    2726                    var28 = var30 = (double)(par4 + 0);
    2727                    var32 = var34 = (double)(par4 + 1);
    2728                }
    2729            }
    2730            else
    2731            {
    2732                var20 = var26 = (double)(par2 + 1);
    2733                var22 = var24 = (double)(par2 + 0);
    2734                var28 = var30 = (double)(par4 + 1);
    2735                var32 = var34 = (double)(par4 + 0);
    2736            }
    2737
    2738            if (var6 != 2 && var6 != 4)
    2739            {
    2740                if (var6 == 3 || var6 == 5)
    2741                {
    2742                    ++var38;
    2743                    ++var40;
    2744                }
    2745            }
    2746            else
    2747            {
    2748                ++var36;
    2749                ++var42;
    2750            }
    2751
    2752            var5.addVertexWithUV(var20, var36, var28, var12, var14);
    2753            var5.addVertexWithUV(var22, var38, var30, var12, var16);
    2754            var5.addVertexWithUV(var24, var40, var32, var10, var16);
    2755            var5.addVertexWithUV(var26, var42, var34, var10, var14);
    2756            var5.addVertexWithUV(var26, var42, var34, var10, var14);
    2757            var5.addVertexWithUV(var24, var40, var32, var10, var16);
    2758            var5.addVertexWithUV(var22, var38, var30, var12, var16);
    2759            var5.addVertexWithUV(var20, var36, var28, var12, var14);
    2760            return true;
    2761        }
    2762
    2763        /**
    2764         * Renders a ladder block at the given coordinates
    2765         */
    2766        public boolean renderBlockLadder(Block par1Block, int par2, int par3, int par4)
    2767        {
    2768            Tessellator var5 = Tessellator.instance;
    2769            int var6 = par1Block.getBlockTextureFromSide(0);
    2770
    2771            if (this.overrideBlockTexture >= 0)
    2772            {
    2773                var6 = this.overrideBlockTexture;
    2774            }
    2775
    2776            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2777            float var7 = 1.0F;
    2778            var5.setColorOpaque_F(var7, var7, var7);
    2779            int var22 = (var6 & 15) << 4;
    2780            int var8 = var6 & 240;
    2781            double var9 = (double)((float)var22 / 256.0F);
    2782            double var11 = (double)(((float)var22 + 15.99F) / 256.0F);
    2783            double var13 = (double)((float)var8 / 256.0F);
    2784            double var15 = (double)(((float)var8 + 15.99F) / 256.0F);
    2785            int var17 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    2786            double var18 = 0.0D;
    2787            double var20 = 0.05000000074505806D;
    2788
    2789            if (var17 == 5)
    2790            {
    2791                var5.addVertexWithUV((double)par2 + var20, (double)(par3 + 1) + var18, (double)(par4 + 1) + var18, var9, var13);
    2792                var5.addVertexWithUV((double)par2 + var20, (double)(par3 + 0) - var18, (double)(par4 + 1) + var18, var9, var15);
    2793                var5.addVertexWithUV((double)par2 + var20, (double)(par3 + 0) - var18, (double)(par4 + 0) - var18, var11, var15);
    2794                var5.addVertexWithUV((double)par2 + var20, (double)(par3 + 1) + var18, (double)(par4 + 0) - var18, var11, var13);
    2795            }
    2796
    2797            if (var17 == 4)
    2798            {
    2799                var5.addVertexWithUV((double)(par2 + 1) - var20, (double)(par3 + 0) - var18, (double)(par4 + 1) + var18, var11, var15);
    2800                var5.addVertexWithUV((double)(par2 + 1) - var20, (double)(par3 + 1) + var18, (double)(par4 + 1) + var18, var11, var13);
    2801                var5.addVertexWithUV((double)(par2 + 1) - var20, (double)(par3 + 1) + var18, (double)(par4 + 0) - var18, var9, var13);
    2802                var5.addVertexWithUV((double)(par2 + 1) - var20, (double)(par3 + 0) - var18, (double)(par4 + 0) - var18, var9, var15);
    2803            }
    2804
    2805            if (var17 == 3)
    2806            {
    2807                var5.addVertexWithUV((double)(par2 + 1) + var18, (double)(par3 + 0) - var18, (double)par4 + var20, var11, var15);
    2808                var5.addVertexWithUV((double)(par2 + 1) + var18, (double)(par3 + 1) + var18, (double)par4 + var20, var11, var13);
    2809                var5.addVertexWithUV((double)(par2 + 0) - var18, (double)(par3 + 1) + var18, (double)par4 + var20, var9, var13);
    2810                var5.addVertexWithUV((double)(par2 + 0) - var18, (double)(par3 + 0) - var18, (double)par4 + var20, var9, var15);
    2811            }
    2812
    2813            if (var17 == 2)
    2814            {
    2815                var5.addVertexWithUV((double)(par2 + 1) + var18, (double)(par3 + 1) + var18, (double)(par4 + 1) - var20, var9, var13);
    2816                var5.addVertexWithUV((double)(par2 + 1) + var18, (double)(par3 + 0) - var18, (double)(par4 + 1) - var20, var9, var15);
    2817                var5.addVertexWithUV((double)(par2 + 0) - var18, (double)(par3 + 0) - var18, (double)(par4 + 1) - var20, var11, var15);
    2818                var5.addVertexWithUV((double)(par2 + 0) - var18, (double)(par3 + 1) + var18, (double)(par4 + 1) - var20, var11, var13);
    2819            }
    2820
    2821            return true;
    2822        }
    2823
    2824        /**
    2825         * Render block vine
    2826         */
    2827        public boolean renderBlockVine(Block par1Block, int par2, int par3, int par4)
    2828        {
    2829            Tessellator var5 = Tessellator.instance;
    2830            int var6 = par1Block.getBlockTextureFromSide(0);
    2831
    2832            if (this.overrideBlockTexture >= 0)
    2833            {
    2834                var6 = this.overrideBlockTexture;
    2835            }
    2836
    2837            float var7 = 1.0F;
    2838            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2839            int var8 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4);
    2840            float var9 = (float)(var8 >> 16 & 255) / 255.0F;
    2841            float var10 = (float)(var8 >> 8 & 255) / 255.0F;
    2842            float var11 = (float)(var8 & 255) / 255.0F;
    2843            var5.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11);
    2844            var8 = (var6 & 15) << 4;
    2845            int var21 = var6 & 240;
    2846            double var22 = (double)((float)var8 / 256.0F);
    2847            double var12 = (double)(((float)var8 + 15.99F) / 256.0F);
    2848            double var14 = (double)((float)var21 / 256.0F);
    2849            double var16 = (double)(((float)var21 + 15.99F) / 256.0F);
    2850            double var18 = 0.05000000074505806D;
    2851            int var20 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    2852
    2853            if ((var20 & 2) != 0)
    2854            {
    2855                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1), (double)(par4 + 1), var22, var14);
    2856                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0), (double)(par4 + 1), var22, var16);
    2857                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0), (double)(par4 + 0), var12, var16);
    2858                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1), (double)(par4 + 0), var12, var14);
    2859                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1), (double)(par4 + 0), var12, var14);
    2860                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0), (double)(par4 + 0), var12, var16);
    2861                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0), (double)(par4 + 1), var22, var16);
    2862                var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1), (double)(par4 + 1), var22, var14);
    2863            }
    2864
    2865            if ((var20 & 8) != 0)
    2866            {
    2867                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0), (double)(par4 + 1), var12, var16);
    2868                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1), (double)(par4 + 1), var12, var14);
    2869                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1), (double)(par4 + 0), var22, var14);
    2870                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0), (double)(par4 + 0), var22, var16);
    2871                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0), (double)(par4 + 0), var22, var16);
    2872                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1), (double)(par4 + 0), var22, var14);
    2873                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1), (double)(par4 + 1), var12, var14);
    2874                var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0), (double)(par4 + 1), var12, var16);
    2875            }
    2876
    2877            if ((var20 & 4) != 0)
    2878            {
    2879                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var18, var12, var16);
    2880                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var18, var12, var14);
    2881                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var18, var22, var14);
    2882                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var18, var22, var16);
    2883                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var18, var22, var16);
    2884                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var18, var22, var14);
    2885                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var18, var12, var14);
    2886                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var18, var12, var16);
    2887            }
    2888
    2889            if ((var20 & 1) != 0)
    2890            {
    2891                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var18, var22, var14);
    2892                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var18, var22, var16);
    2893                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var18, var12, var16);
    2894                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var18, var12, var14);
    2895                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var18, var12, var14);
    2896                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var18, var12, var16);
    2897                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var18, var22, var16);
    2898                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var18, var22, var14);
    2899            }
    2900
    2901            if (this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4))
    2902            {
    2903                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var18, (double)(par4 + 0), var22, var14);
    2904                var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var18, (double)(par4 + 1), var22, var16);
    2905                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var18, (double)(par4 + 1), var12, var16);
    2906                var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var18, (double)(par4 + 0), var12, var14);
    2907            }
    2908
    2909            return true;
    2910        }
    2911
    2912        public boolean renderBlockPane(BlockPane par1BlockPane, int par2, int par3, int par4)
    2913        {
    2914            int var5 = this.blockAccess.getHeight();
    2915            Tessellator var6 = Tessellator.instance;
    2916            var6.setBrightness(par1BlockPane.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    2917            float var7 = 1.0F;
    2918            int var8 = par1BlockPane.colorMultiplier(this.blockAccess, par2, par3, par4);
    2919            float var9 = (float)(var8 >> 16 & 255) / 255.0F;
    2920            float var10 = (float)(var8 >> 8 & 255) / 255.0F;
    2921            float var11 = (float)(var8 & 255) / 255.0F;
    2922
    2923            if (EntityRenderer.anaglyphEnable)
    2924            {
    2925                float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F;
    2926                float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F;
    2927                float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F;
    2928                var9 = var12;
    2929                var10 = var13;
    2930                var11 = var14;
    2931            }
    2932
    2933            var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11);
    2934            boolean var64 = false;
    2935            boolean var67 = false;
    2936            int var68;
    2937            int var65;
    2938            int var66;
    2939
    2940            if (this.overrideBlockTexture >= 0)
    2941            {
    2942                var65 = this.overrideBlockTexture;
    2943                var66 = this.overrideBlockTexture;
    2944            }
    2945            else
    2946            {
    2947                var68 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    2948                var65 = par1BlockPane.getBlockTextureFromSideAndMetadata(0, var68);
    2949                var66 = par1BlockPane.getSideTextureIndex();
    2950            }
    2951
    2952            var68 = (var65 & 15) << 4;
    2953            int var15 = var65 & 240;
    2954            double var16 = (double)((float)var68 / 256.0F);
    2955            double var18 = (double)(((float)var68 + 7.99F) / 256.0F);
    2956            double var20 = (double)(((float)var68 + 15.99F) / 256.0F);
    2957            double var22 = (double)((float)var15 / 256.0F);
    2958            double var24 = (double)(((float)var15 + 15.99F) / 256.0F);
    2959            int var26 = (var66 & 15) << 4;
    2960            int var27 = var66 & 240;
    2961            double var28 = (double)((float)(var26 + 7) / 256.0F);
    2962            double var30 = (double)(((float)var26 + 8.99F) / 256.0F);
    2963            double var32 = (double)((float)var27 / 256.0F);
    2964            double var34 = (double)((float)(var27 + 8) / 256.0F);
    2965            double var36 = (double)(((float)var27 + 15.99F) / 256.0F);
    2966            double var38 = (double)par2;
    2967            double var40 = (double)par2 + 0.5D;
    2968            double var42 = (double)(par2 + 1);
    2969            double var44 = (double)par4;
    2970            double var46 = (double)par4 + 0.5D;
    2971            double var48 = (double)(par4 + 1);
    2972            double var50 = (double)par2 + 0.5D - 0.0625D;
    2973            double var52 = (double)par2 + 0.5D + 0.0625D;
    2974            double var54 = (double)par4 + 0.5D - 0.0625D;
    2975            double var56 = (double)par4 + 0.5D + 0.0625D;
    2976            boolean var58 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 - 1));
    2977            boolean var59 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 + 1));
    2978            boolean var60 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 - 1, par3, par4));
    2979            boolean var61 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 + 1, par3, par4));
    2980            boolean var62 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1);
    2981            boolean var63 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0);
    2982
    2983            if ((!var60 || !var61) && (var60 || var61 || var58 || var59))
    2984            {
    2985                if (var60 && !var61)
    2986                {
    2987                    var6.addVertexWithUV(var38, (double)(par3 + 1), var46, var16, var22);
    2988                    var6.addVertexWithUV(var38, (double)(par3 + 0), var46, var16, var24);
    2989                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var18, var24);
    2990                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var18, var22);
    2991                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var16, var22);
    2992                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var16, var24);
    2993                    var6.addVertexWithUV(var38, (double)(par3 + 0), var46, var18, var24);
    2994                    var6.addVertexWithUV(var38, (double)(par3 + 1), var46, var18, var22);
    2995
    2996                    if (!var59 && !var58)
    2997                    {
    2998                        var6.addVertexWithUV(var40, (double)(par3 + 1), var56, var28, var32);
    2999                        var6.addVertexWithUV(var40, (double)(par3 + 0), var56, var28, var36);
    3000                        var6.addVertexWithUV(var40, (double)(par3 + 0), var54, var30, var36);
    3001                        var6.addVertexWithUV(var40, (double)(par3 + 1), var54, var30, var32);
    3002                        var6.addVertexWithUV(var40, (double)(par3 + 1), var54, var28, var32);
    3003                        var6.addVertexWithUV(var40, (double)(par3 + 0), var54, var28, var36);
    3004                        var6.addVertexWithUV(var40, (double)(par3 + 0), var56, var30, var36);
    3005                        var6.addVertexWithUV(var40, (double)(par3 + 1), var56, var30, var32);
    3006                    }
    3007
    3008                    if (var62 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4))
    3009                    {
    3010                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3011                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var36);
    3012                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var36);
    3013                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3014                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3015                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var56, var30, var36);
    3016                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var54, var28, var36);
    3017                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3018                    }
    3019
    3020                    if (var63 || par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4))
    3021                    {
    3022                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var56, var30, var34);
    3023                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var36);
    3024                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var36);
    3025                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var54, var28, var34);
    3026                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var34);
    3027                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var56, var30, var36);
    3028                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var54, var28, var36);
    3029                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var34);
    3030                    }
    3031                }
    3032                else if (!var60 && var61)
    3033                {
    3034                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var18, var22);
    3035                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var18, var24);
    3036                    var6.addVertexWithUV(var42, (double)(par3 + 0), var46, var20, var24);
    3037                    var6.addVertexWithUV(var42, (double)(par3 + 1), var46, var20, var22);
    3038                    var6.addVertexWithUV(var42, (double)(par3 + 1), var46, var18, var22);
    3039                    var6.addVertexWithUV(var42, (double)(par3 + 0), var46, var18, var24);
    3040                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var20, var24);
    3041                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var20, var22);
    3042
    3043                    if (!var59 && !var58)
    3044                    {
    3045                        var6.addVertexWithUV(var40, (double)(par3 + 1), var54, var28, var32);
    3046                        var6.addVertexWithUV(var40, (double)(par3 + 0), var54, var28, var36);
    3047                        var6.addVertexWithUV(var40, (double)(par3 + 0), var56, var30, var36);
    3048                        var6.addVertexWithUV(var40, (double)(par3 + 1), var56, var30, var32);
    3049                        var6.addVertexWithUV(var40, (double)(par3 + 1), var56, var28, var32);
    3050                        var6.addVertexWithUV(var40, (double)(par3 + 0), var56, var28, var36);
    3051                        var6.addVertexWithUV(var40, (double)(par3 + 0), var54, var30, var36);
    3052                        var6.addVertexWithUV(var40, (double)(par3 + 1), var54, var30, var32);
    3053                    }
    3054
    3055                    if (var62 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4))
    3056                    {
    3057                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var32);
    3058                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3059                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3060                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var32);
    3061                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var56, var30, var32);
    3062                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3063                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3064                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var54, var28, var32);
    3065                    }
    3066
    3067                    if (var63 || par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4))
    3068                    {
    3069                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var32);
    3070                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var56, var30, var34);
    3071                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var54, var28, var34);
    3072                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var32);
    3073                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var56, var30, var32);
    3074                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var34);
    3075                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var34);
    3076                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var54, var28, var32);
    3077                    }
    3078                }
    3079            }
    3080            else
    3081            {
    3082                var6.addVertexWithUV(var38, (double)(par3 + 1), var46, var16, var22);
    3083                var6.addVertexWithUV(var38, (double)(par3 + 0), var46, var16, var24);
    3084                var6.addVertexWithUV(var42, (double)(par3 + 0), var46, var20, var24);
    3085                var6.addVertexWithUV(var42, (double)(par3 + 1), var46, var20, var22);
    3086                var6.addVertexWithUV(var42, (double)(par3 + 1), var46, var16, var22);
    3087                var6.addVertexWithUV(var42, (double)(par3 + 0), var46, var16, var24);
    3088                var6.addVertexWithUV(var38, (double)(par3 + 0), var46, var20, var24);
    3089                var6.addVertexWithUV(var38, (double)(par3 + 1), var46, var20, var22);
    3090
    3091                if (var62)
    3092                {
    3093                    var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var56, var30, var36);
    3094                    var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var56, var30, var32);
    3095                    var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var54, var28, var32);
    3096                    var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var54, var28, var36);
    3097                    var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var56, var30, var36);
    3098                    var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var56, var30, var32);
    3099                    var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var54, var28, var32);
    3100                    var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var54, var28, var36);
    3101                }
    3102                else
    3103                {
    3104                    if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4))
    3105                    {
    3106                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3107                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var36);
    3108                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var36);
    3109                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3110                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3111                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var56, var30, var36);
    3112                        var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var54, var28, var36);
    3113                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3114                    }
    3115
    3116                    if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4))
    3117                    {
    3118                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var32);
    3119                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3120                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3121                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var32);
    3122                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var56, var30, var32);
    3123                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var56, var30, var34);
    3124                        var6.addVertexWithUV(var40, (double)(par3 + 1) + 0.01D, var54, var28, var34);
    3125                        var6.addVertexWithUV(var42, (double)(par3 + 1) + 0.01D, var54, var28, var32);
    3126                    }
    3127                }
    3128
    3129                if (var63)
    3130                {
    3131                    var6.addVertexWithUV(var38, (double)par3 - 0.01D, var56, var30, var36);
    3132                    var6.addVertexWithUV(var42, (double)par3 - 0.01D, var56, var30, var32);
    3133                    var6.addVertexWithUV(var42, (double)par3 - 0.01D, var54, var28, var32);
    3134                    var6.addVertexWithUV(var38, (double)par3 - 0.01D, var54, var28, var36);
    3135                    var6.addVertexWithUV(var42, (double)par3 - 0.01D, var56, var30, var36);
    3136                    var6.addVertexWithUV(var38, (double)par3 - 0.01D, var56, var30, var32);
    3137                    var6.addVertexWithUV(var38, (double)par3 - 0.01D, var54, var28, var32);
    3138                    var6.addVertexWithUV(var42, (double)par3 - 0.01D, var54, var28, var36);
    3139                }
    3140                else
    3141                {
    3142                    if (par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4))
    3143                    {
    3144                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var56, var30, var34);
    3145                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var36);
    3146                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var36);
    3147                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var54, var28, var34);
    3148                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var34);
    3149                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var56, var30, var36);
    3150                        var6.addVertexWithUV(var38, (double)par3 - 0.01D, var54, var28, var36);
    3151                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var34);
    3152                    }
    3153
    3154                    if (par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4))
    3155                    {
    3156                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var32);
    3157                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var56, var30, var34);
    3158                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var54, var28, var34);
    3159                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var32);
    3160                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var56, var30, var32);
    3161                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var56, var30, var34);
    3162                        var6.addVertexWithUV(var40, (double)par3 - 0.01D, var54, var28, var34);
    3163                        var6.addVertexWithUV(var42, (double)par3 - 0.01D, var54, var28, var32);
    3164                    }
    3165                }
    3166            }
    3167
    3168            if ((!var58 || !var59) && (var60 || var61 || var58 || var59))
    3169            {
    3170                if (var58 && !var59)
    3171                {
    3172                    var6.addVertexWithUV(var40, (double)(par3 + 1), var44, var16, var22);
    3173                    var6.addVertexWithUV(var40, (double)(par3 + 0), var44, var16, var24);
    3174                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var18, var24);
    3175                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var18, var22);
    3176                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var16, var22);
    3177                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var16, var24);
    3178                    var6.addVertexWithUV(var40, (double)(par3 + 0), var44, var18, var24);
    3179                    var6.addVertexWithUV(var40, (double)(par3 + 1), var44, var18, var22);
    3180
    3181                    if (!var61 && !var60)
    3182                    {
    3183                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var28, var32);
    3184                        var6.addVertexWithUV(var50, (double)(par3 + 0), var46, var28, var36);
    3185                        var6.addVertexWithUV(var52, (double)(par3 + 0), var46, var30, var36);
    3186                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var30, var32);
    3187                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var28, var32);
    3188                        var6.addVertexWithUV(var52, (double)(par3 + 0), var46, var28, var36);
    3189                        var6.addVertexWithUV(var50, (double)(par3 + 0), var46, var30, var36);
    3190                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var30, var32);
    3191                    }
    3192
    3193                    if (var62 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1))
    3194                    {
    3195                        var6.addVertexWithUV(var50, (double)(par3 + 1), var44, var30, var32);
    3196                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var30, var34);
    3197                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var28, var34);
    3198                        var6.addVertexWithUV(var52, (double)(par3 + 1), var44, var28, var32);
    3199                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var30, var32);
    3200                        var6.addVertexWithUV(var50, (double)(par3 + 1), var44, var30, var34);
    3201                        var6.addVertexWithUV(var52, (double)(par3 + 1), var44, var28, var34);
    3202                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var28, var32);
    3203                    }
    3204
    3205                    if (var63 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1))
    3206                    {
    3207                        var6.addVertexWithUV(var50, (double)par3, var44, var30, var32);
    3208                        var6.addVertexWithUV(var50, (double)par3, var46, var30, var34);
    3209                        var6.addVertexWithUV(var52, (double)par3, var46, var28, var34);
    3210                        var6.addVertexWithUV(var52, (double)par3, var44, var28, var32);
    3211                        var6.addVertexWithUV(var50, (double)par3, var46, var30, var32);
    3212                        var6.addVertexWithUV(var50, (double)par3, var44, var30, var34);
    3213                        var6.addVertexWithUV(var52, (double)par3, var44, var28, var34);
    3214                        var6.addVertexWithUV(var52, (double)par3, var46, var28, var32);
    3215                    }
    3216                }
    3217                else if (!var58 && var59)
    3218                {
    3219                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var18, var22);
    3220                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var18, var24);
    3221                    var6.addVertexWithUV(var40, (double)(par3 + 0), var48, var20, var24);
    3222                    var6.addVertexWithUV(var40, (double)(par3 + 1), var48, var20, var22);
    3223                    var6.addVertexWithUV(var40, (double)(par3 + 1), var48, var18, var22);
    3224                    var6.addVertexWithUV(var40, (double)(par3 + 0), var48, var18, var24);
    3225                    var6.addVertexWithUV(var40, (double)(par3 + 0), var46, var20, var24);
    3226                    var6.addVertexWithUV(var40, (double)(par3 + 1), var46, var20, var22);
    3227
    3228                    if (!var61 && !var60)
    3229                    {
    3230                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var28, var32);
    3231                        var6.addVertexWithUV(var52, (double)(par3 + 0), var46, var28, var36);
    3232                        var6.addVertexWithUV(var50, (double)(par3 + 0), var46, var30, var36);
    3233                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var30, var32);
    3234                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var28, var32);
    3235                        var6.addVertexWithUV(var50, (double)(par3 + 0), var46, var28, var36);
    3236                        var6.addVertexWithUV(var52, (double)(par3 + 0), var46, var30, var36);
    3237                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var30, var32);
    3238                    }
    3239
    3240                    if (var62 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1))
    3241                    {
    3242                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var28, var34);
    3243                        var6.addVertexWithUV(var50, (double)(par3 + 1), var48, var28, var36);
    3244                        var6.addVertexWithUV(var52, (double)(par3 + 1), var48, var30, var36);
    3245                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var30, var34);
    3246                        var6.addVertexWithUV(var50, (double)(par3 + 1), var48, var28, var34);
    3247                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var28, var36);
    3248                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var30, var36);
    3249                        var6.addVertexWithUV(var52, (double)(par3 + 1), var48, var30, var34);
    3250                    }
    3251
    3252                    if (var63 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1))
    3253                    {
    3254                        var6.addVertexWithUV(var50, (double)par3, var46, var28, var34);
    3255                        var6.addVertexWithUV(var50, (double)par3, var48, var28, var36);
    3256                        var6.addVertexWithUV(var52, (double)par3, var48, var30, var36);
    3257                        var6.addVertexWithUV(var52, (double)par3, var46, var30, var34);
    3258                        var6.addVertexWithUV(var50, (double)par3, var48, var28, var34);
    3259                        var6.addVertexWithUV(var50, (double)par3, var46, var28, var36);
    3260                        var6.addVertexWithUV(var52, (double)par3, var46, var30, var36);
    3261                        var6.addVertexWithUV(var52, (double)par3, var48, var30, var34);
    3262                    }
    3263                }
    3264            }
    3265            else
    3266            {
    3267                var6.addVertexWithUV(var40, (double)(par3 + 1), var48, var16, var22);
    3268                var6.addVertexWithUV(var40, (double)(par3 + 0), var48, var16, var24);
    3269                var6.addVertexWithUV(var40, (double)(par3 + 0), var44, var20, var24);
    3270                var6.addVertexWithUV(var40, (double)(par3 + 1), var44, var20, var22);
    3271                var6.addVertexWithUV(var40, (double)(par3 + 1), var44, var16, var22);
    3272                var6.addVertexWithUV(var40, (double)(par3 + 0), var44, var16, var24);
    3273                var6.addVertexWithUV(var40, (double)(par3 + 0), var48, var20, var24);
    3274                var6.addVertexWithUV(var40, (double)(par3 + 1), var48, var20, var22);
    3275
    3276                if (var62)
    3277                {
    3278                    var6.addVertexWithUV(var52, (double)(par3 + 1), var48, var30, var36);
    3279                    var6.addVertexWithUV(var52, (double)(par3 + 1), var44, var30, var32);
    3280                    var6.addVertexWithUV(var50, (double)(par3 + 1), var44, var28, var32);
    3281                    var6.addVertexWithUV(var50, (double)(par3 + 1), var48, var28, var36);
    3282                    var6.addVertexWithUV(var52, (double)(par3 + 1), var44, var30, var36);
    3283                    var6.addVertexWithUV(var52, (double)(par3 + 1), var48, var30, var32);
    3284                    var6.addVertexWithUV(var50, (double)(par3 + 1), var48, var28, var32);
    3285                    var6.addVertexWithUV(var50, (double)(par3 + 1), var44, var28, var36);
    3286                }
    3287                else
    3288                {
    3289                    if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1))
    3290                    {
    3291                        var6.addVertexWithUV(var50, (double)(par3 + 1), var44, var30, var32);
    3292                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var30, var34);
    3293                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var28, var34);
    3294                        var6.addVertexWithUV(var52, (double)(par3 + 1), var44, var28, var32);
    3295                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var30, var32);
    3296                        var6.addVertexWithUV(var50, (double)(par3 + 1), var44, var30, var34);
    3297                        var6.addVertexWithUV(var52, (double)(par3 + 1), var44, var28, var34);
    3298                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var28, var32);
    3299                    }
    3300
    3301                    if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1))
    3302                    {
    3303                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var28, var34);
    3304                        var6.addVertexWithUV(var50, (double)(par3 + 1), var48, var28, var36);
    3305                        var6.addVertexWithUV(var52, (double)(par3 + 1), var48, var30, var36);
    3306                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var30, var34);
    3307                        var6.addVertexWithUV(var50, (double)(par3 + 1), var48, var28, var34);
    3308                        var6.addVertexWithUV(var50, (double)(par3 + 1), var46, var28, var36);
    3309                        var6.addVertexWithUV(var52, (double)(par3 + 1), var46, var30, var36);
    3310                        var6.addVertexWithUV(var52, (double)(par3 + 1), var48, var30, var34);
    3311                    }
    3312                }
    3313
    3314                if (var63)
    3315                {
    3316                    var6.addVertexWithUV(var52, (double)par3, var48, var30, var36);
    3317                    var6.addVertexWithUV(var52, (double)par3, var44, var30, var32);
    3318                    var6.addVertexWithUV(var50, (double)par3, var44, var28, var32);
    3319                    var6.addVertexWithUV(var50, (double)par3, var48, var28, var36);
    3320                    var6.addVertexWithUV(var52, (double)par3, var44, var30, var36);
    3321                    var6.addVertexWithUV(var52, (double)par3, var48, var30, var32);
    3322                    var6.addVertexWithUV(var50, (double)par3, var48, var28, var32);
    3323                    var6.addVertexWithUV(var50, (double)par3, var44, var28, var36);
    3324                }
    3325                else
    3326                {
    3327                    if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1))
    3328                    {
    3329                        var6.addVertexWithUV(var50, (double)par3, var44, var30, var32);
    3330                        var6.addVertexWithUV(var50, (double)par3, var46, var30, var34);
    3331                        var6.addVertexWithUV(var52, (double)par3, var46, var28, var34);
    3332                        var6.addVertexWithUV(var52, (double)par3, var44, var28, var32);
    3333                        var6.addVertexWithUV(var50, (double)par3, var46, var30, var32);
    3334                        var6.addVertexWithUV(var50, (double)par3, var44, var30, var34);
    3335                        var6.addVertexWithUV(var52, (double)par3, var44, var28, var34);
    3336                        var6.addVertexWithUV(var52, (double)par3, var46, var28, var32);
    3337                    }
    3338
    3339                    if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1))
    3340                    {
    3341                        var6.addVertexWithUV(var50, (double)par3, var46, var28, var34);
    3342                        var6.addVertexWithUV(var50, (double)par3, var48, var28, var36);
    3343                        var6.addVertexWithUV(var52, (double)par3, var48, var30, var36);
    3344                        var6.addVertexWithUV(var52, (double)par3, var46, var30, var34);
    3345                        var6.addVertexWithUV(var50, (double)par3, var48, var28, var34);
    3346                        var6.addVertexWithUV(var50, (double)par3, var46, var28, var36);
    3347                        var6.addVertexWithUV(var52, (double)par3, var46, var30, var36);
    3348                        var6.addVertexWithUV(var52, (double)par3, var48, var30, var34);
    3349                    }
    3350                }
    3351            }
    3352
    3353            return true;
    3354        }
    3355
    3356        /**
    3357         * Renders any block requiring croseed squares such as reeds, flowers, and mushrooms
    3358         */
    3359        public boolean renderCrossedSquares(Block par1Block, int par2, int par3, int par4)
    3360        {
    3361            Tessellator var5 = Tessellator.instance;
    3362            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    3363            float var6 = 1.0F;
    3364            int var7 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4);
    3365            float var8 = (float)(var7 >> 16 & 255) / 255.0F;
    3366            float var9 = (float)(var7 >> 8 & 255) / 255.0F;
    3367            float var10 = (float)(var7 & 255) / 255.0F;
    3368
    3369            if (EntityRenderer.anaglyphEnable)
    3370            {
    3371                float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
    3372                float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
    3373                float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
    3374                var8 = var11;
    3375                var9 = var12;
    3376                var10 = var13;
    3377            }
    3378
    3379            var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10);
    3380            double var19 = (double)par2;
    3381            double var20 = (double)par3;
    3382            double var15 = (double)par4;
    3383
    3384            if (par1Block == Block.tallGrass)
    3385            {
    3386                long var17 = (long)(par2 * 3129871) ^(long)par4 * 116129781L ^(long)par3;
    3387                var17 = var17 * var17 * 42317861L + var17 * 11L;
    3388                var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D;
    3389                var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D;
    3390                var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D;
    3391            }
    3392
    3393            this.drawCrossedSquares(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, 1.0F);
    3394            return true;
    3395        }
    3396
    3397        /**
    3398         * Render block stem
    3399         */
    3400        public boolean renderBlockStem(Block par1Block, int par2, int par3, int par4)
    3401        {
    3402            BlockStem var5 = (BlockStem)par1Block;
    3403            Tessellator var6 = Tessellator.instance;
    3404            var6.setBrightness(var5.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    3405            float var7 = 1.0F;
    3406            int var8 = var5.colorMultiplier(this.blockAccess, par2, par3, par4);
    3407            float var9 = (float)(var8 >> 16 & 255) / 255.0F;
    3408            float var10 = (float)(var8 >> 8 & 255) / 255.0F;
    3409            float var11 = (float)(var8 & 255) / 255.0F;
    3410
    3411            if (EntityRenderer.anaglyphEnable)
    3412            {
    3413                float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F;
    3414                float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F;
    3415                float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F;
    3416                var9 = var12;
    3417                var10 = var13;
    3418                var11 = var14;
    3419            }
    3420
    3421            var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11);
    3422            var5.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4);
    3423            int var15 = var5.getState(this.blockAccess, par2, par3, par4);
    3424
    3425            if (var15 < 0)
    3426            {
    3427                this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), var5.maxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4);
    3428            }
    3429            else
    3430            {
    3431                this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), 0.5D, (double)par2, (double)((float)par3 - 0.0625F), (double)par4);
    3432                this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), var15, var5.maxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4);
    3433            }
    3434
    3435            return true;
    3436        }
    3437
    3438        /**
    3439         * Render block crops
    3440         */
    3441        public boolean renderBlockCrops(Block par1Block, int par2, int par3, int par4)
    3442        {
    3443            Tessellator var5 = Tessellator.instance;
    3444            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    3445            var5.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    3446            this.renderBlockCropsImpl(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), (double)par2, (double)((float)par3 - 0.0625F), (double)par4);
    3447            return true;
    3448        }
    3449
    3450        /**
    3451         * Renders a torch at the given coordinates, with the base slanting at the given delta
    3452         */
    3453        public void renderTorchAtAngle(Block par1Block, double par2, double par4, double par6, double par8, double par10)
    3454        {
    3455            Tessellator var12 = Tessellator.instance;
    3456            int var13 = par1Block.getBlockTextureFromSide(0);
    3457
    3458            if (this.overrideBlockTexture >= 0)
    3459            {
    3460                var13 = this.overrideBlockTexture;
    3461            }
    3462
    3463            int var14 = (var13 & 15) << 4;
    3464            int var15 = var13 & 240;
    3465            float var16 = (float)var14 / 256.0F;
    3466            float var17 = ((float)var14 + 15.99F) / 256.0F;
    3467            float var18 = (float)var15 / 256.0F;
    3468            float var19 = ((float)var15 + 15.99F) / 256.0F;
    3469            double var20 = (double)var16 + 0.02734375D;
    3470            double var22 = (double)var18 + 0.0234375D;
    3471            double var24 = (double)var16 + 0.03515625D;
    3472            double var26 = (double)var18 + 0.03125D;
    3473            par2 += 0.5D;
    3474            par6 += 0.5D;
    3475            double var28 = par2 - 0.5D;
    3476            double var30 = par2 + 0.5D;
    3477            double var32 = par6 - 0.5D;
    3478            double var34 = par6 + 0.5D;
    3479            double var36 = 0.0625D;
    3480            double var38 = 0.625D;
    3481            var12.addVertexWithUV(par2 + par8 * (1.0D - var38) - var36, par4 + var38, par6 + par10 * (1.0D - var38) - var36, var20, var22);
    3482            var12.addVertexWithUV(par2 + par8 * (1.0D - var38) - var36, par4 + var38, par6 + par10 * (1.0D - var38) + var36, var20, var26);
    3483            var12.addVertexWithUV(par2 + par8 * (1.0D - var38) + var36, par4 + var38, par6 + par10 * (1.0D - var38) + var36, var24, var26);
    3484            var12.addVertexWithUV(par2 + par8 * (1.0D - var38) + var36, par4 + var38, par6 + par10 * (1.0D - var38) - var36, var24, var22);
    3485            var12.addVertexWithUV(par2 - var36, par4 + 1.0D, var32, (double)var16, (double)var18);
    3486            var12.addVertexWithUV(par2 - var36 + par8, par4 + 0.0D, var32 + par10, (double)var16, (double)var19);
    3487            var12.addVertexWithUV(par2 - var36 + par8, par4 + 0.0D, var34 + par10, (double)var17, (double)var19);
    3488            var12.addVertexWithUV(par2 - var36, par4 + 1.0D, var34, (double)var17, (double)var18);
    3489            var12.addVertexWithUV(par2 + var36, par4 + 1.0D, var34, (double)var16, (double)var18);
    3490            var12.addVertexWithUV(par2 + par8 + var36, par4 + 0.0D, var34 + par10, (double)var16, (double)var19);
    3491            var12.addVertexWithUV(par2 + par8 + var36, par4 + 0.0D, var32 + par10, (double)var17, (double)var19);
    3492            var12.addVertexWithUV(par2 + var36, par4 + 1.0D, var32, (double)var17, (double)var18);
    3493            var12.addVertexWithUV(var28, par4 + 1.0D, par6 + var36, (double)var16, (double)var18);
    3494            var12.addVertexWithUV(var28 + par8, par4 + 0.0D, par6 + var36 + par10, (double)var16, (double)var19);
    3495            var12.addVertexWithUV(var30 + par8, par4 + 0.0D, par6 + var36 + par10, (double)var17, (double)var19);
    3496            var12.addVertexWithUV(var30, par4 + 1.0D, par6 + var36, (double)var17, (double)var18);
    3497            var12.addVertexWithUV(var30, par4 + 1.0D, par6 - var36, (double)var16, (double)var18);
    3498            var12.addVertexWithUV(var30 + par8, par4 + 0.0D, par6 - var36 + par10, (double)var16, (double)var19);
    3499            var12.addVertexWithUV(var28 + par8, par4 + 0.0D, par6 - var36 + par10, (double)var17, (double)var19);
    3500            var12.addVertexWithUV(var28, par4 + 1.0D, par6 - var36, (double)var17, (double)var18);
    3501        }
    3502
    3503        /**
    3504         * Utility function to draw crossed swuares
    3505         */
    3506        public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9)
    3507        {
    3508            Tessellator var10 = Tessellator.instance;
    3509            int var11 = par1Block.getBlockTextureFromSideAndMetadata(0, par2);
    3510
    3511            if (this.overrideBlockTexture >= 0)
    3512            {
    3513                var11 = this.overrideBlockTexture;
    3514            }
    3515
    3516            int var12 = (var11 & 15) << 4;
    3517            int var13 = var11 & 240;
    3518            double var14 = (double)((float)var12 / 256.0F);
    3519            double var16 = (double)(((float)var12 + 15.99F) / 256.0F);
    3520            double var18 = (double)((float)var13 / 256.0F);
    3521            double var20 = (double)(((float)var13 + 15.99F) / 256.0F);
    3522            double var22 = 0.45D * (double)par9;
    3523            double var24 = par3 + 0.5D - var22;
    3524            double var26 = par3 + 0.5D + var22;
    3525            double var28 = par7 + 0.5D - var22;
    3526            double var30 = par7 + 0.5D + var22;
    3527            var10.addVertexWithUV(var24, par5 + (double)par9, var28, var14, var18);
    3528            var10.addVertexWithUV(var24, par5 + 0.0D, var28, var14, var20);
    3529            var10.addVertexWithUV(var26, par5 + 0.0D, var30, var16, var20);
    3530            var10.addVertexWithUV(var26, par5 + (double)par9, var30, var16, var18);
    3531            var10.addVertexWithUV(var26, par5 + (double)par9, var30, var14, var18);
    3532            var10.addVertexWithUV(var26, par5 + 0.0D, var30, var14, var20);
    3533            var10.addVertexWithUV(var24, par5 + 0.0D, var28, var16, var20);
    3534            var10.addVertexWithUV(var24, par5 + (double)par9, var28, var16, var18);
    3535            var10.addVertexWithUV(var24, par5 + (double)par9, var30, var14, var18);
    3536            var10.addVertexWithUV(var24, par5 + 0.0D, var30, var14, var20);
    3537            var10.addVertexWithUV(var26, par5 + 0.0D, var28, var16, var20);
    3538            var10.addVertexWithUV(var26, par5 + (double)par9, var28, var16, var18);
    3539            var10.addVertexWithUV(var26, par5 + (double)par9, var28, var14, var18);
    3540            var10.addVertexWithUV(var26, par5 + 0.0D, var28, var14, var20);
    3541            var10.addVertexWithUV(var24, par5 + 0.0D, var30, var16, var20);
    3542            var10.addVertexWithUV(var24, par5 + (double)par9, var30, var16, var18);
    3543        }
    3544
    3545        /**
    3546         * Render block stem small
    3547         */
    3548        public void renderBlockStemSmall(Block par1Block, int par2, double par3, double par5, double par7, double par9)
    3549        {
    3550            Tessellator var11 = Tessellator.instance;
    3551            int var12 = par1Block.getBlockTextureFromSideAndMetadata(0, par2);
    3552
    3553            if (this.overrideBlockTexture >= 0)
    3554            {
    3555                var12 = this.overrideBlockTexture;
    3556            }
    3557
    3558            int var13 = (var12 & 15) << 4;
    3559            int var14 = var12 & 240;
    3560            double var15 = (double)((float)var13 / 256.0F);
    3561            double var17 = (double)(((float)var13 + 15.99F) / 256.0F);
    3562            double var19 = (double)((float)var14 / 256.0F);
    3563            double var21 = ((double)var14 + 15.989999771118164D * par3) / 256.0D;
    3564            double var23 = par5 + 0.5D - 0.44999998807907104D;
    3565            double var25 = par5 + 0.5D + 0.44999998807907104D;
    3566            double var27 = par9 + 0.5D - 0.44999998807907104D;
    3567            double var29 = par9 + 0.5D + 0.44999998807907104D;
    3568            var11.addVertexWithUV(var23, par7 + par3, var27, var15, var19);
    3569            var11.addVertexWithUV(var23, par7 + 0.0D, var27, var15, var21);
    3570            var11.addVertexWithUV(var25, par7 + 0.0D, var29, var17, var21);
    3571            var11.addVertexWithUV(var25, par7 + par3, var29, var17, var19);
    3572            var11.addVertexWithUV(var25, par7 + par3, var29, var15, var19);
    3573            var11.addVertexWithUV(var25, par7 + 0.0D, var29, var15, var21);
    3574            var11.addVertexWithUV(var23, par7 + 0.0D, var27, var17, var21);
    3575            var11.addVertexWithUV(var23, par7 + par3, var27, var17, var19);
    3576            var11.addVertexWithUV(var23, par7 + par3, var29, var15, var19);
    3577            var11.addVertexWithUV(var23, par7 + 0.0D, var29, var15, var21);
    3578            var11.addVertexWithUV(var25, par7 + 0.0D, var27, var17, var21);
    3579            var11.addVertexWithUV(var25, par7 + par3, var27, var17, var19);
    3580            var11.addVertexWithUV(var25, par7 + par3, var27, var15, var19);
    3581            var11.addVertexWithUV(var25, par7 + 0.0D, var27, var15, var21);
    3582            var11.addVertexWithUV(var23, par7 + 0.0D, var29, var17, var21);
    3583            var11.addVertexWithUV(var23, par7 + par3, var29, var17, var19);
    3584        }
    3585
    3586        /**
    3587         * Render BlockLilyPad
    3588         */
    3589        public boolean renderBlockLilyPad(Block par1Block, int par2, int par3, int par4)
    3590        {
    3591            Tessellator var5 = Tessellator.instance;
    3592            int var6 = par1Block.blockIndexInTexture;
    3593
    3594            if (this.overrideBlockTexture >= 0)
    3595            {
    3596                var6 = this.overrideBlockTexture;
    3597            }
    3598
    3599            int var7 = (var6 & 15) << 4;
    3600            int var8 = var6 & 240;
    3601            float var9 = 0.015625F;
    3602            double var10 = (double)((float)var7 / 256.0F);
    3603            double var12 = (double)(((float)var7 + 15.99F) / 256.0F);
    3604            double var14 = (double)((float)var8 / 256.0F);
    3605            double var16 = (double)(((float)var8 + 15.99F) / 256.0F);
    3606            long var18 = (long)(par2 * 3129871) ^(long)par4 * 116129781L ^(long)par3;
    3607            var18 = var18 * var18 * 42317861L + var18 * 11L;
    3608            int var20 = (int)(var18 >> 16 & 3L);
    3609            var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    3610            float var21 = (float)par2 + 0.5F;
    3611            float var22 = (float)par4 + 0.5F;
    3612            float var23 = (float)(var20 & 1) * 0.5F * (float)(1 - var20 / 2 % 2 * 2);
    3613            float var24 = (float)(var20 + 1 & 1) * 0.5F * (float)(1 - (var20 + 1) / 2 % 2 * 2);
    3614            var5.setColorOpaque_I(par1Block.getBlockColor());
    3615            var5.addVertexWithUV((double)(var21 + var23 - var24), (double)((float)par3 + var9), (double)(var22 + var23 + var24), var10, var14);
    3616            var5.addVertexWithUV((double)(var21 + var23 + var24), (double)((float)par3 + var9), (double)(var22 - var23 + var24), var12, var14);
    3617            var5.addVertexWithUV((double)(var21 - var23 + var24), (double)((float)par3 + var9), (double)(var22 - var23 - var24), var12, var16);
    3618            var5.addVertexWithUV((double)(var21 - var23 - var24), (double)((float)par3 + var9), (double)(var22 + var23 - var24), var10, var16);
    3619            var5.setColorOpaque_I((par1Block.getBlockColor() & 16711422) >> 1);
    3620            var5.addVertexWithUV((double)(var21 - var23 - var24), (double)((float)par3 + var9), (double)(var22 + var23 - var24), var10, var16);
    3621            var5.addVertexWithUV((double)(var21 - var23 + var24), (double)((float)par3 + var9), (double)(var22 - var23 - var24), var12, var16);
    3622            var5.addVertexWithUV((double)(var21 + var23 + var24), (double)((float)par3 + var9), (double)(var22 - var23 + var24), var12, var14);
    3623            var5.addVertexWithUV((double)(var21 + var23 - var24), (double)((float)par3 + var9), (double)(var22 + var23 + var24), var10, var14);
    3624            return true;
    3625        }
    3626
    3627        /**
    3628         * Render block stem big
    3629         */
    3630        public void renderBlockStemBig(Block par1Block, int par2, int par3, double par4, double par6, double par8, double par10)
    3631        {
    3632            Tessellator var12 = Tessellator.instance;
    3633            int var13 = par1Block.getBlockTextureFromSideAndMetadata(0, par2) + 16;
    3634
    3635            if (this.overrideBlockTexture >= 0)
    3636            {
    3637                var13 = this.overrideBlockTexture;
    3638            }
    3639
    3640            int var14 = (var13 & 15) << 4;
    3641            int var15 = var13 & 240;
    3642            double var16 = (double)((float)var14 / 256.0F);
    3643            double var18 = (double)(((float)var14 + 15.99F) / 256.0F);
    3644            double var20 = (double)((float)var15 / 256.0F);
    3645            double var22 = ((double)var15 + 15.989999771118164D * par4) / 256.0D;
    3646            double var24 = par6 + 0.5D - 0.5D;
    3647            double var26 = par6 + 0.5D + 0.5D;
    3648            double var28 = par10 + 0.5D - 0.5D;
    3649            double var30 = par10 + 0.5D + 0.5D;
    3650            double var32 = par6 + 0.5D;
    3651            double var34 = par10 + 0.5D;
    3652
    3653            if ((par3 + 1) / 2 % 2 == 1)
    3654            {
    3655                double var36 = var18;
    3656                var18 = var16;
    3657                var16 = var36;
    3658            }
    3659
    3660            if (par3 < 2)
    3661            {
    3662                var12.addVertexWithUV(var24, par8 + par4, var34, var16, var20);
    3663                var12.addVertexWithUV(var24, par8 + 0.0D, var34, var16, var22);
    3664                var12.addVertexWithUV(var26, par8 + 0.0D, var34, var18, var22);
    3665                var12.addVertexWithUV(var26, par8 + par4, var34, var18, var20);
    3666                var12.addVertexWithUV(var26, par8 + par4, var34, var18, var20);
    3667                var12.addVertexWithUV(var26, par8 + 0.0D, var34, var18, var22);
    3668                var12.addVertexWithUV(var24, par8 + 0.0D, var34, var16, var22);
    3669                var12.addVertexWithUV(var24, par8 + par4, var34, var16, var20);
    3670            }
    3671            else
    3672            {
    3673                var12.addVertexWithUV(var32, par8 + par4, var30, var16, var20);
    3674                var12.addVertexWithUV(var32, par8 + 0.0D, var30, var16, var22);
    3675                var12.addVertexWithUV(var32, par8 + 0.0D, var28, var18, var22);
    3676                var12.addVertexWithUV(var32, par8 + par4, var28, var18, var20);
    3677                var12.addVertexWithUV(var32, par8 + par4, var28, var18, var20);
    3678                var12.addVertexWithUV(var32, par8 + 0.0D, var28, var18, var22);
    3679                var12.addVertexWithUV(var32, par8 + 0.0D, var30, var16, var22);
    3680                var12.addVertexWithUV(var32, par8 + par4, var30, var16, var20);
    3681            }
    3682        }
    3683
    3684        /**
    3685         * Render block crops implementation
    3686         */
    3687        public void renderBlockCropsImpl(Block par1Block, int par2, double par3, double par5, double par7)
    3688        {
    3689            Tessellator var9 = Tessellator.instance;
    3690            int var10 = par1Block.getBlockTextureFromSideAndMetadata(0, par2);
    3691
    3692            if (this.overrideBlockTexture >= 0)
    3693            {
    3694                var10 = this.overrideBlockTexture;
    3695            }
    3696
    3697            int var11 = (var10 & 15) << 4;
    3698            int var12 = var10 & 240;
    3699            double var13 = (double)((float)var11 / 256.0F);
    3700            double var15 = (double)(((float)var11 + 15.99F) / 256.0F);
    3701            double var17 = (double)((float)var12 / 256.0F);
    3702            double var19 = (double)(((float)var12 + 15.99F) / 256.0F);
    3703            double var21 = par3 + 0.5D - 0.25D;
    3704            double var23 = par3 + 0.5D + 0.25D;
    3705            double var25 = par7 + 0.5D - 0.5D;
    3706            double var27 = par7 + 0.5D + 0.5D;
    3707            var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17);
    3708            var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19);
    3709            var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19);
    3710            var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17);
    3711            var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17);
    3712            var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19);
    3713            var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19);
    3714            var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17);
    3715            var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17);
    3716            var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19);
    3717            var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19);
    3718            var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17);
    3719            var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17);
    3720            var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19);
    3721            var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19);
    3722            var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17);
    3723            var21 = par3 + 0.5D - 0.5D;
    3724            var23 = par3 + 0.5D + 0.5D;
    3725            var25 = par7 + 0.5D - 0.25D;
    3726            var27 = par7 + 0.5D + 0.25D;
    3727            var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17);
    3728            var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19);
    3729            var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19);
    3730            var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17);
    3731            var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17);
    3732            var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19);
    3733            var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19);
    3734            var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17);
    3735            var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17);
    3736            var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19);
    3737            var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19);
    3738            var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17);
    3739            var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17);
    3740            var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19);
    3741            var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19);
    3742            var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17);
    3743        }
    3744
    3745        /**
    3746         * Renders a block based on the BlockFluids class at the given coordinates
    3747         */
    3748        public boolean renderBlockFluids(Block par1Block, int par2, int par3, int par4)
    3749        {
    3750            Tessellator var5 = Tessellator.instance;
    3751            int var6 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4);
    3752            float var7 = (float)(var6 >> 16 & 255) / 255.0F;
    3753            float var8 = (float)(var6 >> 8 & 255) / 255.0F;
    3754            float var9 = (float)(var6 & 255) / 255.0F;
    3755            boolean var10 = par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1);
    3756            boolean var11 = par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0);
    3757            boolean[] var12 = new boolean[] {par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2), par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3), par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4), par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5)};
    3758
    3759            if (!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3])
    3760            {
    3761                return false;
    3762            }
    3763            else
    3764            {
    3765                boolean var13 = false;
    3766                float var14 = 0.5F;
    3767                float var15 = 1.0F;
    3768                float var16 = 0.8F;
    3769                float var17 = 0.6F;
    3770                double var18 = 0.0D;
    3771                double var20 = 1.0D;
    3772                Material var22 = par1Block.blockMaterial;
    3773                int var23 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    3774                double var24 = (double)this.getFluidHeight(par2, par3, par4, var22);
    3775                double var26 = (double)this.getFluidHeight(par2, par3, par4 + 1, var22);
    3776                double var28 = (double)this.getFluidHeight(par2 + 1, par3, par4 + 1, var22);
    3777                double var30 = (double)this.getFluidHeight(par2 + 1, par3, par4, var22);
    3778                double var32 = 0.0010000000474974513D;
    3779                int var34;
    3780                int var37;
    3781
    3782                if (this.renderAllFaces || var10)
    3783                {
    3784                    var13 = true;
    3785                    var34 = par1Block.getBlockTextureFromSideAndMetadata(1, var23);
    3786                    float var35 = (float)BlockFluid.getFlowDirection(this.blockAccess, par2, par3, par4, var22);
    3787
    3788                    if (var35 > -999.0F)
    3789                    {
    3790                        var34 = par1Block.getBlockTextureFromSideAndMetadata(2, var23);
    3791                    }
    3792
    3793                    var24 -= var32;
    3794                    var26 -= var32;
    3795                    var28 -= var32;
    3796                    var30 -= var32;
    3797                    int var36 = (var34 & 15) << 4;
    3798                    var37 = var34 & 240;
    3799                    double var38 = ((double)var36 + 8.0D) / 256.0D;
    3800                    double var40 = ((double)var37 + 8.0D) / 256.0D;
    3801
    3802                    if (var35 < -999.0F)
    3803                    {
    3804                        var35 = 0.0F;
    3805                    }
    3806                    else
    3807                    {
    3808                        var38 = (double)((float)(var36 + 16) / 256.0F);
    3809                        var40 = (double)((float)(var37 + 16) / 256.0F);
    3810                    }
    3811
    3812                    double var42 = (double)(MathHelper.sin(var35) * 8.0F) / 256.0D;
    3813                    double var44 = (double)(MathHelper.cos(var35) * 8.0F) / 256.0D;
    3814                    var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    3815                    float var46 = 1.0F;
    3816                    var5.setColorOpaque_F(var15 * var46 * var7, var15 * var46 * var8, var15 * var46 * var9);
    3817                    var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var24, (double)(par4 + 0), var38 - var44 - var42, var40 - var44 + var42);
    3818                    var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var26, (double)(par4 + 1), var38 - var44 + var42, var40 + var44 + var42);
    3819                    var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var28, (double)(par4 + 1), var38 + var44 + var42, var40 + var44 - var42);
    3820                    var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var30, (double)(par4 + 0), var38 + var44 - var42, var40 - var44 - var42);
    3821                }
    3822
    3823                if (this.renderAllFaces || var11)
    3824                {
    3825                    var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4));
    3826                    float var65 = 1.0F;
    3827                    var5.setColorOpaque_F(var14 * var65, var14 * var65, var14 * var65);
    3828                    this.renderBottomFace(par1Block, (double)par2, (double)par3 + var32, (double)par4, par1Block.getBlockTextureFromSide(0));
    3829                    var13 = true;
    3830                }
    3831
    3832                for (var34 = 0; var34 < 4; ++var34)
    3833                {
    3834                    int var64 = par2;
    3835                    var37 = par4;
    3836
    3837                    if (var34 == 0)
    3838                    {
    3839                        var37 = par4 - 1;
    3840                    }
    3841
    3842                    if (var34 == 1)
    3843                    {
    3844                        ++var37;
    3845                    }
    3846
    3847                    if (var34 == 2)
    3848                    {
    3849                        var64 = par2 - 1;
    3850                    }
    3851
    3852                    if (var34 == 3)
    3853                    {
    3854                        ++var64;
    3855                    }
    3856
    3857                    int var66 = par1Block.getBlockTextureFromSideAndMetadata(var34 + 2, var23);
    3858                    int var39 = (var66 & 15) << 4;
    3859                    int var67 = var66 & 240;
    3860
    3861                    if (this.renderAllFaces || var12[var34])
    3862                    {
    3863                        double var43;
    3864                        double var41;
    3865                        double var47;
    3866                        double var45;
    3867                        double var51;
    3868                        double var49;
    3869
    3870                        if (var34 == 0)
    3871                        {
    3872                            var41 = var24;
    3873                            var43 = var30;
    3874                            var45 = (double)par2;
    3875                            var49 = (double)(par2 + 1);
    3876                            var47 = (double)par4 + var32;
    3877                            var51 = (double)par4 + var32;
    3878                        }
    3879                        else if (var34 == 1)
    3880                        {
    3881                            var41 = var28;
    3882                            var43 = var26;
    3883                            var45 = (double)(par2 + 1);
    3884                            var49 = (double)par2;
    3885                            var47 = (double)(par4 + 1) - var32;
    3886                            var51 = (double)(par4 + 1) - var32;
    3887                        }
    3888                        else if (var34 == 2)
    3889                        {
    3890                            var41 = var26;
    3891                            var43 = var24;
    3892                            var45 = (double)par2 + var32;
    3893                            var49 = (double)par2 + var32;
    3894                            var47 = (double)(par4 + 1);
    3895                            var51 = (double)par4;
    3896                        }
    3897                        else
    3898                        {
    3899                            var41 = var30;
    3900                            var43 = var28;
    3901                            var45 = (double)(par2 + 1) - var32;
    3902                            var49 = (double)(par2 + 1) - var32;
    3903                            var47 = (double)par4;
    3904                            var51 = (double)(par4 + 1);
    3905                        }
    3906
    3907                        var13 = true;
    3908                        double var53 = (double)((float)(var39 + 0) / 256.0F);
    3909                        double var55 = ((double)(var39 + 16) - 0.01D) / 256.0D;
    3910                        double var57 = ((double)var67 + (1.0D - var41) * 16.0D) / 256.0D;
    3911                        double var59 = ((double)var67 + (1.0D - var43) * 16.0D) / 256.0D;
    3912                        double var61 = ((double)(var67 + 16) - 0.01D) / 256.0D;
    3913                        var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, var64, par3, var37));
    3914                        float var63 = 1.0F;
    3915
    3916                        if (var34 < 2)
    3917                        {
    3918                            var63 *= var16;
    3919                        }
    3920                        else
    3921                        {
    3922                            var63 *= var17;
    3923                        }
    3924
    3925                        var5.setColorOpaque_F(var15 * var63 * var7, var15 * var63 * var8, var15 * var63 * var9);
    3926                        var5.addVertexWithUV(var45, (double)par3 + var41, var47, var53, var57);
    3927                        var5.addVertexWithUV(var49, (double)par3 + var43, var51, var55, var59);
    3928                        var5.addVertexWithUV(var49, (double)(par3 + 0), var51, var55, var61);
    3929                        var5.addVertexWithUV(var45, (double)(par3 + 0), var47, var53, var61);
    3930                    }
    3931                }
    3932
    3933                par1Block.minY = var18;
    3934                par1Block.maxY = var20;
    3935                return var13;
    3936            }
    3937        }
    3938
    3939        /**
    3940         * Get fluid height
    3941         */
    3942        public float getFluidHeight(int par1, int par2, int par3, Material par4Material)
    3943        {
    3944            int var5 = 0;
    3945            float var6 = 0.0F;
    3946
    3947            for (int var7 = 0; var7 < 4; ++var7)
    3948            {
    3949                int var8 = par1 - (var7 & 1);
    3950                int var10 = par3 - (var7 >> 1 & 1);
    3951
    3952                if (this.blockAccess.getBlockMaterial(var8, par2 + 1, var10) == par4Material)
    3953                {
    3954                    return 1.0F;
    3955                }
    3956
    3957                Material var11 = this.blockAccess.getBlockMaterial(var8, par2, var10);
    3958
    3959                if (var11 == par4Material)
    3960                {
    3961                    int var12 = this.blockAccess.getBlockMetadata(var8, par2, var10);
    3962
    3963                    if (var12 >= 8 || var12 == 0)
    3964                    {
    3965                        var6 += BlockFluid.getFluidHeightPercent(var12) * 10.0F;
    3966                        var5 += 10;
    3967                    }
    3968
    3969                    var6 += BlockFluid.getFluidHeightPercent(var12);
    3970                    ++var5;
    3971                }
    3972                else if (!var11.isSolid())
    3973                {
    3974                    ++var6;
    3975                    ++var5;
    3976                }
    3977            }
    3978
    3979            return 1.0F - var6 / (float)var5;
    3980        }
    3981
    3982        public void func_78588_a(Block par1Block, World par2World, int par3, int par4, int par5, int par6)
    3983        {
    3984            float var7 = 0.5F;
    3985            float var8 = 1.0F;
    3986            float var9 = 0.8F;
    3987            float var10 = 0.6F;
    3988            Tessellator var11 = Tessellator.instance;
    3989            var11.startDrawingQuads();
    3990            var11.setBrightness(par1Block.getMixedBrightnessForBlock(par2World, par3, par4, par5));
    3991            float var12 = 1.0F;
    3992            float var13 = 1.0F;
    3993
    3994            if (var13 < var12)
    3995            {
    3996                var13 = var12;
    3997            }
    3998
    3999            var11.setColorOpaque_F(var7 * var13, var7 * var13, var7 * var13);
    4000            this.renderBottomFace(par1Block, -0.5D, -0.5D, -0.5D, par1Block.getBlockTextureFromSideAndMetadata(0, par6));
    4001            var13 = 1.0F;
    4002
    4003            if (var13 < var12)
    4004            {
    4005                var13 = var12;
    4006            }
    4007
    4008            var11.setColorOpaque_F(var8 * var13, var8 * var13, var8 * var13);
    4009            this.renderTopFace(par1Block, -0.5D, -0.5D, -0.5D, par1Block.getBlockTextureFromSideAndMetadata(1, par6));
    4010            var13 = 1.0F;
    4011
    4012            if (var13 < var12)
    4013            {
    4014                var13 = var12;
    4015            }
    4016
    4017            var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13);
    4018            this.renderEastFace(par1Block, -0.5D, -0.5D, -0.5D, par1Block.getBlockTextureFromSideAndMetadata(2, par6));
    4019            var13 = 1.0F;
    4020
    4021            if (var13 < var12)
    4022            {
    4023                var13 = var12;
    4024            }
    4025
    4026            var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13);
    4027            this.renderWestFace(par1Block, -0.5D, -0.5D, -0.5D, par1Block.getBlockTextureFromSideAndMetadata(3, par6));
    4028            var13 = 1.0F;
    4029
    4030            if (var13 < var12)
    4031            {
    4032                var13 = var12;
    4033            }
    4034
    4035            var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13);
    4036            this.renderNorthFace(par1Block, -0.5D, -0.5D, -0.5D, par1Block.getBlockTextureFromSideAndMetadata(4, par6));
    4037            var13 = 1.0F;
    4038
    4039            if (var13 < var12)
    4040            {
    4041                var13 = var12;
    4042            }
    4043
    4044            var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13);
    4045            this.renderSouthFace(par1Block, -0.5D, -0.5D, -0.5D, par1Block.getBlockTextureFromSideAndMetadata(5, par6));
    4046            var11.draw();
    4047        }
    4048
    4049        /**
    4050         * Renders a standard cube block at the given coordinates
    4051         */
    4052        public boolean renderStandardBlock(Block par1Block, int par2, int par3, int par4)
    4053        {
    4054            int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4);
    4055            float var6 = (float)(var5 >> 16 & 255) / 255.0F;
    4056            float var7 = (float)(var5 >> 8 & 255) / 255.0F;
    4057            float var8 = (float)(var5 & 255) / 255.0F;
    4058
    4059            if (EntityRenderer.anaglyphEnable)
    4060            {
    4061                float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F;
    4062                float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F;
    4063                float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F;
    4064                var6 = var9;
    4065                var7 = var10;
    4066                var8 = var11;
    4067            }
    4068
    4069            return Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[par1Block.blockID] == 0 ? this.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, var6, var7, var8) : this.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, var6, var7, var8);
    4070        }
    4071
    4072        /**
    4073         * Renders a log block at the given coordinates
    4074         */
    4075        public boolean renderBlockLog(Block par1Block, int par2, int par3, int par4)
    4076        {
    4077            int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    4078            int var6 = var5 & 12;
    4079
    4080            if (var6 == 4)
    4081            {
    4082                this.uvRotateEast = 1;
    4083                this.uvRotateWest = 1;
    4084                this.uvRotateTop = 1;
    4085                this.uvRotateBottom = 1;
    4086            }
    4087            else if (var6 == 8)
    4088            {
    4089                this.uvRotateSouth = 1;
    4090                this.uvRotateNorth = 1;
    4091            }
    4092
    4093            boolean var7 = this.renderStandardBlock(par1Block, par2, par3, par4);
    4094            this.uvRotateSouth = 0;
    4095            this.uvRotateEast = 0;
    4096            this.uvRotateWest = 0;
    4097            this.uvRotateNorth = 0;
    4098            this.uvRotateTop = 0;
    4099            this.uvRotateBottom = 0;
    4100            return var7;
    4101        }
    4102
    4103        public boolean renderStandardBlockWithAmbientOcclusion(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7)
    4104        {
    4105            this.enableAO = true;
    4106            boolean var8 = false;
    4107            float var9 = this.lightValueOwn;
    4108            float var10 = this.lightValueOwn;
    4109            float var11 = this.lightValueOwn;
    4110            float var12 = this.lightValueOwn;
    4111            boolean var13 = true;
    4112            boolean var14 = true;
    4113            boolean var15 = true;
    4114            boolean var16 = true;
    4115            boolean var17 = true;
    4116            boolean var18 = true;
    4117            this.lightValueOwn = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4);
    4118            this.aoLightValueXNeg = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4);
    4119            this.aoLightValueYNeg = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4);
    4120            this.aoLightValueZNeg = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1);
    4121            this.aoLightValueXPos = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4);
    4122            this.aoLightValueYPos = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4);
    4123            this.aoLightValueZPos = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1);
    4124            int var19 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4);
    4125            int var20 = var19;
    4126            int var21 = var19;
    4127            int var22 = var19;
    4128            int var23 = var19;
    4129            int var24 = var19;
    4130            int var25 = var19;
    4131
    4132            if (par1Block.minY <= 0.0D)
    4133            {
    4134                var21 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4);
    4135            }
    4136
    4137            if (par1Block.maxY >= 1.0D)
    4138            {
    4139                var24 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4);
    4140            }
    4141
    4142            if (par1Block.minX <= 0.0D)
    4143            {
    4144                var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4);
    4145            }
    4146
    4147            if (par1Block.maxX >= 1.0D)
    4148            {
    4149                var23 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4);
    4150            }
    4151
    4152            if (par1Block.minZ <= 0.0D)
    4153            {
    4154                var22 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1);
    4155            }
    4156
    4157            if (par1Block.maxZ >= 1.0D)
    4158            {
    4159                var25 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1);
    4160            }
    4161
    4162            Tessellator var26 = Tessellator.instance;
    4163            var26.setBrightness(983055);
    4164            this.aoGrassXYZPPC = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)];
    4165            this.aoGrassXYZPNC = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)];
    4166            this.aoGrassXYZPCP = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)];
    4167            this.aoGrassXYZPCN = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)];
    4168            this.aoGrassXYZNPC = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)];
    4169            this.aoGrassXYZNNC = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)];
    4170            this.aoGrassXYZNCN = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)];
    4171            this.aoGrassXYZNCP = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)];
    4172            this.aoGrassXYZCPP = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)];
    4173            this.aoGrassXYZCPN = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)];
    4174            this.aoGrassXYZCNP = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)];
    4175            this.aoGrassXYZCNN = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)];
    4176
    4177            if (par1Block.blockIndexInTexture == 3)
    4178            {
    4179                var18 = false;
    4180                var17 = false;
    4181                var16 = false;
    4182                var15 = false;
    4183                var13 = false;
    4184            }
    4185
    4186            if (this.overrideBlockTexture >= 0)
    4187            {
    4188                var18 = false;
    4189                var17 = false;
    4190                var16 = false;
    4191                var15 = false;
    4192                var13 = false;
    4193            }
    4194
    4195            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0))
    4196            {
    4197                if (this.aoType > 0)
    4198                {
    4199                    if (par1Block.minY <= 0.0D)
    4200                    {
    4201                        --par3;
    4202                    }
    4203
    4204                    this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4);
    4205                    this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1);
    4206                    this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1);
    4207                    this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4);
    4208                    this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4);
    4209                    this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1);
    4210                    this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1);
    4211                    this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4);
    4212
    4213                    if (!this.aoGrassXYZCNN && !this.aoGrassXYZNNC)
    4214                    {
    4215                        this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN;
    4216                        this.aoBrightnessXYZNNN = this.aoBrightnessXYNN;
    4217                    }
    4218                    else
    4219                    {
    4220                        this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1);
    4221                        this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1);
    4222                    }
    4223
    4224                    if (!this.aoGrassXYZCNP && !this.aoGrassXYZNNC)
    4225                    {
    4226                        this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN;
    4227                        this.aoBrightnessXYZNNP = this.aoBrightnessXYNN;
    4228                    }
    4229                    else
    4230                    {
    4231                        this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1);
    4232                        this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1);
    4233                    }
    4234
    4235                    if (!this.aoGrassXYZCNN && !this.aoGrassXYZPNC)
    4236                    {
    4237                        this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN;
    4238                        this.aoBrightnessXYZPNN = this.aoBrightnessXYPN;
    4239                    }
    4240                    else
    4241                    {
    4242                        this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1);
    4243                        this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1);
    4244                    }
    4245
    4246                    if (!this.aoGrassXYZCNP && !this.aoGrassXYZPNC)
    4247                    {
    4248                        this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN;
    4249                        this.aoBrightnessXYZPNP = this.aoBrightnessXYPN;
    4250                    }
    4251                    else
    4252                    {
    4253                        this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1);
    4254                        this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1);
    4255                    }
    4256
    4257                    if (par1Block.minY <= 0.0D)
    4258                    {
    4259                        ++par3;
    4260                    }
    4261
    4262                    var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + this.aoLightValueYNeg) / 4.0F;
    4263                    var12 = (this.aoLightValueScratchYZNP + this.aoLightValueYNeg + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F;
    4264                    var11 = (this.aoLightValueYNeg + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F;
    4265                    var10 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + this.aoLightValueYNeg + this.aoLightValueScratchYZNN) / 4.0F;
    4266                    this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, var21);
    4267                    this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var21);
    4268                    this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var21);
    4269                    this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var21);
    4270                }
    4271                else
    4272                {
    4273                    var12 = this.aoLightValueYNeg;
    4274                    var11 = this.aoLightValueYNeg;
    4275                    var10 = this.aoLightValueYNeg;
    4276                    var9 = this.aoLightValueYNeg;
    4277                    this.brightnessTopLeft = this.brightnessBottomLeft = this.brightnessBottomRight = this.brightnessTopRight = this.aoBrightnessXYNN;
    4278                }
    4279
    4280                this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (var13 ? par5 : 1.0F) * 0.5F;
    4281                this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (var13 ? par6 : 1.0F) * 0.5F;
    4282                this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (var13 ? par7 : 1.0F) * 0.5F;
    4283                this.colorRedTopLeft *= var9;
    4284                this.colorGreenTopLeft *= var9;
    4285                this.colorBlueTopLeft *= var9;
    4286                this.colorRedBottomLeft *= var10;
    4287                this.colorGreenBottomLeft *= var10;
    4288                this.colorBlueBottomLeft *= var10;
    4289                this.colorRedBottomRight *= var11;
    4290                this.colorGreenBottomRight *= var11;
    4291                this.colorBlueBottomRight *= var11;
    4292                this.colorRedTopRight *= var12;
    4293                this.colorGreenTopRight *= var12;
    4294                this.colorBlueTopRight *= var12;
    4295                this.renderBottomFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0));
    4296                var8 = true;
    4297            }
    4298
    4299            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1))
    4300            {
    4301                if (this.aoType > 0)
    4302                {
    4303                    if (par1Block.maxY >= 1.0D)
    4304                    {
    4305                        ++par3;
    4306                    }
    4307
    4308                    this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4);
    4309                    this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4);
    4310                    this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1);
    4311                    this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1);
    4312                    this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4);
    4313                    this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4);
    4314                    this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1);
    4315                    this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1);
    4316
    4317                    if (!this.aoGrassXYZCPN && !this.aoGrassXYZNPC)
    4318                    {
    4319                        this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP;
    4320                        this.aoBrightnessXYZNPN = this.aoBrightnessXYNP;
    4321                    }
    4322                    else
    4323                    {
    4324                        this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1);
    4325                        this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1);
    4326                    }
    4327
    4328                    if (!this.aoGrassXYZCPN && !this.aoGrassXYZPPC)
    4329                    {
    4330                        this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP;
    4331                        this.aoBrightnessXYZPPN = this.aoBrightnessXYPP;
    4332                    }
    4333                    else
    4334                    {
    4335                        this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1);
    4336                        this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1);
    4337                    }
    4338
    4339                    if (!this.aoGrassXYZCPP && !this.aoGrassXYZNPC)
    4340                    {
    4341                        this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP;
    4342                        this.aoBrightnessXYZNPP = this.aoBrightnessXYNP;
    4343                    }
    4344                    else
    4345                    {
    4346                        this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1);
    4347                        this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1);
    4348                    }
    4349
    4350                    if (!this.aoGrassXYZCPP && !this.aoGrassXYZPPC)
    4351                    {
    4352                        this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP;
    4353                        this.aoBrightnessXYZPPP = this.aoBrightnessXYPP;
    4354                    }
    4355                    else
    4356                    {
    4357                        this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1);
    4358                        this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1);
    4359                    }
    4360
    4361                    if (par1Block.maxY >= 1.0D)
    4362                    {
    4363                        --par3;
    4364                    }
    4365
    4366                    var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + this.aoLightValueYPos) / 4.0F;
    4367                    var9 = (this.aoLightValueScratchYZPP + this.aoLightValueYPos + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F;
    4368                    var10 = (this.aoLightValueYPos + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F;
    4369                    var11 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + this.aoLightValueYPos + this.aoLightValueScratchYZPN) / 4.0F;
    4370                    this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, var24);
    4371                    this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var24);
    4372                    this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var24);
    4373                    this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var24);
    4374                }
    4375                else
    4376                {
    4377                    var12 = this.aoLightValueYPos;
    4378                    var11 = this.aoLightValueYPos;
    4379                    var10 = this.aoLightValueYPos;
    4380                    var9 = this.aoLightValueYPos;
    4381                    this.brightnessTopLeft = this.brightnessBottomLeft = this.brightnessBottomRight = this.brightnessTopRight = var24;
    4382                }
    4383
    4384                this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var14 ? par5 : 1.0F;
    4385                this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var14 ? par6 : 1.0F;
    4386                this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var14 ? par7 : 1.0F;
    4387                this.colorRedTopLeft *= var9;
    4388                this.colorGreenTopLeft *= var9;
    4389                this.colorBlueTopLeft *= var9;
    4390                this.colorRedBottomLeft *= var10;
    4391                this.colorGreenBottomLeft *= var10;
    4392                this.colorBlueBottomLeft *= var10;
    4393                this.colorRedBottomRight *= var11;
    4394                this.colorGreenBottomRight *= var11;
    4395                this.colorBlueBottomRight *= var11;
    4396                this.colorRedTopRight *= var12;
    4397                this.colorGreenTopRight *= var12;
    4398                this.colorBlueTopRight *= var12;
    4399                this.renderTopFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1));
    4400                var8 = true;
    4401            }
    4402
    4403            int var27;
    4404
    4405            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2))
    4406            {
    4407                if (this.aoType > 0)
    4408                {
    4409                    if (par1Block.minZ <= 0.0D)
    4410                    {
    4411                        --par4;
    4412                    }
    4413
    4414                    this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4);
    4415                    this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4);
    4416                    this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4);
    4417                    this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4);
    4418                    this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4);
    4419                    this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4);
    4420                    this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4);
    4421                    this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4);
    4422
    4423                    if (!this.aoGrassXYZNCN && !this.aoGrassXYZCNN)
    4424                    {
    4425                        this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
    4426                        this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
    4427                    }
    4428                    else
    4429                    {
    4430                        this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4);
    4431                        this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4);
    4432                    }
    4433
    4434                    if (!this.aoGrassXYZNCN && !this.aoGrassXYZCPN)
    4435                    {
    4436                        this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
    4437                        this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
    4438                    }
    4439                    else
    4440                    {
    4441                        this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4);
    4442                        this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4);
    4443                    }
    4444
    4445                    if (!this.aoGrassXYZPCN && !this.aoGrassXYZCNN)
    4446                    {
    4447                        this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
    4448                        this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
    4449                    }
    4450                    else
    4451                    {
    4452                        this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4);
    4453                        this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4);
    4454                    }
    4455
    4456                    if (!this.aoGrassXYZPCN && !this.aoGrassXYZCPN)
    4457                    {
    4458                        this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
    4459                        this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
    4460                    }
    4461                    else
    4462                    {
    4463                        this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4);
    4464                        this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4);
    4465                    }
    4466
    4467                    if (par1Block.minZ <= 0.0D)
    4468                    {
    4469                        ++par4;
    4470                    }
    4471
    4472                    var9 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + this.aoLightValueZNeg + this.aoLightValueScratchYZPN) / 4.0F;
    4473                    var10 = (this.aoLightValueZNeg + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F;
    4474                    var11 = (this.aoLightValueScratchYZNN + this.aoLightValueZNeg + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F;
    4475                    var12 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + this.aoLightValueZNeg) / 4.0F;
    4476                    this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var22);
    4477                    this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var22);
    4478                    this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var22);
    4479                    this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var22);
    4480                }
    4481                else
    4482                {
    4483                    var12 = this.aoLightValueZNeg;
    4484                    var11 = this.aoLightValueZNeg;
    4485                    var10 = this.aoLightValueZNeg;
    4486                    var9 = this.aoLightValueZNeg;
    4487                    this.brightnessTopLeft = this.brightnessBottomLeft = this.brightnessBottomRight = this.brightnessTopRight = var22;
    4488                }
    4489
    4490                this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (var15 ? par5 : 1.0F) * 0.8F;
    4491                this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (var15 ? par6 : 1.0F) * 0.8F;
    4492                this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (var15 ? par7 : 1.0F) * 0.8F;
    4493                this.colorRedTopLeft *= var9;
    4494                this.colorGreenTopLeft *= var9;
    4495                this.colorBlueTopLeft *= var9;
    4496                this.colorRedBottomLeft *= var10;
    4497                this.colorGreenBottomLeft *= var10;
    4498                this.colorBlueBottomLeft *= var10;
    4499                this.colorRedBottomRight *= var11;
    4500                this.colorGreenBottomRight *= var11;
    4501                this.colorBlueBottomRight *= var11;
    4502                this.colorRedTopRight *= var12;
    4503                this.colorGreenTopRight *= var12;
    4504                this.colorBlueTopRight *= var12;
    4505                var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
    4506                this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
    4507
    4508                if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
    4509                {
    4510                    this.colorRedTopLeft *= par5;
    4511                    this.colorRedBottomLeft *= par5;
    4512                    this.colorRedBottomRight *= par5;
    4513                    this.colorRedTopRight *= par5;
    4514                    this.colorGreenTopLeft *= par6;
    4515                    this.colorGreenBottomLeft *= par6;
    4516                    this.colorGreenBottomRight *= par6;
    4517                    this.colorGreenTopRight *= par6;
    4518                    this.colorBlueTopLeft *= par7;
    4519                    this.colorBlueBottomLeft *= par7;
    4520                    this.colorBlueBottomRight *= par7;
    4521                    this.colorBlueTopRight *= par7;
    4522                    this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    4523                }
    4524
    4525                var8 = true;
    4526            }
    4527
    4528            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3))
    4529            {
    4530                if (this.aoType > 0)
    4531                {
    4532                    if (par1Block.maxZ >= 1.0D)
    4533                    {
    4534                        ++par4;
    4535                    }
    4536
    4537                    this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4);
    4538                    this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4);
    4539                    this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4);
    4540                    this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4);
    4541                    this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4);
    4542                    this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4);
    4543                    this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4);
    4544                    this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4);
    4545
    4546                    if (!this.aoGrassXYZNCP && !this.aoGrassXYZCNP)
    4547                    {
    4548                        this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
    4549                        this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
    4550                    }
    4551                    else
    4552                    {
    4553                        this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4);
    4554                        this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4);
    4555                    }
    4556
    4557                    if (!this.aoGrassXYZNCP && !this.aoGrassXYZCPP)
    4558                    {
    4559                        this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
    4560                        this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
    4561                    }
    4562                    else
    4563                    {
    4564                        this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4);
    4565                        this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4);
    4566                    }
    4567
    4568                    if (!this.aoGrassXYZPCP && !this.aoGrassXYZCNP)
    4569                    {
    4570                        this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
    4571                        this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
    4572                    }
    4573                    else
    4574                    {
    4575                        this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4);
    4576                        this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4);
    4577                    }
    4578
    4579                    if (!this.aoGrassXYZPCP && !this.aoGrassXYZCPP)
    4580                    {
    4581                        this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
    4582                        this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
    4583                    }
    4584                    else
    4585                    {
    4586                        this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4);
    4587                        this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4);
    4588                    }
    4589
    4590                    if (par1Block.maxZ >= 1.0D)
    4591                    {
    4592                        --par4;
    4593                    }
    4594
    4595                    var9 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + this.aoLightValueZPos + this.aoLightValueScratchYZPP) / 4.0F;
    4596                    var12 = (this.aoLightValueZPos + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F;
    4597                    var11 = (this.aoLightValueScratchYZNP + this.aoLightValueZPos + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F;
    4598                    var10 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + this.aoLightValueZPos) / 4.0F;
    4599                    this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, var25);
    4600                    this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var25);
    4601                    this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var25);
    4602                    this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var25);
    4603                }
    4604                else
    4605                {
    4606                    var12 = this.aoLightValueZPos;
    4607                    var11 = this.aoLightValueZPos;
    4608                    var10 = this.aoLightValueZPos;
    4609                    var9 = this.aoLightValueZPos;
    4610                    this.brightnessTopLeft = this.brightnessBottomLeft = this.brightnessBottomRight = this.brightnessTopRight = var25;
    4611                }
    4612
    4613                this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (var16 ? par5 : 1.0F) * 0.8F;
    4614                this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (var16 ? par6 : 1.0F) * 0.8F;
    4615                this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (var16 ? par7 : 1.0F) * 0.8F;
    4616                this.colorRedTopLeft *= var9;
    4617                this.colorGreenTopLeft *= var9;
    4618                this.colorBlueTopLeft *= var9;
    4619                this.colorRedBottomLeft *= var10;
    4620                this.colorGreenBottomLeft *= var10;
    4621                this.colorBlueBottomLeft *= var10;
    4622                this.colorRedBottomRight *= var11;
    4623                this.colorGreenBottomRight *= var11;
    4624                this.colorBlueBottomRight *= var11;
    4625                this.colorRedTopRight *= var12;
    4626                this.colorGreenTopRight *= var12;
    4627                this.colorBlueTopRight *= var12;
    4628                var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
    4629                this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
    4630
    4631                if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
    4632                {
    4633                    this.colorRedTopLeft *= par5;
    4634                    this.colorRedBottomLeft *= par5;
    4635                    this.colorRedBottomRight *= par5;
    4636                    this.colorRedTopRight *= par5;
    4637                    this.colorGreenTopLeft *= par6;
    4638                    this.colorGreenBottomLeft *= par6;
    4639                    this.colorGreenBottomRight *= par6;
    4640                    this.colorGreenTopRight *= par6;
    4641                    this.colorBlueTopLeft *= par7;
    4642                    this.colorBlueBottomLeft *= par7;
    4643                    this.colorBlueBottomRight *= par7;
    4644                    this.colorBlueTopRight *= par7;
    4645                    this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    4646                }
    4647
    4648                var8 = true;
    4649            }
    4650
    4651            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4))
    4652            {
    4653                if (this.aoType > 0)
    4654                {
    4655                    if (par1Block.minX <= 0.0D)
    4656                    {
    4657                        --par2;
    4658                    }
    4659
    4660                    this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4);
    4661                    this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1);
    4662                    this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1);
    4663                    this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4);
    4664                    this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4);
    4665                    this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1);
    4666                    this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1);
    4667                    this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4);
    4668
    4669                    if (!this.aoGrassXYZNCN && !this.aoGrassXYZNNC)
    4670                    {
    4671                        this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
    4672                        this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
    4673                    }
    4674                    else
    4675                    {
    4676                        this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1);
    4677                        this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1);
    4678                    }
    4679
    4680                    if (!this.aoGrassXYZNCP && !this.aoGrassXYZNNC)
    4681                    {
    4682                        this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
    4683                        this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
    4684                    }
    4685                    else
    4686                    {
    4687                        this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1);
    4688                        this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1);
    4689                    }
    4690
    4691                    if (!this.aoGrassXYZNCN && !this.aoGrassXYZNPC)
    4692                    {
    4693                        this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
    4694                        this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
    4695                    }
    4696                    else
    4697                    {
    4698                        this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1);
    4699                        this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1);
    4700                    }
    4701
    4702                    if (!this.aoGrassXYZNCP && !this.aoGrassXYZNPC)
    4703                    {
    4704                        this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
    4705                        this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
    4706                    }
    4707                    else
    4708                    {
    4709                        this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1);
    4710                        this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1);
    4711                    }
    4712
    4713                    if (par1Block.minX <= 0.0D)
    4714                    {
    4715                        ++par2;
    4716                    }
    4717
    4718                    var12 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + this.aoLightValueXNeg + this.aoLightValueScratchXZNP) / 4.0F;
    4719                    var9 = (this.aoLightValueXNeg + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F;
    4720                    var10 = (this.aoLightValueScratchXZNN + this.aoLightValueXNeg + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F;
    4721                    var11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + this.aoLightValueXNeg) / 4.0F;
    4722                    this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, var20);
    4723                    this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20);
    4724                    this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20);
    4725                    this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20);
    4726                }
    4727                else
    4728                {
    4729                    var12 = this.aoLightValueXNeg;
    4730                    var11 = this.aoLightValueXNeg;
    4731                    var10 = this.aoLightValueXNeg;
    4732                    var9 = this.aoLightValueXNeg;
    4733                    this.brightnessTopLeft = this.brightnessBottomLeft = this.brightnessBottomRight = this.brightnessTopRight = var20;
    4734                }
    4735
    4736                this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (var17 ? par5 : 1.0F) * 0.6F;
    4737                this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (var17 ? par6 : 1.0F) * 0.6F;
    4738                this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (var17 ? par7 : 1.0F) * 0.6F;
    4739                this.colorRedTopLeft *= var9;
    4740                this.colorGreenTopLeft *= var9;
    4741                this.colorBlueTopLeft *= var9;
    4742                this.colorRedBottomLeft *= var10;
    4743                this.colorGreenBottomLeft *= var10;
    4744                this.colorBlueBottomLeft *= var10;
    4745                this.colorRedBottomRight *= var11;
    4746                this.colorGreenBottomRight *= var11;
    4747                this.colorBlueBottomRight *= var11;
    4748                this.colorRedTopRight *= var12;
    4749                this.colorGreenTopRight *= var12;
    4750                this.colorBlueTopRight *= var12;
    4751                var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
    4752                this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
    4753
    4754                if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
    4755                {
    4756                    this.colorRedTopLeft *= par5;
    4757                    this.colorRedBottomLeft *= par5;
    4758                    this.colorRedBottomRight *= par5;
    4759                    this.colorRedTopRight *= par5;
    4760                    this.colorGreenTopLeft *= par6;
    4761                    this.colorGreenBottomLeft *= par6;
    4762                    this.colorGreenBottomRight *= par6;
    4763                    this.colorGreenTopRight *= par6;
    4764                    this.colorBlueTopLeft *= par7;
    4765                    this.colorBlueBottomLeft *= par7;
    4766                    this.colorBlueBottomRight *= par7;
    4767                    this.colorBlueTopRight *= par7;
    4768                    this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    4769                }
    4770
    4771                var8 = true;
    4772            }
    4773
    4774            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5))
    4775            {
    4776                if (this.aoType > 0)
    4777                {
    4778                    if (par1Block.maxX >= 1.0D)
    4779                    {
    4780                        ++par2;
    4781                    }
    4782
    4783                    this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4);
    4784                    this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1);
    4785                    this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1);
    4786                    this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4);
    4787                    this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4);
    4788                    this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1);
    4789                    this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1);
    4790                    this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4);
    4791
    4792                    if (!this.aoGrassXYZPNC && !this.aoGrassXYZPCN)
    4793                    {
    4794                        this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
    4795                        this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
    4796                    }
    4797                    else
    4798                    {
    4799                        this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1);
    4800                        this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1);
    4801                    }
    4802
    4803                    if (!this.aoGrassXYZPNC && !this.aoGrassXYZPCP)
    4804                    {
    4805                        this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
    4806                        this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
    4807                    }
    4808                    else
    4809                    {
    4810                        this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1);
    4811                        this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1);
    4812                    }
    4813
    4814                    if (!this.aoGrassXYZPPC && !this.aoGrassXYZPCN)
    4815                    {
    4816                        this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
    4817                        this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
    4818                    }
    4819                    else
    4820                    {
    4821                        this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1);
    4822                        this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1);
    4823                    }
    4824
    4825                    if (!this.aoGrassXYZPPC && !this.aoGrassXYZPCP)
    4826                    {
    4827                        this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
    4828                        this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
    4829                    }
    4830                    else
    4831                    {
    4832                        this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1);
    4833                        this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1);
    4834                    }
    4835
    4836                    if (par1Block.maxX >= 1.0D)
    4837                    {
    4838                        --par2;
    4839                    }
    4840
    4841                    var9 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + this.aoLightValueXPos + this.aoLightValueScratchXZPP) / 4.0F;
    4842                    var12 = (this.aoLightValueXPos + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP) / 4.0F;
    4843                    var11 = (this.aoLightValueScratchXZPN + this.aoLightValueXPos + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F;
    4844                    var10 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + this.aoLightValueXPos) / 4.0F;
    4845                    this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var23);
    4846                    this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var23);
    4847                    this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var23);
    4848                    this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var23);
    4849                }
    4850                else
    4851                {
    4852                    var12 = this.aoLightValueXPos;
    4853                    var11 = this.aoLightValueXPos;
    4854                    var10 = this.aoLightValueXPos;
    4855                    var9 = this.aoLightValueXPos;
    4856                    this.brightnessTopLeft = this.brightnessBottomLeft = this.brightnessBottomRight = this.brightnessTopRight = var23;
    4857                }
    4858
    4859                this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = (var18 ? par5 : 1.0F) * 0.6F;
    4860                this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = (var18 ? par6 : 1.0F) * 0.6F;
    4861                this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = (var18 ? par7 : 1.0F) * 0.6F;
    4862                this.colorRedTopLeft *= var9;
    4863                this.colorGreenTopLeft *= var9;
    4864                this.colorBlueTopLeft *= var9;
    4865                this.colorRedBottomLeft *= var10;
    4866                this.colorGreenBottomLeft *= var10;
    4867                this.colorBlueBottomLeft *= var10;
    4868                this.colorRedBottomRight *= var11;
    4869                this.colorGreenBottomRight *= var11;
    4870                this.colorBlueBottomRight *= var11;
    4871                this.colorRedTopRight *= var12;
    4872                this.colorGreenTopRight *= var12;
    4873                this.colorBlueTopRight *= var12;
    4874                var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
    4875                this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
    4876
    4877                if (Tessellator.instance.defaultTexture && fancyGrass && var27 == 3 && this.overrideBlockTexture < 0)
    4878                {
    4879                    this.colorRedTopLeft *= par5;
    4880                    this.colorRedBottomLeft *= par5;
    4881                    this.colorRedBottomRight *= par5;
    4882                    this.colorRedTopRight *= par5;
    4883                    this.colorGreenTopLeft *= par6;
    4884                    this.colorGreenBottomLeft *= par6;
    4885                    this.colorGreenBottomRight *= par6;
    4886                    this.colorGreenTopRight *= par6;
    4887                    this.colorBlueTopLeft *= par7;
    4888                    this.colorBlueBottomLeft *= par7;
    4889                    this.colorBlueBottomRight *= par7;
    4890                    this.colorBlueTopRight *= par7;
    4891                    this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    4892                }
    4893
    4894                var8 = true;
    4895            }
    4896
    4897            this.enableAO = false;
    4898            return var8;
    4899        }
    4900
    4901        /**
    4902         * Get ambient occlusion brightness
    4903         */
    4904        public int getAoBrightness(int par1, int par2, int par3, int par4)
    4905        {
    4906            if (par1 == 0)
    4907            {
    4908                par1 = par4;
    4909            }
    4910
    4911            if (par2 == 0)
    4912            {
    4913                par2 = par4;
    4914            }
    4915
    4916            if (par3 == 0)
    4917            {
    4918                par3 = par4;
    4919            }
    4920
    4921            return par1 + par2 + par3 + par4 >> 2 & 16711935;
    4922        }
    4923
    4924        /**
    4925         * Renders a standard cube block at the given coordinates, with a given color ratio.  Args: block, x, y, z, r, g, b
    4926         */
    4927        public boolean renderStandardBlockWithColorMultiplier(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7)
    4928        {
    4929            this.enableAO = false;
    4930            Tessellator var8 = Tessellator.instance;
    4931            boolean var9 = false;
    4932            float var10 = 0.5F;
    4933            float var11 = 1.0F;
    4934            float var12 = 0.8F;
    4935            float var13 = 0.6F;
    4936            float var14 = var11 * par5;
    4937            float var15 = var11 * par6;
    4938            float var16 = var11 * par7;
    4939            float var17 = var10;
    4940            float var18 = var12;
    4941            float var19 = var13;
    4942            float var20 = var10;
    4943            float var21 = var12;
    4944            float var22 = var13;
    4945            float var23 = var10;
    4946            float var24 = var12;
    4947            float var25 = var13;
    4948
    4949            if (par1Block != Block.grass)
    4950            {
    4951                var17 = var10 * par5;
    4952                var18 = var12 * par5;
    4953                var19 = var13 * par5;
    4954                var20 = var10 * par6;
    4955                var21 = var12 * par6;
    4956                var22 = var13 * par6;
    4957                var23 = var10 * par7;
    4958                var24 = var12 * par7;
    4959                var25 = var13 * par7;
    4960            }
    4961
    4962            int var26 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4);
    4963
    4964            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0))
    4965            {
    4966                var8.setBrightness(par1Block.minY > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4));
    4967                var8.setColorOpaque_F(var17, var20, var23);
    4968                this.renderBottomFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0));
    4969                var9 = true;
    4970            }
    4971
    4972            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1))
    4973            {
    4974                var8.setBrightness(par1Block.maxY < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
    4975                var8.setColorOpaque_F(var14, var15, var16);
    4976                this.renderTopFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1));
    4977                var9 = true;
    4978            }
    4979
    4980            int var28;
    4981
    4982            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2))
    4983            {
    4984                var8.setBrightness(par1Block.minZ > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1));
    4985                var8.setColorOpaque_F(var18, var21, var24);
    4986                var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
    4987                this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
    4988
    4989                if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
    4990                {
    4991                    var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
    4992                    this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    4993                }
    4994
    4995                var9 = true;
    4996            }
    4997
    4998            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3))
    4999            {
    5000                var8.setBrightness(par1Block.maxZ < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1));
    5001                var8.setColorOpaque_F(var18, var21, var24);
    5002                var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
    5003                this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
    5004
    5005                if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
    5006                {
    5007                    var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
    5008                    this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    5009                }
    5010
    5011                var9 = true;
    5012            }
    5013
    5014            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4))
    5015            {
    5016                var8.setBrightness(par1Block.minX > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4));
    5017                var8.setColorOpaque_F(var19, var22, var25);
    5018                var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
    5019                this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
    5020
    5021                if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
    5022                {
    5023                    var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
    5024                    this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    5025                }
    5026
    5027                var9 = true;
    5028            }
    5029
    5030            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5))
    5031            {
    5032                var8.setBrightness(par1Block.maxX < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4));
    5033                var8.setColorOpaque_F(var19, var22, var25);
    5034                var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
    5035                this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
    5036
    5037                if (Tessellator.instance.defaultTexture && fancyGrass && var28 == 3 && this.overrideBlockTexture < 0)
    5038                {
    5039                    var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
    5040                    this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
    5041                }
    5042
    5043                var9 = true;
    5044            }
    5045
    5046            return var9;
    5047        }
    5048
    5049        /**
    5050         * Renders a Cocoa block at the given coordinates
    5051         */
    5052        public boolean renderBlockCocoa(BlockCocoa par1BlockCocoa, int par2, int par3, int par4)
    5053        {
    5054            Tessellator var5 = Tessellator.instance;
    5055            var5.setBrightness(par1BlockCocoa.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
    5056            var5.setColorOpaque_F(1.0F, 1.0F, 1.0F);
    5057            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    5058            int var7 = par1BlockCocoa.getBlockTextureFromSide(1);
    5059            int var8 = BlockDirectional.getDirection(var6);
    5060            int var9 = BlockCocoa.func_72219_c(var6);
    5061            var7 = var7 + 2 - var9;
    5062            int var10 = 4 + var9 * 2;
    5063            int var11 = 5 + var9 * 2;
    5064            int var12 = (var7 & 15) << 4;
    5065            int var13 = var7 & 240;
    5066            double var14 = 15.0D - (double)var10;
    5067            double var16 = 15.0D;
    5068            double var18 = 4.0D;
    5069            double var20 = 4.0D + (double)var11;
    5070            double var22 = ((double)var12 + var14) / 256.0D;
    5071            double var24 = ((double)var12 + var16 - 0.01D) / 256.0D;
    5072            double var26 = ((double)var13 + var18) / 256.0D;
    5073            double var28 = ((double)var13 + var20 - 0.01D) / 256.0D;
    5074            double var30 = 0.0D;
    5075            double var32 = 0.0D;
    5076
    5077            switch (var8)
    5078            {
    5079                case 0:
    5080                    var30 = 8.0D - (double)(var10 / 2);
    5081                    var32 = 15.0D - (double)var10;
    5082                    break;
    5083                case 1:
    5084                    var30 = 1.0D;
    5085                    var32 = 8.0D - (double)(var10 / 2);
    5086                    break;
    5087                case 2:
    5088                    var30 = 8.0D - (double)(var10 / 2);
    5089                    var32 = 1.0D;
    5090                    break;
    5091                case 3:
    5092                    var30 = 15.0D - (double)var10;
    5093                    var32 = 8.0D - (double)(var10 / 2);
    5094            }
    5095
    5096            double var34 = (double)par2 + var30 / 16.0D;
    5097            double var36 = (double)par2 + (var30 + (double)var10) / 16.0D;
    5098            double var38 = (double)par3 + (12.0D - (double)var11) / 16.0D;
    5099            double var40 = (double)par3 + 0.75D;
    5100            double var42 = (double)par4 + var32 / 16.0D;
    5101            double var44 = (double)par4 + (var32 + (double)var10) / 16.0D;
    5102            var5.addVertexWithUV(var34, var38, var42, var22, var28);
    5103            var5.addVertexWithUV(var34, var38, var44, var24, var28);
    5104            var5.addVertexWithUV(var34, var40, var44, var24, var26);
    5105            var5.addVertexWithUV(var34, var40, var42, var22, var26);
    5106            var5.addVertexWithUV(var36, var38, var44, var22, var28);
    5107            var5.addVertexWithUV(var36, var38, var42, var24, var28);
    5108            var5.addVertexWithUV(var36, var40, var42, var24, var26);
    5109            var5.addVertexWithUV(var36, var40, var44, var22, var26);
    5110            var5.addVertexWithUV(var36, var38, var42, var22, var28);
    5111            var5.addVertexWithUV(var34, var38, var42, var24, var28);
    5112            var5.addVertexWithUV(var34, var40, var42, var24, var26);
    5113            var5.addVertexWithUV(var36, var40, var42, var22, var26);
    5114            var5.addVertexWithUV(var34, var38, var44, var22, var28);
    5115            var5.addVertexWithUV(var36, var38, var44, var24, var28);
    5116            var5.addVertexWithUV(var36, var40, var44, var24, var26);
    5117            var5.addVertexWithUV(var34, var40, var44, var22, var26);
    5118            int var46 = var10;
    5119
    5120            if (var9 >= 2)
    5121            {
    5122                var46 = var10 - 1;
    5123            }
    5124
    5125            var22 = (double)((float)(var12 + 0) / 256.0F);
    5126            var24 = ((double)(var12 + var46) - 0.01D) / 256.0D;
    5127            var26 = (double)((float)(var13 + 0) / 256.0F);
    5128            var28 = ((double)(var13 + var46) - 0.01D) / 256.0D;
    5129            var5.addVertexWithUV(var34, var40, var44, var22, var28);
    5130            var5.addVertexWithUV(var36, var40, var44, var24, var28);
    5131            var5.addVertexWithUV(var36, var40, var42, var24, var26);
    5132            var5.addVertexWithUV(var34, var40, var42, var22, var26);
    5133            var5.addVertexWithUV(var34, var38, var42, var22, var26);
    5134            var5.addVertexWithUV(var36, var38, var42, var24, var26);
    5135            var5.addVertexWithUV(var36, var38, var44, var24, var28);
    5136            var5.addVertexWithUV(var34, var38, var44, var22, var28);
    5137            var22 = (double)((float)(var12 + 12) / 256.0F);
    5138            var24 = ((double)(var12 + 16) - 0.01D) / 256.0D;
    5139            var26 = (double)((float)(var13 + 0) / 256.0F);
    5140            var28 = ((double)(var13 + 4) - 0.01D) / 256.0D;
    5141            var30 = 8.0D;
    5142            var32 = 0.0D;
    5143            double var47;
    5144
    5145            switch (var8)
    5146            {
    5147                case 0:
    5148                    var30 = 8.0D;
    5149                    var32 = 12.0D;
    5150                    var47 = var22;
    5151                    var22 = var24;
    5152                    var24 = var47;
    5153                    break;
    5154                case 1:
    5155                    var30 = 0.0D;
    5156                    var32 = 8.0D;
    5157                    break;
    5158                case 2:
    5159                    var30 = 8.0D;
    5160                    var32 = 0.0D;
    5161                    break;
    5162                case 3:
    5163                    var30 = 12.0D;
    5164                    var32 = 8.0D;
    5165                    var47 = var22;
    5166                    var22 = var24;
    5167                    var24 = var47;
    5168            }
    5169
    5170            var34 = (double)par2 + var30 / 16.0D;
    5171            var36 = (double)par2 + (var30 + 4.0D) / 16.0D;
    5172            var38 = (double)par3 + 0.75D;
    5173            var40 = (double)par3 + 1.0D;
    5174            var42 = (double)par4 + var32 / 16.0D;
    5175            var44 = (double)par4 + (var32 + 4.0D) / 16.0D;
    5176
    5177            if (var8 != 2 && var8 != 0)
    5178            {
    5179                if (var8 == 1 || var8 == 3)
    5180                {
    5181                    var5.addVertexWithUV(var36, var38, var42, var22, var28);
    5182                    var5.addVertexWithUV(var34, var38, var42, var24, var28);
    5183                    var5.addVertexWithUV(var34, var40, var42, var24, var26);
    5184                    var5.addVertexWithUV(var36, var40, var42, var22, var26);
    5185                    var5.addVertexWithUV(var34, var38, var42, var24, var28);
    5186                    var5.addVertexWithUV(var36, var38, var42, var22, var28);
    5187                    var5.addVertexWithUV(var36, var40, var42, var22, var26);
    5188                    var5.addVertexWithUV(var34, var40, var42, var24, var26);
    5189                }
    5190            }
    5191            else
    5192            {
    5193                var5.addVertexWithUV(var34, var38, var42, var24, var28);
    5194                var5.addVertexWithUV(var34, var38, var44, var22, var28);
    5195                var5.addVertexWithUV(var34, var40, var44, var22, var26);
    5196                var5.addVertexWithUV(var34, var40, var42, var24, var26);
    5197                var5.addVertexWithUV(var34, var38, var44, var22, var28);
    5198                var5.addVertexWithUV(var34, var38, var42, var24, var28);
    5199                var5.addVertexWithUV(var34, var40, var42, var24, var26);
    5200                var5.addVertexWithUV(var34, var40, var44, var22, var26);
    5201            }
    5202
    5203            return true;
    5204        }
    5205
    5206        public boolean func_82778_a(BlockBeacon par1BlockBeacon, int par2, int par3, int par4)
    5207        {
    5208            float var5 = 0.1875F;
    5209            this.func_82774_a(Block.obsidian.blockIndexInTexture);
    5210            par1BlockBeacon.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, var5, 0.875F);
    5211            this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
    5212            this.func_82774_a(Block.glass.blockIndexInTexture);
    5213            par1BlockBeacon.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    5214            this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
    5215            this.func_82774_a(41);
    5216            par1BlockBeacon.setBlockBounds(0.1875F, var5, 0.1875F, 0.8125F, 0.875F, 0.8125F);
    5217            this.renderStandardBlock(par1BlockBeacon, par2, par3, par4);
    5218            this.clearOverrideBlockTexture();
    5219            return true;
    5220        }
    5221
    5222        /**
    5223         * Renders a cactus block at the given coordinates
    5224         */
    5225        public boolean renderBlockCactus(Block par1Block, int par2, int par3, int par4)
    5226        {
    5227            int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4);
    5228            float var6 = (float)(var5 >> 16 & 255) / 255.0F;
    5229            float var7 = (float)(var5 >> 8 & 255) / 255.0F;
    5230            float var8 = (float)(var5 & 255) / 255.0F;
    5231
    5232            if (EntityRenderer.anaglyphEnable)
    5233            {
    5234                float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F;
    5235                float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F;
    5236                float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F;
    5237                var6 = var9;
    5238                var7 = var10;
    5239                var8 = var11;
    5240            }
    5241
    5242            return this.renderBlockCactusImpl(par1Block, par2, par3, par4, var6, var7, var8);
    5243        }
    5244
    5245        /**
    5246         * Render block cactus implementation
    5247         */
    5248        public boolean renderBlockCactusImpl(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7)
    5249        {
    5250            Tessellator var8 = Tessellator.instance;
    5251            boolean var9 = false;
    5252            float var10 = 0.5F;
    5253            float var11 = 1.0F;
    5254            float var12 = 0.8F;
    5255            float var13 = 0.6F;
    5256            float var14 = var10 * par5;
    5257            float var15 = var11 * par5;
    5258            float var16 = var12 * par5;
    5259            float var17 = var13 * par5;
    5260            float var18 = var10 * par6;
    5261            float var19 = var11 * par6;
    5262            float var20 = var12 * par6;
    5263            float var21 = var13 * par6;
    5264            float var22 = var10 * par7;
    5265            float var23 = var11 * par7;
    5266            float var24 = var12 * par7;
    5267            float var25 = var13 * par7;
    5268            float var26 = 0.0625F;
    5269            int var28 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4);
    5270
    5271            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0))
    5272            {
    5273                var8.setBrightness(par1Block.minY > 0.0D ? var28 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4));
    5274                var8.setColorOpaque_F(var14, var18, var22);
    5275                this.renderBottomFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0));
    5276                var9 = true;
    5277            }
    5278
    5279            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1))
    5280            {
    5281                var8.setBrightness(par1Block.maxY < 1.0D ? var28 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
    5282                var8.setColorOpaque_F(var15, var19, var23);
    5283                this.renderTopFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1));
    5284                var9 = true;
    5285            }
    5286
    5287            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 - 1, 2))
    5288            {
    5289                var8.setBrightness(par1Block.minZ > 0.0D ? var28 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1));
    5290                var8.setColorOpaque_F(var16, var20, var24);
    5291                var8.addTranslation(0.0F, 0.0F, var26);
    5292                this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2));
    5293                var8.addTranslation(0.0F, 0.0F, -var26);
    5294                var9 = true;
    5295            }
    5296
    5297            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2, par3, par4 + 1, 3))
    5298            {
    5299                var8.setBrightness(par1Block.maxZ < 1.0D ? var28 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1));
    5300                var8.setColorOpaque_F(var16, var20, var24);
    5301                var8.addTranslation(0.0F, 0.0F, -var26);
    5302                this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
    5303                var8.addTranslation(0.0F, 0.0F, var26);
    5304                var9 = true;
    5305            }
    5306
    5307            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 - 1, par3, par4, 4))
    5308            {
    5309                var8.setBrightness(par1Block.minX > 0.0D ? var28 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4));
    5310                var8.setColorOpaque_F(var17, var21, var25);
    5311                var8.addTranslation(var26, 0.0F, 0.0F);
    5312                this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4));
    5313                var8.addTranslation(-var26, 0.0F, 0.0F);
    5314                var9 = true;
    5315            }
    5316
    5317            if (this.renderAllFaces || par1Block.shouldSideBeRendered(this.blockAccess, par2 + 1, par3, par4, 5))
    5318            {
    5319                var8.setBrightness(par1Block.maxX < 1.0D ? var28 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4));
    5320                var8.setColorOpaque_F(var17, var21, var25);
    5321                var8.addTranslation(-var26, 0.0F, 0.0F);
    5322                this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5));
    5323                var8.addTranslation(var26, 0.0F, 0.0F);
    5324                var9 = true;
    5325            }
    5326
    5327            return var9;
    5328        }
    5329
    5330        public boolean renderBlockFence(BlockFence par1BlockFence, int par2, int par3, int par4)
    5331        {
    5332            boolean var5 = false;
    5333            float var6 = 0.375F;
    5334            float var7 = 0.625F;
    5335            par1BlockFence.setBlockBounds(var6, 0.0F, var6, var7, 1.0F, var7);
    5336            this.renderStandardBlock(par1BlockFence, par2, par3, par4);
    5337            var5 = true;
    5338            boolean var8 = false;
    5339            boolean var9 = false;
    5340
    5341            if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4))
    5342            {
    5343                var8 = true;
    5344            }
    5345
    5346            if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1))
    5347            {
    5348                var9 = true;
    5349            }
    5350
    5351            boolean var10 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4);
    5352            boolean var11 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4);
    5353            boolean var12 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1);
    5354            boolean var13 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1);
    5355
    5356            if (!var8 && !var9)
    5357            {
    5358                var8 = true;
    5359            }
    5360
    5361            var6 = 0.4375F;
    5362            var7 = 0.5625F;
    5363            float var14 = 0.75F;
    5364            float var15 = 0.9375F;
    5365            float var16 = var10 ? 0.0F : var6;
    5366            float var17 = var11 ? 1.0F : var7;
    5367            float var18 = var12 ? 0.0F : var6;
    5368            float var19 = var13 ? 1.0F : var7;
    5369
    5370            if (var8)
    5371            {
    5372                par1BlockFence.setBlockBounds(var16, var14, var6, var17, var15, var7);
    5373                this.renderStandardBlock(par1BlockFence, par2, par3, par4);
    5374                var5 = true;
    5375            }
    5376
    5377            if (var9)
    5378            {
    5379                par1BlockFence.setBlockBounds(var6, var14, var18, var7, var15, var19);
    5380                this.renderStandardBlock(par1BlockFence, par2, par3, par4);
    5381                var5 = true;
    5382            }
    5383
    5384            var14 = 0.375F;
    5385            var15 = 0.5625F;
    5386
    5387            if (var8)
    5388            {
    5389                par1BlockFence.setBlockBounds(var16, var14, var6, var17, var15, var7);
    5390                this.renderStandardBlock(par1BlockFence, par2, par3, par4);
    5391                var5 = true;
    5392            }
    5393
    5394            if (var9)
    5395            {
    5396                par1BlockFence.setBlockBounds(var6, var14, var18, var7, var15, var19);
    5397                this.renderStandardBlock(par1BlockFence, par2, par3, par4);
    5398                var5 = true;
    5399            }
    5400
    5401            par1BlockFence.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4);
    5402            return var5;
    5403        }
    5404
    5405        public boolean func_82779_a(BlockWall par1BlockWall, int par2, int par3, int par4)
    5406        {
    5407            boolean var5 = par1BlockWall.func_82538_d(this.blockAccess, par2 - 1, par3, par4);
    5408            boolean var6 = par1BlockWall.func_82538_d(this.blockAccess, par2 + 1, par3, par4);
    5409            boolean var7 = par1BlockWall.func_82538_d(this.blockAccess, par2, par3, par4 - 1);
    5410            boolean var8 = par1BlockWall.func_82538_d(this.blockAccess, par2, par3, par4 + 1);
    5411            boolean var9 = var7 && var8 && !var5 && !var6;
    5412            boolean var10 = !var7 && !var8 && var5 && var6;
    5413            boolean var11 = this.blockAccess.isAirBlock(par2, par3 + 1, par4);
    5414
    5415            if ((var9 || var10) && var11)
    5416            {
    5417                if (var9)
    5418                {
    5419                    par1BlockWall.setBlockBounds(0.3125F, 0.0F, 0.0F, 0.6875F, 0.8125F, 1.0F);
    5420                    this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5421                }
    5422                else
    5423                {
    5424                    par1BlockWall.setBlockBounds(0.0F, 0.0F, 0.3125F, 1.0F, 0.8125F, 0.6875F);
    5425                    this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5426                }
    5427            }
    5428            else
    5429            {
    5430                par1BlockWall.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
    5431                this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5432
    5433                if (var5)
    5434                {
    5435                    par1BlockWall.setBlockBounds(0.0F, 0.0F, 0.3125F, 0.25F, 0.8125F, 0.6875F);
    5436                    this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5437                }
    5438
    5439                if (var6)
    5440                {
    5441                    par1BlockWall.setBlockBounds(0.75F, 0.0F, 0.3125F, 1.0F, 0.8125F, 0.6875F);
    5442                    this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5443                }
    5444
    5445                if (var7)
    5446                {
    5447                    par1BlockWall.setBlockBounds(0.3125F, 0.0F, 0.0F, 0.6875F, 0.8125F, 0.25F);
    5448                    this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5449                }
    5450
    5451                if (var8)
    5452                {
    5453                    par1BlockWall.setBlockBounds(0.3125F, 0.0F, 0.75F, 0.6875F, 0.8125F, 1.0F);
    5454                    this.renderStandardBlock(par1BlockWall, par2, par3, par4);
    5455                }
    5456            }
    5457
    5458            par1BlockWall.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4);
    5459            return true;
    5460        }
    5461
    5462        public boolean renderBlockDragonEgg(BlockDragonEgg par1BlockDragonEgg, int par2, int par3, int par4)
    5463        {
    5464            boolean var5 = false;
    5465            int var6 = 0;
    5466
    5467            for (int var7 = 0; var7 < 8; ++var7)
    5468            {
    5469                byte var8 = 0;
    5470                byte var9 = 1;
    5471
    5472                if (var7 == 0)
    5473                {
    5474                    var8 = 2;
    5475                }
    5476
    5477                if (var7 == 1)
    5478                {
    5479                    var8 = 3;
    5480                }
    5481
    5482                if (var7 == 2)
    5483                {
    5484                    var8 = 4;
    5485                }
    5486
    5487                if (var7 == 3)
    5488                {
    5489                    var8 = 5;
    5490                    var9 = 2;
    5491                }
    5492
    5493                if (var7 == 4)
    5494                {
    5495                    var8 = 6;
    5496                    var9 = 3;
    5497                }
    5498
    5499                if (var7 == 5)
    5500                {
    5501                    var8 = 7;
    5502                    var9 = 5;
    5503                }
    5504
    5505                if (var7 == 6)
    5506                {
    5507                    var8 = 6;
    5508                    var9 = 2;
    5509                }
    5510
    5511                if (var7 == 7)
    5512                {
    5513                    var8 = 3;
    5514                }
    5515
    5516                float var10 = (float)var8 / 16.0F;
    5517                float var11 = 1.0F - (float)var6 / 16.0F;
    5518                float var12 = 1.0F - (float)(var6 + var9) / 16.0F;
    5519                var6 += var9;
    5520                par1BlockDragonEgg.setBlockBounds(0.5F - var10, var12, 0.5F - var10, 0.5F + var10, var11, 0.5F + var10);
    5521                this.renderStandardBlock(par1BlockDragonEgg, par2, par3, par4);
    5522            }
    5523
    5524            var5 = true;
    5525            par1BlockDragonEgg.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    5526            return var5;
    5527        }
    5528
    5529        /**
    5530         * Render block fence gate
    5531         */
    5532        public boolean renderBlockFenceGate(BlockFenceGate par1BlockFenceGate, int par2, int par3, int par4)
    5533        {
    5534            boolean var5 = true;
    5535            int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
    5536            boolean var7 = BlockFenceGate.isFenceGateOpen(var6);
    5537            int var8 = BlockDirectional.getDirection(var6);
    5538            float var9 = 0.375F;
    5539            float var10 = 0.5625F;
    5540            float var11 = 0.75F;
    5541            float var12 = 0.9375F;
    5542            float var13 = 0.3125F;
    5543            float var14 = 1.0F;
    5544
    5545            if ((var8 == 2 || var8 == 0) && this.blockAccess.getBlockId(par2 - 1, par3, par4) == Block.field_82515_ce.blockID && this.blockAccess.getBlockId(par2 + 1, par3, par4) == Block.field_82515_ce.blockID || (var8 == 3 || var8 == 1) && this.blockAccess.getBlockId(par2, par3, par4 - 1) == Block.field_82515_ce.blockID && this.blockAccess.getBlockId(par2, par3, par4 + 1) == Block.field_82515_ce.blockID)
    5546            {
    5547                var9 -= 0.1875F;
    5548                var10 -= 0.1875F;
    5549                var11 -= 0.1875F;
    5550                var12 -= 0.1875F;
    5551                var13 -= 0.1875F;
    5552                var14 -= 0.1875F;
    5553            }
    5554
    5555            float var15;
    5556            float var17;
    5557            float var16;
    5558            float var18;
    5559
    5560            if (var8 != 3 && var8 != 1)
    5561            {
    5562                var15 = 0.0F;
    5563                var16 = 0.125F;
    5564                var17 = 0.4375F;
    5565                var18 = 0.5625F;
    5566                par1BlockFenceGate.setBlockBounds(var15, var13, var17, var16, var14, var18);
    5567                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5568                var15 = 0.875F;
    5569                var16 = 1.0F;
    5570                par1BlockFenceGate.setBlockBounds(var15, var13, var17, var16, var14, var18);
    5571                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5572            }
    5573            else
    5574            {
    5575                var15 = 0.4375F;
    5576                var16 = 0.5625F;
    5577                var17 = 0.0F;
    5578                var18 = 0.125F;
    5579                par1BlockFenceGate.setBlockBounds(var15, var13, var17, var16, var14, var18);
    5580                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5581                var17 = 0.875F;
    5582                var18 = 1.0F;
    5583                par1BlockFenceGate.setBlockBounds(var15, var13, var17, var16, var14, var18);
    5584                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5585            }
    5586
    5587            if (var7)
    5588            {
    5589                if (var8 == 3)
    5590                {
    5591                    par1BlockFenceGate.setBlockBounds(0.8125F, var9, 0.0F, 0.9375F, var12, 0.125F);
    5592                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5593                    par1BlockFenceGate.setBlockBounds(0.8125F, var9, 0.875F, 0.9375F, var12, 1.0F);
    5594                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5595                    par1BlockFenceGate.setBlockBounds(0.5625F, var9, 0.0F, 0.8125F, var10, 0.125F);
    5596                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5597                    par1BlockFenceGate.setBlockBounds(0.5625F, var9, 0.875F, 0.8125F, var10, 1.0F);
    5598                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5599                    par1BlockFenceGate.setBlockBounds(0.5625F, var11, 0.0F, 0.8125F, var12, 0.125F);
    5600                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5601                    par1BlockFenceGate.setBlockBounds(0.5625F, var11, 0.875F, 0.8125F, var12, 1.0F);
    5602                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5603                }
    5604                else if (var8 == 1)
    5605                {
    5606                    par1BlockFenceGate.setBlockBounds(0.0625F, var9, 0.0F, 0.1875F, var12, 0.125F);
    5607                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5608                    par1BlockFenceGate.setBlockBounds(0.0625F, var9, 0.875F, 0.1875F, var12, 1.0F);
    5609                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5610                    par1BlockFenceGate.setBlockBounds(0.1875F, var9, 0.0F, 0.4375F, var10, 0.125F);
    5611                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5612                    par1BlockFenceGate.setBlockBounds(0.1875F, var9, 0.875F, 0.4375F, var10, 1.0F);
    5613                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5614                    par1BlockFenceGate.setBlockBounds(0.1875F, var11, 0.0F, 0.4375F, var12, 0.125F);
    5615                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5616                    par1BlockFenceGate.setBlockBounds(0.1875F, var11, 0.875F, 0.4375F, var12, 1.0F);
    5617                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5618                }
    5619                else if (var8 == 0)
    5620                {
    5621                    par1BlockFenceGate.setBlockBounds(0.0F, var9, 0.8125F, 0.125F, var12, 0.9375F);
    5622                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5623                    par1BlockFenceGate.setBlockBounds(0.875F, var9, 0.8125F, 1.0F, var12, 0.9375F);
    5624                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5625                    par1BlockFenceGate.setBlockBounds(0.0F, var9, 0.5625F, 0.125F, var10, 0.8125F);
    5626                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5627                    par1BlockFenceGate.setBlockBounds(0.875F, var9, 0.5625F, 1.0F, var10, 0.8125F);
    5628                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5629                    par1BlockFenceGate.setBlockBounds(0.0F, var11, 0.5625F, 0.125F, var12, 0.8125F);
    5630                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5631                    par1BlockFenceGate.setBlockBounds(0.875F, var11, 0.5625F, 1.0F, var12, 0.8125F);
    5632                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5633                }
    5634                else if (var8 == 2)
    5635                {
    5636                    par1BlockFenceGate.setBlockBounds(0.0F, var9, 0.0625F, 0.125F, var12, 0.1875F);
    5637                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5638                    par1BlockFenceGate.setBlockBounds(0.875F, var9, 0.0625F, 1.0F, var12, 0.1875F);
    5639                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5640                    par1BlockFenceGate.setBlockBounds(0.0F, var9, 0.1875F, 0.125F, var10, 0.4375F);
    5641                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5642                    par1BlockFenceGate.setBlockBounds(0.875F, var9, 0.1875F, 1.0F, var10, 0.4375F);
    5643                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5644                    par1BlockFenceGate.setBlockBounds(0.0F, var11, 0.1875F, 0.125F, var12, 0.4375F);
    5645                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5646                    par1BlockFenceGate.setBlockBounds(0.875F, var11, 0.1875F, 1.0F, var12, 0.4375F);
    5647                    this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5648                }
    5649            }
    5650            else if (var8 != 3 && var8 != 1)
    5651            {
    5652                var15 = 0.375F;
    5653                var16 = 0.5F;
    5654                var17 = 0.4375F;
    5655                var18 = 0.5625F;
    5656                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var12, var18);
    5657                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5658                var15 = 0.5F;
    5659                var16 = 0.625F;
    5660                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var12, var18);
    5661                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5662                var15 = 0.625F;
    5663                var16 = 0.875F;
    5664                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var10, var18);
    5665                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5666                par1BlockFenceGate.setBlockBounds(var15, var11, var17, var16, var12, var18);
    5667                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5668                var15 = 0.125F;
    5669                var16 = 0.375F;
    5670                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var10, var18);
    5671                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5672                par1BlockFenceGate.setBlockBounds(var15, var11, var17, var16, var12, var18);
    5673                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5674            }
    5675            else
    5676            {
    5677                var15 = 0.4375F;
    5678                var16 = 0.5625F;
    5679                var17 = 0.375F;
    5680                var18 = 0.5F;
    5681                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var12, var18);
    5682                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5683                var17 = 0.5F;
    5684                var18 = 0.625F;
    5685                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var12, var18);
    5686                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5687                var17 = 0.625F;
    5688                var18 = 0.875F;
    5689                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var10, var18);
    5690                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5691                par1BlockFenceGate.setBlockBounds(var15, var11, var17, var16, var12, var18);
    5692                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5693                var17 = 0.125F;
    5694                var18 = 0.375F;
    5695                par1BlockFenceGate.setBlockBounds(var15, var9, var17, var16, var10, var18);
    5696                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5697                par1BlockFenceGate.setBlockBounds(var15, var11, var17, var16, var12, var18);
    5698                this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4);
    5699            }
    5700
    5701            par1BlockFenceGate.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    5702            return var5;
    5703        }
    5704
    5705        /**
    5706         * Renders a stair block at the given coordinates
    5707         */
    5708        public boolean renderBlockStairs(BlockStairs par1BlockStairs, int par2, int par3, int par4)
    5709        {
    5710            par1BlockStairs.func_82541_d(this.blockAccess, par2, par3, par4);
    5711            this.renderStandardBlock(par1BlockStairs, par2, par3, par4);
    5712            boolean var5 = par1BlockStairs.func_82542_g(this.blockAccess, par2, par3, par4);
    5713            this.renderStandardBlock(par1BlockStairs, par2, par3, par4);
    5714
    5715            if (var5 && par1BlockStairs.func_82544_h(this.blockAccess, par2, par3, par4))
    5716            {
    5717                this.renderStandardBlock(par1BlockStairs, par2, par3, par4);
    5718            }
    5719
    5720            return true;
    5721        }
    5722
    5723        /**
    5724         * Renders a door block at the given coordinates
    5725         */
    5726        public boolean renderBlockDoor(Block par1Block, int par2, int par3, int par4)
    5727        {
    5728            Tessellator var5 = Tessellator.instance;
    5729            BlockDoor var6 = (BlockDoor)par1Block;
    5730            boolean var7 = false;
    5731            float var8 = 0.5F;
    5732            float var9 = 1.0F;
    5733            float var10 = 0.8F;
    5734            float var11 = 0.6F;
    5735            int var12 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4);
    5736            var5.setBrightness(par1Block.minY > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4));
    5737            var5.setColorOpaque_F(var8, var8, var8);
    5738            this.renderBottomFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0));
    5739            var7 = true;
    5740            var5.setBrightness(par1Block.maxY < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
    5741            var5.setColorOpaque_F(var9, var9, var9);
    5742            this.renderTopFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1));
    5743            var7 = true;
    5744            var5.setBrightness(par1Block.minZ > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1));
    5745            var5.setColorOpaque_F(var10, var10, var10);
    5746            int var14 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
    5747
    5748            if (var14 < 0)
    5749            {
    5750                this.flipTexture = true;
    5751                var14 = -var14;
    5752            }
    5753
    5754            this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var14);
    5755            var7 = true;
    5756            this.flipTexture = false;
    5757            var5.setBrightness(par1Block.maxZ < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1));
    5758            var5.setColorOpaque_F(var10, var10, var10);
    5759            var14 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
    5760
    5761            if (var14 < 0)
    5762            {
    5763                this.flipTexture = true;
    5764                var14 = -var14;
    5765            }
    5766
    5767            this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var14);
    5768            var7 = true;
    5769            this.flipTexture = false;
    5770            var5.setBrightness(par1Block.minX > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4));
    5771            var5.setColorOpaque_F(var11, var11, var11);
    5772            var14 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
    5773
    5774            if (var14 < 0)
    5775            {
    5776                this.flipTexture = true;
    5777                var14 = -var14;
    5778            }
    5779
    5780            this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var14);
    5781            var7 = true;
    5782            this.flipTexture = false;
    5783            var5.setBrightness(par1Block.maxX < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4));
    5784            var5.setColorOpaque_F(var11, var11, var11);
    5785            var14 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
    5786
    5787            if (var14 < 0)
    5788            {
    5789                this.flipTexture = true;
    5790                var14 = -var14;
    5791            }
    5792
    5793            this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var14);
    5794            var7 = true;
    5795            this.flipTexture = false;
    5796            return var7;
    5797        }
    5798
    5799        /**
    5800         * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture
    5801         */
    5802        public void renderBottomFace(Block par1Block, double par2, double par4, double par6, int par8)
    5803        {
    5804            Tessellator var9 = Tessellator.instance;
    5805
    5806            if (this.overrideBlockTexture >= 0)
    5807            {
    5808                par8 = this.overrideBlockTexture;
    5809            }
    5810
    5811            int var10 = (par8 & 15) << 4;
    5812            int var11 = par8 & 240;
    5813            double var12 = ((double)var10 + par1Block.minX * 16.0D) / 256.0D;
    5814            double var14 = ((double)var10 + par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    5815            double var16 = ((double)var11 + par1Block.minZ * 16.0D) / 256.0D;
    5816            double var18 = ((double)var11 + par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    5817
    5818            if (par1Block.minX < 0.0D || par1Block.maxX > 1.0D)
    5819            {
    5820                var12 = (double)(((float)var10 + 0.0F) / 256.0F);
    5821                var14 = (double)(((float)var10 + 15.99F) / 256.0F);
    5822            }
    5823
    5824            if (par1Block.minZ < 0.0D || par1Block.maxZ > 1.0D)
    5825            {
    5826                var16 = (double)(((float)var11 + 0.0F) / 256.0F);
    5827                var18 = (double)(((float)var11 + 15.99F) / 256.0F);
    5828            }
    5829
    5830            double var20 = var14;
    5831            double var22 = var12;
    5832            double var24 = var16;
    5833            double var26 = var18;
    5834
    5835            if (this.uvRotateBottom == 2)
    5836            {
    5837                var12 = ((double)var10 + par1Block.minZ * 16.0D) / 256.0D;
    5838                var16 = ((double)(var11 + 16) - par1Block.maxX * 16.0D) / 256.0D;
    5839                var14 = ((double)var10 + par1Block.maxZ * 16.0D) / 256.0D;
    5840                var18 = ((double)(var11 + 16) - par1Block.minX * 16.0D) / 256.0D;
    5841                var24 = var16;
    5842                var26 = var18;
    5843                var20 = var12;
    5844                var22 = var14;
    5845                var16 = var18;
    5846                var18 = var24;
    5847            }
    5848            else if (this.uvRotateBottom == 1)
    5849            {
    5850                var12 = ((double)(var10 + 16) - par1Block.maxZ * 16.0D) / 256.0D;
    5851                var16 = ((double)var11 + par1Block.minX * 16.0D) / 256.0D;
    5852                var14 = ((double)(var10 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    5853                var18 = ((double)var11 + par1Block.maxX * 16.0D) / 256.0D;
    5854                var20 = var14;
    5855                var22 = var12;
    5856                var12 = var14;
    5857                var14 = var22;
    5858                var24 = var18;
    5859                var26 = var16;
    5860            }
    5861            else if (this.uvRotateBottom == 3)
    5862            {
    5863                var12 = ((double)(var10 + 16) - par1Block.minX * 16.0D) / 256.0D;
    5864                var14 = ((double)(var10 + 16) - par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    5865                var16 = ((double)(var11 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    5866                var18 = ((double)(var11 + 16) - par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    5867                var20 = var14;
    5868                var22 = var12;
    5869                var24 = var16;
    5870                var26 = var18;
    5871            }
    5872
    5873            double var28 = par2 + par1Block.minX;
    5874            double var30 = par2 + par1Block.maxX;
    5875            double var32 = par4 + par1Block.minY;
    5876            double var34 = par6 + par1Block.minZ;
    5877            double var36 = par6 + par1Block.maxZ;
    5878
    5879            if (this.enableAO)
    5880            {
    5881                var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft);
    5882                var9.setBrightness(this.brightnessTopLeft);
    5883                var9.addVertexWithUV(var28, var32, var36, var22, var26);
    5884                var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft);
    5885                var9.setBrightness(this.brightnessBottomLeft);
    5886                var9.addVertexWithUV(var28, var32, var34, var12, var16);
    5887                var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight);
    5888                var9.setBrightness(this.brightnessBottomRight);
    5889                var9.addVertexWithUV(var30, var32, var34, var20, var24);
    5890                var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight);
    5891                var9.setBrightness(this.brightnessTopRight);
    5892                var9.addVertexWithUV(var30, var32, var36, var14, var18);
    5893            }
    5894            else
    5895            {
    5896                var9.addVertexWithUV(var28, var32, var36, var22, var26);
    5897                var9.addVertexWithUV(var28, var32, var34, var12, var16);
    5898                var9.addVertexWithUV(var30, var32, var34, var20, var24);
    5899                var9.addVertexWithUV(var30, var32, var36, var14, var18);
    5900            }
    5901        }
    5902
    5903        /**
    5904         * Renders the given texture to the top face of the block. Args: block, x, y, z, texture
    5905         */
    5906        public void renderTopFace(Block par1Block, double par2, double par4, double par6, int par8)
    5907        {
    5908            Tessellator var9 = Tessellator.instance;
    5909
    5910            if (this.overrideBlockTexture >= 0)
    5911            {
    5912                par8 = this.overrideBlockTexture;
    5913            }
    5914
    5915            int var10 = (par8 & 15) << 4;
    5916            int var11 = par8 & 240;
    5917            double var12 = ((double)var10 + par1Block.minX * 16.0D) / 256.0D;
    5918            double var14 = ((double)var10 + par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    5919            double var16 = ((double)var11 + par1Block.minZ * 16.0D) / 256.0D;
    5920            double var18 = ((double)var11 + par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    5921
    5922            if (par1Block.minX < 0.0D || par1Block.maxX > 1.0D)
    5923            {
    5924                var12 = (double)(((float)var10 + 0.0F) / 256.0F);
    5925                var14 = (double)(((float)var10 + 15.99F) / 256.0F);
    5926            }
    5927
    5928            if (par1Block.minZ < 0.0D || par1Block.maxZ > 1.0D)
    5929            {
    5930                var16 = (double)(((float)var11 + 0.0F) / 256.0F);
    5931                var18 = (double)(((float)var11 + 15.99F) / 256.0F);
    5932            }
    5933
    5934            double var20 = var14;
    5935            double var22 = var12;
    5936            double var24 = var16;
    5937            double var26 = var18;
    5938
    5939            if (this.uvRotateTop == 1)
    5940            {
    5941                var12 = ((double)var10 + par1Block.minZ * 16.0D) / 256.0D;
    5942                var16 = ((double)(var11 + 16) - par1Block.maxX * 16.0D) / 256.0D;
    5943                var14 = ((double)var10 + par1Block.maxZ * 16.0D) / 256.0D;
    5944                var18 = ((double)(var11 + 16) - par1Block.minX * 16.0D) / 256.0D;
    5945                var24 = var16;
    5946                var26 = var18;
    5947                var20 = var12;
    5948                var22 = var14;
    5949                var16 = var18;
    5950                var18 = var24;
    5951            }
    5952            else if (this.uvRotateTop == 2)
    5953            {
    5954                var12 = ((double)(var10 + 16) - par1Block.maxZ * 16.0D) / 256.0D;
    5955                var16 = ((double)var11 + par1Block.minX * 16.0D) / 256.0D;
    5956                var14 = ((double)(var10 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    5957                var18 = ((double)var11 + par1Block.maxX * 16.0D) / 256.0D;
    5958                var20 = var14;
    5959                var22 = var12;
    5960                var12 = var14;
    5961                var14 = var22;
    5962                var24 = var18;
    5963                var26 = var16;
    5964            }
    5965            else if (this.uvRotateTop == 3)
    5966            {
    5967                var12 = ((double)(var10 + 16) - par1Block.minX * 16.0D) / 256.0D;
    5968                var14 = ((double)(var10 + 16) - par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    5969                var16 = ((double)(var11 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    5970                var18 = ((double)(var11 + 16) - par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    5971                var20 = var14;
    5972                var22 = var12;
    5973                var24 = var16;
    5974                var26 = var18;
    5975            }
    5976
    5977            double var28 = par2 + par1Block.minX;
    5978            double var30 = par2 + par1Block.maxX;
    5979            double var32 = par4 + par1Block.maxY;
    5980            double var34 = par6 + par1Block.minZ;
    5981            double var36 = par6 + par1Block.maxZ;
    5982
    5983            if (this.enableAO)
    5984            {
    5985                var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft);
    5986                var9.setBrightness(this.brightnessTopLeft);
    5987                var9.addVertexWithUV(var30, var32, var36, var14, var18);
    5988                var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft);
    5989                var9.setBrightness(this.brightnessBottomLeft);
    5990                var9.addVertexWithUV(var30, var32, var34, var20, var24);
    5991                var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight);
    5992                var9.setBrightness(this.brightnessBottomRight);
    5993                var9.addVertexWithUV(var28, var32, var34, var12, var16);
    5994                var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight);
    5995                var9.setBrightness(this.brightnessTopRight);
    5996                var9.addVertexWithUV(var28, var32, var36, var22, var26);
    5997            }
    5998            else
    5999            {
    6000                var9.addVertexWithUV(var30, var32, var36, var14, var18);
    6001                var9.addVertexWithUV(var30, var32, var34, var20, var24);
    6002                var9.addVertexWithUV(var28, var32, var34, var12, var16);
    6003                var9.addVertexWithUV(var28, var32, var36, var22, var26);
    6004            }
    6005        }
    6006
    6007        /**
    6008         * Renders the given texture to the east (z-negative) face of the block.  Args: block, x, y, z, texture
    6009         */
    6010        public void renderEastFace(Block par1Block, double par2, double par4, double par6, int par8)
    6011        {
    6012            Tessellator var9 = Tessellator.instance;
    6013
    6014            if (this.overrideBlockTexture >= 0)
    6015            {
    6016                par8 = this.overrideBlockTexture;
    6017            }
    6018
    6019            int var10 = (par8 & 15) << 4;
    6020            int var11 = par8 & 240;
    6021            double var12 = ((double)var10 + par1Block.minX * 16.0D) / 256.0D;
    6022            double var14 = ((double)var10 + par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    6023            double var16 = ((double)(var11 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6024            double var18 = ((double)(var11 + 16) - par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6025            double var20;
    6026
    6027            if (this.flipTexture)
    6028            {
    6029                var20 = var12;
    6030                var12 = var14;
    6031                var14 = var20;
    6032            }
    6033
    6034            if (par1Block.minX < 0.0D || par1Block.maxX > 1.0D)
    6035            {
    6036                var12 = (double)(((float)var10 + 0.0F) / 256.0F);
    6037                var14 = (double)(((float)var10 + 15.99F) / 256.0F);
    6038            }
    6039
    6040            if (par1Block.minY < 0.0D || par1Block.maxY > 1.0D)
    6041            {
    6042                var16 = (double)(((float)var11 + 0.0F) / 256.0F);
    6043                var18 = (double)(((float)var11 + 15.99F) / 256.0F);
    6044            }
    6045
    6046            var20 = var14;
    6047            double var22 = var12;
    6048            double var24 = var16;
    6049            double var26 = var18;
    6050
    6051            if (this.uvRotateEast == 2)
    6052            {
    6053                var12 = ((double)var10 + par1Block.minY * 16.0D) / 256.0D;
    6054                var16 = ((double)(var11 + 16) - par1Block.minX * 16.0D) / 256.0D;
    6055                var14 = ((double)var10 + par1Block.maxY * 16.0D) / 256.0D;
    6056                var18 = ((double)(var11 + 16) - par1Block.maxX * 16.0D) / 256.0D;
    6057                var24 = var16;
    6058                var26 = var18;
    6059                var20 = var12;
    6060                var22 = var14;
    6061                var16 = var18;
    6062                var18 = var24;
    6063            }
    6064            else if (this.uvRotateEast == 1)
    6065            {
    6066                var12 = ((double)(var10 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6067                var16 = ((double)var11 + par1Block.maxX * 16.0D) / 256.0D;
    6068                var14 = ((double)(var10 + 16) - par1Block.minY * 16.0D) / 256.0D;
    6069                var18 = ((double)var11 + par1Block.minX * 16.0D) / 256.0D;
    6070                var20 = var14;
    6071                var22 = var12;
    6072                var12 = var14;
    6073                var14 = var22;
    6074                var24 = var18;
    6075                var26 = var16;
    6076            }
    6077            else if (this.uvRotateEast == 3)
    6078            {
    6079                var12 = ((double)(var10 + 16) - par1Block.minX * 16.0D) / 256.0D;
    6080                var14 = ((double)(var10 + 16) - par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    6081                var16 = ((double)var11 + par1Block.maxY * 16.0D) / 256.0D;
    6082                var18 = ((double)var11 + par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6083                var20 = var14;
    6084                var22 = var12;
    6085                var24 = var16;
    6086                var26 = var18;
    6087            }
    6088
    6089            double var28 = par2 + par1Block.minX;
    6090            double var30 = par2 + par1Block.maxX;
    6091            double var32 = par4 + par1Block.minY;
    6092            double var34 = par4 + par1Block.maxY;
    6093            double var36 = par6 + par1Block.minZ;
    6094
    6095            if (this.enableAO)
    6096            {
    6097                var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft);
    6098                var9.setBrightness(this.brightnessTopLeft);
    6099                var9.addVertexWithUV(var28, var34, var36, var20, var24);
    6100                var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft);
    6101                var9.setBrightness(this.brightnessBottomLeft);
    6102                var9.addVertexWithUV(var30, var34, var36, var12, var16);
    6103                var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight);
    6104                var9.setBrightness(this.brightnessBottomRight);
    6105                var9.addVertexWithUV(var30, var32, var36, var22, var26);
    6106                var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight);
    6107                var9.setBrightness(this.brightnessTopRight);
    6108                var9.addVertexWithUV(var28, var32, var36, var14, var18);
    6109            }
    6110            else
    6111            {
    6112                var9.addVertexWithUV(var28, var34, var36, var20, var24);
    6113                var9.addVertexWithUV(var30, var34, var36, var12, var16);
    6114                var9.addVertexWithUV(var30, var32, var36, var22, var26);
    6115                var9.addVertexWithUV(var28, var32, var36, var14, var18);
    6116            }
    6117        }
    6118
    6119        /**
    6120         * Renders the given texture to the west (z-positive) face of the block.  Args: block, x, y, z, texture
    6121         */
    6122        public void renderWestFace(Block par1Block, double par2, double par4, double par6, int par8)
    6123        {
    6124            Tessellator var9 = Tessellator.instance;
    6125
    6126            if (this.overrideBlockTexture >= 0)
    6127            {
    6128                par8 = this.overrideBlockTexture;
    6129            }
    6130
    6131            int var10 = (par8 & 15) << 4;
    6132            int var11 = par8 & 240;
    6133            double var12 = ((double)var10 + par1Block.minX * 16.0D) / 256.0D;
    6134            double var14 = ((double)var10 + par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    6135            double var16 = ((double)(var11 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6136            double var18 = ((double)(var11 + 16) - par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6137            double var20;
    6138
    6139            if (this.flipTexture)
    6140            {
    6141                var20 = var12;
    6142                var12 = var14;
    6143                var14 = var20;
    6144            }
    6145
    6146            if (par1Block.minX < 0.0D || par1Block.maxX > 1.0D)
    6147            {
    6148                var12 = (double)(((float)var10 + 0.0F) / 256.0F);
    6149                var14 = (double)(((float)var10 + 15.99F) / 256.0F);
    6150            }
    6151
    6152            if (par1Block.minY < 0.0D || par1Block.maxY > 1.0D)
    6153            {
    6154                var16 = (double)(((float)var11 + 0.0F) / 256.0F);
    6155                var18 = (double)(((float)var11 + 15.99F) / 256.0F);
    6156            }
    6157
    6158            var20 = var14;
    6159            double var22 = var12;
    6160            double var24 = var16;
    6161            double var26 = var18;
    6162
    6163            if (this.uvRotateWest == 1)
    6164            {
    6165                var12 = ((double)var10 + par1Block.minY * 16.0D) / 256.0D;
    6166                var18 = ((double)(var11 + 16) - par1Block.minX * 16.0D) / 256.0D;
    6167                var14 = ((double)var10 + par1Block.maxY * 16.0D) / 256.0D;
    6168                var16 = ((double)(var11 + 16) - par1Block.maxX * 16.0D) / 256.0D;
    6169                var24 = var16;
    6170                var26 = var18;
    6171                var20 = var12;
    6172                var22 = var14;
    6173                var16 = var18;
    6174                var18 = var24;
    6175            }
    6176            else if (this.uvRotateWest == 2)
    6177            {
    6178                var12 = ((double)(var10 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6179                var16 = ((double)var11 + par1Block.minX * 16.0D) / 256.0D;
    6180                var14 = ((double)(var10 + 16) - par1Block.minY * 16.0D) / 256.0D;
    6181                var18 = ((double)var11 + par1Block.maxX * 16.0D) / 256.0D;
    6182                var20 = var14;
    6183                var22 = var12;
    6184                var12 = var14;
    6185                var14 = var22;
    6186                var24 = var18;
    6187                var26 = var16;
    6188            }
    6189            else if (this.uvRotateWest == 3)
    6190            {
    6191                var12 = ((double)(var10 + 16) - par1Block.minX * 16.0D) / 256.0D;
    6192                var14 = ((double)(var10 + 16) - par1Block.maxX * 16.0D - 0.01D) / 256.0D;
    6193                var16 = ((double)var11 + par1Block.maxY * 16.0D) / 256.0D;
    6194                var18 = ((double)var11 + par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6195                var20 = var14;
    6196                var22 = var12;
    6197                var24 = var16;
    6198                var26 = var18;
    6199            }
    6200
    6201            double var28 = par2 + par1Block.minX;
    6202            double var30 = par2 + par1Block.maxX;
    6203            double var32 = par4 + par1Block.minY;
    6204            double var34 = par4 + par1Block.maxY;
    6205            double var36 = par6 + par1Block.maxZ;
    6206
    6207            if (this.enableAO)
    6208            {
    6209                var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft);
    6210                var9.setBrightness(this.brightnessTopLeft);
    6211                var9.addVertexWithUV(var28, var34, var36, var12, var16);
    6212                var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft);
    6213                var9.setBrightness(this.brightnessBottomLeft);
    6214                var9.addVertexWithUV(var28, var32, var36, var22, var26);
    6215                var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight);
    6216                var9.setBrightness(this.brightnessBottomRight);
    6217                var9.addVertexWithUV(var30, var32, var36, var14, var18);
    6218                var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight);
    6219                var9.setBrightness(this.brightnessTopRight);
    6220                var9.addVertexWithUV(var30, var34, var36, var20, var24);
    6221            }
    6222            else
    6223            {
    6224                var9.addVertexWithUV(var28, var34, var36, var12, var16);
    6225                var9.addVertexWithUV(var28, var32, var36, var22, var26);
    6226                var9.addVertexWithUV(var30, var32, var36, var14, var18);
    6227                var9.addVertexWithUV(var30, var34, var36, var20, var24);
    6228            }
    6229        }
    6230
    6231        /**
    6232         * Renders the given texture to the north (x-negative) face of the block.  Args: block, x, y, z, texture
    6233         */
    6234        public void renderNorthFace(Block par1Block, double par2, double par4, double par6, int par8)
    6235        {
    6236            Tessellator var9 = Tessellator.instance;
    6237
    6238            if (this.overrideBlockTexture >= 0)
    6239            {
    6240                par8 = this.overrideBlockTexture;
    6241            }
    6242
    6243            int var10 = (par8 & 15) << 4;
    6244            int var11 = par8 & 240;
    6245            double var12 = ((double)var10 + par1Block.minZ * 16.0D) / 256.0D;
    6246            double var14 = ((double)var10 + par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    6247            double var16 = ((double)(var11 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6248            double var18 = ((double)(var11 + 16) - par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6249            double var20;
    6250
    6251            if (this.flipTexture)
    6252            {
    6253                var20 = var12;
    6254                var12 = var14;
    6255                var14 = var20;
    6256            }
    6257
    6258            if (par1Block.minZ < 0.0D || par1Block.maxZ > 1.0D)
    6259            {
    6260                var12 = (double)(((float)var10 + 0.0F) / 256.0F);
    6261                var14 = (double)(((float)var10 + 15.99F) / 256.0F);
    6262            }
    6263
    6264            if (par1Block.minY < 0.0D || par1Block.maxY > 1.0D)
    6265            {
    6266                var16 = (double)(((float)var11 + 0.0F) / 256.0F);
    6267                var18 = (double)(((float)var11 + 15.99F) / 256.0F);
    6268            }
    6269
    6270            var20 = var14;
    6271            double var22 = var12;
    6272            double var24 = var16;
    6273            double var26 = var18;
    6274
    6275            if (this.uvRotateNorth == 1)
    6276            {
    6277                var12 = ((double)var10 + par1Block.minY * 16.0D) / 256.0D;
    6278                var16 = ((double)(var11 + 16) - par1Block.maxZ * 16.0D) / 256.0D;
    6279                var14 = ((double)var10 + par1Block.maxY * 16.0D) / 256.0D;
    6280                var18 = ((double)(var11 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    6281                var24 = var16;
    6282                var26 = var18;
    6283                var20 = var12;
    6284                var22 = var14;
    6285                var16 = var18;
    6286                var18 = var24;
    6287            }
    6288            else if (this.uvRotateNorth == 2)
    6289            {
    6290                var12 = ((double)(var10 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6291                var16 = ((double)var11 + par1Block.minZ * 16.0D) / 256.0D;
    6292                var14 = ((double)(var10 + 16) - par1Block.minY * 16.0D) / 256.0D;
    6293                var18 = ((double)var11 + par1Block.maxZ * 16.0D) / 256.0D;
    6294                var20 = var14;
    6295                var22 = var12;
    6296                var12 = var14;
    6297                var14 = var22;
    6298                var24 = var18;
    6299                var26 = var16;
    6300            }
    6301            else if (this.uvRotateNorth == 3)
    6302            {
    6303                var12 = ((double)(var10 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    6304                var14 = ((double)(var10 + 16) - par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    6305                var16 = ((double)var11 + par1Block.maxY * 16.0D) / 256.0D;
    6306                var18 = ((double)var11 + par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6307                var20 = var14;
    6308                var22 = var12;
    6309                var24 = var16;
    6310                var26 = var18;
    6311            }
    6312
    6313            double var28 = par2 + par1Block.minX;
    6314            double var30 = par4 + par1Block.minY;
    6315            double var32 = par4 + par1Block.maxY;
    6316            double var34 = par6 + par1Block.minZ;
    6317            double var36 = par6 + par1Block.maxZ;
    6318
    6319            if (this.enableAO)
    6320            {
    6321                var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft);
    6322                var9.setBrightness(this.brightnessTopLeft);
    6323                var9.addVertexWithUV(var28, var32, var36, var20, var24);
    6324                var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft);
    6325                var9.setBrightness(this.brightnessBottomLeft);
    6326                var9.addVertexWithUV(var28, var32, var34, var12, var16);
    6327                var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight);
    6328                var9.setBrightness(this.brightnessBottomRight);
    6329                var9.addVertexWithUV(var28, var30, var34, var22, var26);
    6330                var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight);
    6331                var9.setBrightness(this.brightnessTopRight);
    6332                var9.addVertexWithUV(var28, var30, var36, var14, var18);
    6333            }
    6334            else
    6335            {
    6336                var9.addVertexWithUV(var28, var32, var36, var20, var24);
    6337                var9.addVertexWithUV(var28, var32, var34, var12, var16);
    6338                var9.addVertexWithUV(var28, var30, var34, var22, var26);
    6339                var9.addVertexWithUV(var28, var30, var36, var14, var18);
    6340            }
    6341        }
    6342
    6343        /**
    6344         * Renders the given texture to the south (x-positive) face of the block.  Args: block, x, y, z, texture
    6345         */
    6346        public void renderSouthFace(Block par1Block, double par2, double par4, double par6, int par8)
    6347        {
    6348            Tessellator var9 = Tessellator.instance;
    6349
    6350            if (this.overrideBlockTexture >= 0)
    6351            {
    6352                par8 = this.overrideBlockTexture;
    6353            }
    6354
    6355            int var10 = (par8 & 15) << 4;
    6356            int var11 = par8 & 240;
    6357            double var12 = ((double)var10 + par1Block.minZ * 16.0D) / 256.0D;
    6358            double var14 = ((double)var10 + par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    6359            double var16 = ((double)(var11 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6360            double var18 = ((double)(var11 + 16) - par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6361            double var20;
    6362
    6363            if (this.flipTexture)
    6364            {
    6365                var20 = var12;
    6366                var12 = var14;
    6367                var14 = var20;
    6368            }
    6369
    6370            if (par1Block.minZ < 0.0D || par1Block.maxZ > 1.0D)
    6371            {
    6372                var12 = (double)(((float)var10 + 0.0F) / 256.0F);
    6373                var14 = (double)(((float)var10 + 15.99F) / 256.0F);
    6374            }
    6375
    6376            if (par1Block.minY < 0.0D || par1Block.maxY > 1.0D)
    6377            {
    6378                var16 = (double)(((float)var11 + 0.0F) / 256.0F);
    6379                var18 = (double)(((float)var11 + 15.99F) / 256.0F);
    6380            }
    6381
    6382            var20 = var14;
    6383            double var22 = var12;
    6384            double var24 = var16;
    6385            double var26 = var18;
    6386
    6387            if (this.uvRotateSouth == 2)
    6388            {
    6389                var12 = ((double)var10 + par1Block.minY * 16.0D) / 256.0D;
    6390                var16 = ((double)(var11 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    6391                var14 = ((double)var10 + par1Block.maxY * 16.0D) / 256.0D;
    6392                var18 = ((double)(var11 + 16) - par1Block.maxZ * 16.0D) / 256.0D;
    6393                var24 = var16;
    6394                var26 = var18;
    6395                var20 = var12;
    6396                var22 = var14;
    6397                var16 = var18;
    6398                var18 = var24;
    6399            }
    6400            else if (this.uvRotateSouth == 1)
    6401            {
    6402                var12 = ((double)(var10 + 16) - par1Block.maxY * 16.0D) / 256.0D;
    6403                var16 = ((double)var11 + par1Block.maxZ * 16.0D) / 256.0D;
    6404                var14 = ((double)(var10 + 16) - par1Block.minY * 16.0D) / 256.0D;
    6405                var18 = ((double)var11 + par1Block.minZ * 16.0D) / 256.0D;
    6406                var20 = var14;
    6407                var22 = var12;
    6408                var12 = var14;
    6409                var14 = var22;
    6410                var24 = var18;
    6411                var26 = var16;
    6412            }
    6413            else if (this.uvRotateSouth == 3)
    6414            {
    6415                var12 = ((double)(var10 + 16) - par1Block.minZ * 16.0D) / 256.0D;
    6416                var14 = ((double)(var10 + 16) - par1Block.maxZ * 16.0D - 0.01D) / 256.0D;
    6417                var16 = ((double)var11 + par1Block.maxY * 16.0D) / 256.0D;
    6418                var18 = ((double)var11 + par1Block.minY * 16.0D - 0.01D) / 256.0D;
    6419                var20 = var14;
    6420                var22 = var12;
    6421                var24 = var16;
    6422                var26 = var18;
    6423            }
    6424
    6425            double var28 = par2 + par1Block.maxX;
    6426            double var30 = par4 + par1Block.minY;
    6427            double var32 = par4 + par1Block.maxY;
    6428            double var34 = par6 + par1Block.minZ;
    6429            double var36 = par6 + par1Block.maxZ;
    6430
    6431            if (this.enableAO)
    6432            {
    6433                var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft);
    6434                var9.setBrightness(this.brightnessTopLeft);
    6435                var9.addVertexWithUV(var28, var30, var36, var22, var26);
    6436                var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft);
    6437                var9.setBrightness(this.brightnessBottomLeft);
    6438                var9.addVertexWithUV(var28, var30, var34, var14, var18);
    6439                var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight);
    6440                var9.setBrightness(this.brightnessBottomRight);
    6441                var9.addVertexWithUV(var28, var32, var34, var20, var24);
    6442                var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight);
    6443                var9.setBrightness(this.brightnessTopRight);
    6444                var9.addVertexWithUV(var28, var32, var36, var12, var16);
    6445            }
    6446            else
    6447            {
    6448                var9.addVertexWithUV(var28, var30, var36, var22, var26);
    6449                var9.addVertexWithUV(var28, var30, var34, var14, var18);
    6450                var9.addVertexWithUV(var28, var32, var34, var20, var24);
    6451                var9.addVertexWithUV(var28, var32, var36, var12, var16);
    6452            }
    6453        }
    6454
    6455        /**
    6456         * Is called to render the image of a block on an inventory, as a held item, or as a an item on the ground
    6457         */
    6458        public void renderBlockAsItem(Block par1Block, int par2, float par3)
    6459        {
    6460            Tessellator var4 = Tessellator.instance;
    6461            boolean var5 = par1Block.blockID == Block.grass.blockID;
    6462            int var6;
    6463            float var7;
    6464            float var8;
    6465            float var9;
    6466
    6467            if (this.useInventoryTint)
    6468            {
    6469                var6 = par1Block.getRenderColor(par2);
    6470
    6471                if (var5)
    6472                {
    6473                    var6 = 16777215;
    6474                }
    6475
    6476                var7 = (float)(var6 >> 16 & 255) / 255.0F;
    6477                var8 = (float)(var6 >> 8 & 255) / 255.0F;
    6478                var9 = (float)(var6 & 255) / 255.0F;
    6479                GL11.glColor4f(var7 * par3, var8 * par3, var9 * par3, 1.0F);
    6480            }
    6481
    6482            var6 = par1Block.getRenderType();
    6483            int var14;
    6484
    6485            if (var6 != 0 && var6 != 31 && var6 != 16 && var6 != 26)
    6486            {
    6487                if (var6 == 1)
    6488                {
    6489                    var4.startDrawingQuads();
    6490                    var4.setNormal(0.0F, -1.0F, 0.0F);
    6491                    this.drawCrossedSquares(par1Block, par2, -0.5D, -0.5D, -0.5D, 1.0F);
    6492                    var4.draw();
    6493                }
    6494                else if (var6 == 19)
    6495                {
    6496                    var4.startDrawingQuads();
    6497                    var4.setNormal(0.0F, -1.0F, 0.0F);
    6498                    par1Block.setBlockBoundsForItemRender();
    6499                    this.renderBlockStemSmall(par1Block, par2, par1Block.maxY, -0.5D, -0.5D, -0.5D);
    6500                    var4.draw();
    6501                }
    6502                else if (var6 == 23)
    6503                {
    6504                    var4.startDrawingQuads();
    6505                    var4.setNormal(0.0F, -1.0F, 0.0F);
    6506                    par1Block.setBlockBoundsForItemRender();
    6507                    var4.draw();
    6508                }
    6509                else if (var6 == 13)
    6510                {
    6511                    par1Block.setBlockBoundsForItemRender();
    6512                    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6513                    var7 = 0.0625F;
    6514                    var4.startDrawingQuads();
    6515                    var4.setNormal(0.0F, -1.0F, 0.0F);
    6516                    this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(0));
    6517                    var4.draw();
    6518                    var4.startDrawingQuads();
    6519                    var4.setNormal(0.0F, 1.0F, 0.0F);
    6520                    this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(1));
    6521                    var4.draw();
    6522                    var4.startDrawingQuads();
    6523                    var4.setNormal(0.0F, 0.0F, -1.0F);
    6524                    var4.addTranslation(0.0F, 0.0F, var7);
    6525                    this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(2));
    6526                    var4.addTranslation(0.0F, 0.0F, -var7);
    6527                    var4.draw();
    6528                    var4.startDrawingQuads();
    6529                    var4.setNormal(0.0F, 0.0F, 1.0F);
    6530                    var4.addTranslation(0.0F, 0.0F, -var7);
    6531                    this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(3));
    6532                    var4.addTranslation(0.0F, 0.0F, var7);
    6533                    var4.draw();
    6534                    var4.startDrawingQuads();
    6535                    var4.setNormal(-1.0F, 0.0F, 0.0F);
    6536                    var4.addTranslation(var7, 0.0F, 0.0F);
    6537                    this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(4));
    6538                    var4.addTranslation(-var7, 0.0F, 0.0F);
    6539                    var4.draw();
    6540                    var4.startDrawingQuads();
    6541                    var4.setNormal(1.0F, 0.0F, 0.0F);
    6542                    var4.addTranslation(-var7, 0.0F, 0.0F);
    6543                    this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(5));
    6544                    var4.addTranslation(var7, 0.0F, 0.0F);
    6545                    var4.draw();
    6546                    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6547                }
    6548                else if (var6 == 22)
    6549                {
    6550                    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    6551                    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6552                    ChestItemRenderHelper.instance.renderChest(par1Block, par2, par3);
    6553                    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    6554                }
    6555                else if (var6 == 6)
    6556                {
    6557                    var4.startDrawingQuads();
    6558                    var4.setNormal(0.0F, -1.0F, 0.0F);
    6559                    this.renderBlockCropsImpl(par1Block, par2, -0.5D, -0.5D, -0.5D);
    6560                    var4.draw();
    6561                }
    6562                else if (var6 == 2)
    6563                {
    6564                    var4.startDrawingQuads();
    6565                    var4.setNormal(0.0F, -1.0F, 0.0F);
    6566                    this.renderTorchAtAngle(par1Block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D);
    6567                    var4.draw();
    6568                }
    6569                else if (var6 == 10)
    6570                {
    6571                    for (var14 = 0; var14 < 2; ++var14)
    6572                    {
    6573                        if (var14 == 0)
    6574                        {
    6575                            par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
    6576                        }
    6577
    6578                        if (var14 == 1)
    6579                        {
    6580                            par1Block.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
    6581                        }
    6582
    6583                        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6584                        var4.startDrawingQuads();
    6585                        var4.setNormal(0.0F, -1.0F, 0.0F);
    6586                        this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(0));
    6587                        var4.draw();
    6588                        var4.startDrawingQuads();
    6589                        var4.setNormal(0.0F, 1.0F, 0.0F);
    6590                        this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(1));
    6591                        var4.draw();
    6592                        var4.startDrawingQuads();
    6593                        var4.setNormal(0.0F, 0.0F, -1.0F);
    6594                        this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(2));
    6595                        var4.draw();
    6596                        var4.startDrawingQuads();
    6597                        var4.setNormal(0.0F, 0.0F, 1.0F);
    6598                        this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(3));
    6599                        var4.draw();
    6600                        var4.startDrawingQuads();
    6601                        var4.setNormal(-1.0F, 0.0F, 0.0F);
    6602                        this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(4));
    6603                        var4.draw();
    6604                        var4.startDrawingQuads();
    6605                        var4.setNormal(1.0F, 0.0F, 0.0F);
    6606                        this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(5));
    6607                        var4.draw();
    6608                        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6609                    }
    6610                }
    6611                else if (var6 == 27)
    6612                {
    6613                    var14 = 0;
    6614                    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6615                    var4.startDrawingQuads();
    6616
    6617                    for (int var15 = 0; var15 < 8; ++var15)
    6618                    {
    6619                        byte var16 = 0;
    6620                        byte var17 = 1;
    6621
    6622                        if (var15 == 0)
    6623                        {
    6624                            var16 = 2;
    6625                        }
    6626
    6627                        if (var15 == 1)
    6628                        {
    6629                            var16 = 3;
    6630                        }
    6631
    6632                        if (var15 == 2)
    6633                        {
    6634                            var16 = 4;
    6635                        }
    6636
    6637                        if (var15 == 3)
    6638                        {
    6639                            var16 = 5;
    6640                            var17 = 2;
    6641                        }
    6642
    6643                        if (var15 == 4)
    6644                        {
    6645                            var16 = 6;
    6646                            var17 = 3;
    6647                        }
    6648
    6649                        if (var15 == 5)
    6650                        {
    6651                            var16 = 7;
    6652                            var17 = 5;
    6653                        }
    6654
    6655                        if (var15 == 6)
    6656                        {
    6657                            var16 = 6;
    6658                            var17 = 2;
    6659                        }
    6660
    6661                        if (var15 == 7)
    6662                        {
    6663                            var16 = 3;
    6664                        }
    6665
    6666                        float var11 = (float)var16 / 16.0F;
    6667                        float var12 = 1.0F - (float)var14 / 16.0F;
    6668                        float var13 = 1.0F - (float)(var14 + var17) / 16.0F;
    6669                        var14 += var17;
    6670                        par1Block.setBlockBounds(0.5F - var11, var13, 0.5F - var11, 0.5F + var11, var12, 0.5F + var11);
    6671                        var4.setNormal(0.0F, -1.0F, 0.0F);
    6672                        this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(0));
    6673                        var4.setNormal(0.0F, 1.0F, 0.0F);
    6674                        this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(1));
    6675                        var4.setNormal(0.0F, 0.0F, -1.0F);
    6676                        this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(2));
    6677                        var4.setNormal(0.0F, 0.0F, 1.0F);
    6678                        this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(3));
    6679                        var4.setNormal(-1.0F, 0.0F, 0.0F);
    6680                        this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(4));
    6681                        var4.setNormal(1.0F, 0.0F, 0.0F);
    6682                        this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(5));
    6683                    }
    6684
    6685                    var4.draw();
    6686                    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6687                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    6688                }
    6689                else if (var6 == 11)
    6690                {
    6691                    for (var14 = 0; var14 < 4; ++var14)
    6692                    {
    6693                        var8 = 0.125F;
    6694
    6695                        if (var14 == 0)
    6696                        {
    6697                            par1Block.setBlockBounds(0.5F - var8, 0.0F, 0.0F, 0.5F + var8, 1.0F, var8 * 2.0F);
    6698                        }
    6699
    6700                        if (var14 == 1)
    6701                        {
    6702                            par1Block.setBlockBounds(0.5F - var8, 0.0F, 1.0F - var8 * 2.0F, 0.5F + var8, 1.0F, 1.0F);
    6703                        }
    6704
    6705                        var8 = 0.0625F;
    6706
    6707                        if (var14 == 2)
    6708                        {
    6709                            par1Block.setBlockBounds(0.5F - var8, 1.0F - var8 * 3.0F, -var8 * 2.0F, 0.5F + var8, 1.0F - var8, 1.0F + var8 * 2.0F);
    6710                        }
    6711
    6712                        if (var14 == 3)
    6713                        {
    6714                            par1Block.setBlockBounds(0.5F - var8, 0.5F - var8 * 3.0F, -var8 * 2.0F, 0.5F + var8, 0.5F - var8, 1.0F + var8 * 2.0F);
    6715                        }
    6716
    6717                        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6718                        var4.startDrawingQuads();
    6719                        var4.setNormal(0.0F, -1.0F, 0.0F);
    6720                        this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(0));
    6721                        var4.draw();
    6722                        var4.startDrawingQuads();
    6723                        var4.setNormal(0.0F, 1.0F, 0.0F);
    6724                        this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(1));
    6725                        var4.draw();
    6726                        var4.startDrawingQuads();
    6727                        var4.setNormal(0.0F, 0.0F, -1.0F);
    6728                        this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(2));
    6729                        var4.draw();
    6730                        var4.startDrawingQuads();
    6731                        var4.setNormal(0.0F, 0.0F, 1.0F);
    6732                        this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(3));
    6733                        var4.draw();
    6734                        var4.startDrawingQuads();
    6735                        var4.setNormal(-1.0F, 0.0F, 0.0F);
    6736                        this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(4));
    6737                        var4.draw();
    6738                        var4.startDrawingQuads();
    6739                        var4.setNormal(1.0F, 0.0F, 0.0F);
    6740                        this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(5));
    6741                        var4.draw();
    6742                        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6743                    }
    6744
    6745                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    6746                }
    6747                else if (var6 == 21)
    6748                {
    6749                    for (var14 = 0; var14 < 3; ++var14)
    6750                    {
    6751                        var8 = 0.0625F;
    6752
    6753                        if (var14 == 0)
    6754                        {
    6755                            par1Block.setBlockBounds(0.5F - var8, 0.3F, 0.0F, 0.5F + var8, 1.0F, var8 * 2.0F);
    6756                        }
    6757
    6758                        if (var14 == 1)
    6759                        {
    6760                            par1Block.setBlockBounds(0.5F - var8, 0.3F, 1.0F - var8 * 2.0F, 0.5F + var8, 1.0F, 1.0F);
    6761                        }
    6762
    6763                        var8 = 0.0625F;
    6764
    6765                        if (var14 == 2)
    6766                        {
    6767                            par1Block.setBlockBounds(0.5F - var8, 0.5F, 0.0F, 0.5F + var8, 1.0F - var8, 1.0F);
    6768                        }
    6769
    6770                        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6771                        var4.startDrawingQuads();
    6772                        var4.setNormal(0.0F, -1.0F, 0.0F);
    6773                        this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(0));
    6774                        var4.draw();
    6775                        var4.startDrawingQuads();
    6776                        var4.setNormal(0.0F, 1.0F, 0.0F);
    6777                        this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(1));
    6778                        var4.draw();
    6779                        var4.startDrawingQuads();
    6780                        var4.setNormal(0.0F, 0.0F, -1.0F);
    6781                        this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(2));
    6782                        var4.draw();
    6783                        var4.startDrawingQuads();
    6784                        var4.setNormal(0.0F, 0.0F, 1.0F);
    6785                        this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(3));
    6786                        var4.draw();
    6787                        var4.startDrawingQuads();
    6788                        var4.setNormal(-1.0F, 0.0F, 0.0F);
    6789                        this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(4));
    6790                        var4.draw();
    6791                        var4.startDrawingQuads();
    6792                        var4.setNormal(1.0F, 0.0F, 0.0F);
    6793                        this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSide(5));
    6794                        var4.draw();
    6795                        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6796                    }
    6797                }
    6798                else if (var6 == 32)
    6799                {
    6800                    for (var14 = 0; var14 < 2; ++var14)
    6801                    {
    6802                        if (var14 == 0)
    6803                        {
    6804                            par1Block.setBlockBounds(0.0F, 0.0F, 0.3125F, 1.0F, 0.8125F, 0.6875F);
    6805                        }
    6806
    6807                        if (var14 == 1)
    6808                        {
    6809                            par1Block.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 1.0F, 0.75F);
    6810                        }
    6811
    6812                        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6813                        var4.startDrawingQuads();
    6814                        var4.setNormal(0.0F, -1.0F, 0.0F);
    6815                        this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(0, par2));
    6816                        var4.draw();
    6817                        var4.startDrawingQuads();
    6818                        var4.setNormal(0.0F, 1.0F, 0.0F);
    6819                        this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(1, par2));
    6820                        var4.draw();
    6821                        var4.startDrawingQuads();
    6822                        var4.setNormal(0.0F, 0.0F, -1.0F);
    6823                        this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(2, par2));
    6824                        var4.draw();
    6825                        var4.startDrawingQuads();
    6826                        var4.setNormal(0.0F, 0.0F, 1.0F);
    6827                        this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(3, par2));
    6828                        var4.draw();
    6829                        var4.startDrawingQuads();
    6830                        var4.setNormal(-1.0F, 0.0F, 0.0F);
    6831                        this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(4, par2));
    6832                        var4.draw();
    6833                        var4.startDrawingQuads();
    6834                        var4.setNormal(1.0F, 0.0F, 0.0F);
    6835                        this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(5, par2));
    6836                        var4.draw();
    6837                        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6838                    }
    6839
    6840                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    6841                }
    6842                else if (var6 == 35)
    6843                {
    6844                    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6845                    this.func_82776_a((BlockAnvil)par1Block, 0, 0, 0, par2, true);
    6846                    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6847                }
    6848                else if (var6 == 34)
    6849                {
    6850                    for (var14 = 0; var14 < 3; ++var14)
    6851                    {
    6852                        if (var14 == 0)
    6853                        {
    6854                            par1Block.setBlockBounds(0.125F, 0.0F, 0.125F, 0.875F, 0.1875F, 0.875F);
    6855                            this.func_82774_a(Block.obsidian.blockIndexInTexture);
    6856                        }
    6857                        else if (var14 == 1)
    6858                        {
    6859                            par1Block.setBlockBounds(0.1875F, 0.1875F, 0.1875F, 0.8125F, 0.875F, 0.8125F);
    6860                            this.func_82774_a(41);
    6861                        }
    6862                        else if (var14 == 2)
    6863                        {
    6864                            par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    6865                            this.func_82774_a(Block.glass.blockIndexInTexture);
    6866                        }
    6867
    6868                        GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6869                        var4.startDrawingQuads();
    6870                        var4.setNormal(0.0F, -1.0F, 0.0F);
    6871                        this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(0, par2));
    6872                        var4.draw();
    6873                        var4.startDrawingQuads();
    6874                        var4.setNormal(0.0F, 1.0F, 0.0F);
    6875                        this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(1, par2));
    6876                        var4.draw();
    6877                        var4.startDrawingQuads();
    6878                        var4.setNormal(0.0F, 0.0F, -1.0F);
    6879                        this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(2, par2));
    6880                        var4.draw();
    6881                        var4.startDrawingQuads();
    6882                        var4.setNormal(0.0F, 0.0F, 1.0F);
    6883                        this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(3, par2));
    6884                        var4.draw();
    6885                        var4.startDrawingQuads();
    6886                        var4.setNormal(-1.0F, 0.0F, 0.0F);
    6887                        this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(4, par2));
    6888                        var4.draw();
    6889                        var4.startDrawingQuads();
    6890                        var4.setNormal(1.0F, 0.0F, 0.0F);
    6891                        this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(5, par2));
    6892                        var4.draw();
    6893                        GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6894                    }
    6895
    6896                    par1Block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
    6897                    this.clearOverrideBlockTexture();
    6898                }
    6899                else
    6900                {
    6901                    FMLRenderAccessLibrary.renderInventoryBlock(this, par1Block, par2, var6);
    6902                }
    6903            }
    6904            else
    6905            {
    6906                if (var6 == 16)
    6907                {
    6908                    par2 = 1;
    6909                }
    6910
    6911                par1Block.setBlockBoundsForItemRender();
    6912                GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    6913                GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    6914                var4.startDrawingQuads();
    6915                var4.setNormal(0.0F, -1.0F, 0.0F);
    6916                this.renderBottomFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(0, par2));
    6917                var4.draw();
    6918
    6919                if (var5 && this.useInventoryTint)
    6920                {
    6921                    var14 = par1Block.getRenderColor(par2);
    6922                    var8 = (float)(var14 >> 16 & 255) / 255.0F;
    6923                    var9 = (float)(var14 >> 8 & 255) / 255.0F;
    6924                    float var10 = (float)(var14 & 255) / 255.0F;
    6925                    GL11.glColor4f(var8 * par3, var9 * par3, var10 * par3, 1.0F);
    6926                }
    6927
    6928                var4.startDrawingQuads();
    6929                var4.setNormal(0.0F, 1.0F, 0.0F);
    6930                this.renderTopFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(1, par2));
    6931                var4.draw();
    6932
    6933                if (var5 && this.useInventoryTint)
    6934                {
    6935                    GL11.glColor4f(par3, par3, par3, 1.0F);
    6936                }
    6937
    6938                var4.startDrawingQuads();
    6939                var4.setNormal(0.0F, 0.0F, -1.0F);
    6940                this.renderEastFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(2, par2));
    6941                var4.draw();
    6942                var4.startDrawingQuads();
    6943                var4.setNormal(0.0F, 0.0F, 1.0F);
    6944                this.renderWestFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(3, par2));
    6945                var4.draw();
    6946                var4.startDrawingQuads();
    6947                var4.setNormal(-1.0F, 0.0F, 0.0F);
    6948                this.renderNorthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(4, par2));
    6949                var4.draw();
    6950                var4.startDrawingQuads();
    6951                var4.setNormal(1.0F, 0.0F, 0.0F);
    6952                this.renderSouthFace(par1Block, 0.0D, 0.0D, 0.0D, par1Block.getBlockTextureFromSideAndMetadata(5, par2));
    6953                var4.draw();
    6954                GL11.glTranslatef(0.5F, 0.5F, 0.5F);
    6955            }
    6956        }
    6957
    6958        /**
    6959         * Checks to see if the item's render type indicates that it should be rendered as a regular block or not.
    6960         */
    6961        public static boolean renderItemIn3d(int par0)
    6962        {
    6963            switch (par0)
    6964            {
    6965                case 0:
    6966                    return true;
    6967                case 31:
    6968                    return true;
    6969                case 13:
    6970                    return true;
    6971                case 10:
    6972                    return true;
    6973                case 11:
    6974                    return true;
    6975                case 27:
    6976                    return true;
    6977                case 22:
    6978                    return true;
    6979                case 21:
    6980                    return true;
    6981                case 16:
    6982                    return true;
    6983                case 26:
    6984                    return true;
    6985                case 32:
    6986                    return true;
    6987                case 34:
    6988                    return true;
    6989                case 35:
    6990                    return true;
    6991                default:
    6992                    return FMLRenderAccessLibrary.renderItemAsFull3DBlock(par0);
    6993            }
    6994        }
    6995    }