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