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