public void render(float posX, float posY, int x, int y, World w, boolean selected)
    {
        if(volume > fluid.getMaxVolume())
            volume = fluid.getMaxVolume();
        if(getBlockName().equals(fluid.getName()+"_All") || volume == Integer.MAX_VALUE)
        {
            w.setBlock(x, y, fluidName+"_"+fluid.getMaxVolume());
        }
        Tessellator t = Tessellator.instance;
        Color c = new Color(fluid.getColor());
        float val = w.getLightValue(x, y);
        if(val < 0.01f)
            val = 0.01f;
        if(fluid.getLightingPower() == 0)
            t.setColorRGBA((int)(val*((float)c.getRed())),(int)(val*((float)c.getGreen())),(int)(val*((float)c.getBlue())), (int)(fluid.getOpacity()*255f));
        else
            t.setColorRGBA((int)(((float)c.getRed())),(int)(((float)c.getGreen())),(int)(((float)c.getBlue())), (int)(fluid.getOpacity()*255f));
        float h = ((float)(volume)/(float)this.fluid.getMaxVolume())*Block.BLOCK_HEIGHT;
        Block atLeft =  Block.getBlock(w.getBlockAt(x-1, y));
        
        float leftH = h;
        float rightH = h;
        if(atLeft instanceof BlockFluid)
        {
            if((((BlockFluid) atLeft).volume) > volume)
            leftH = ((float)(((BlockFluid) atLeft).volume)/(float)((BlockFluid) atLeft).fluid.getMaxVolume())*Block.BLOCK_HEIGHT;
        }
        Block atRight =  Block.getBlock(w.getBlockAt(x+1, y));
        if(atRight instanceof BlockFluid)
        {
            if((((BlockFluid) atRight).volume) > volume)
            rightH = ((float)(((BlockFluid) atRight).volume)/(float)((BlockFluid) atRight).fluid.getMaxVolume())*Block.BLOCK_HEIGHT;
        }
        t.addVertexWithUV(posX, posY, 0,minU,minV);
        t.addVertexWithUV(posX+Block.BLOCK_WIDTH/2, posY, 0,maxU,minV);
        t.addVertexWithUV(posX+Block.BLOCK_WIDTH/2, posY+h, 0,maxU,maxV);
        t.addVertexWithUV(posX, posY+leftH, 0,minU,maxV);
        
        t.addVertexWithUV(posX+Block.BLOCK_WIDTH/2, posY, 0,minU,minV);
        t.addVertexWithUV(posX+Block.BLOCK_WIDTH, posY, 0,maxU,minV);
        t.addVertexWithUV(posX+Block.BLOCK_WIDTH, posY+rightH, 0,maxU,maxV);
        t.addVertexWithUV(posX+Block.BLOCK_WIDTH/2, posY+h, 0,minU,maxV);
        t.setColorRGBA_F(1,1,1,1);
    }