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