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