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