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