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