public void updateTimer()
    {
        long l = Minecraft.func_71386_F();
        long l1 = l - lastSyncSysClock;
        long l2 = System.nanoTime() / 0xf4240L;
        double d = (double)l2 / 1000D;

        if (l1 > 1000L || l1 < 0L)
        {
            lastHRTime = d;
        }
        else
        {
            field_74285_i += l1;

            if (field_74285_i > 1000L)
            {
                long l3 = l2 - lastSyncHRClock;
                double d2 = (double)field_74285_i / (double)l3;
                timeSyncAdjustment += (d2 - timeSyncAdjustment) * 0.20000000298023224D;
                lastSyncHRClock = l2;
                field_74285_i = 0L;
            }

            if (field_74285_i < 0L)
            {
                lastSyncHRClock = l2;
            }
        }

        lastSyncSysClock = l;
        double d1 = (d - lastHRTime) * timeSyncAdjustment;
        lastHRTime = d;

        if (d1 < 0.0D)
        {
            d1 = 0.0D;
        }

        if (d1 > 1.0D)
        {
            d1 = 1.0D;
        }

        elapsedPartialTicks += d1 * (double)timerSpeed * (double)ticksPerSecond;
        elapsedTicks = (int)elapsedPartialTicks;
        elapsedPartialTicks -= elapsedTicks;

        if (elapsedTicks > 10)
        {
            elapsedTicks = 10;
        }

        renderPartialTicks = elapsedPartialTicks;
    }