public void processReadPackets()
    {
        if (this.sendQueueByteLength > 1048576)
        {
            this.networkShutdown("disconnect.overflow", new Object[0]);
        }

        if (this.readPackets.isEmpty())
        {
            if (this.timeSinceLastRead++ == 1200)
            {
                this.networkShutdown("disconnect.timeout", new Object[0]);
            }
        }
        else
        {
            this.timeSinceLastRead = 0;
        }

        int var1 = 1000;

        while (!this.readPackets.isEmpty() && var1-- >= 0)
        {
            Packet var2 = (Packet)this.readPackets.remove(0);
            var2.processPacket(this.netHandler);
        }

        this.wakeThreads();

        if (this.isTerminating && this.readPackets.isEmpty())
        {
            this.netHandler.handleErrorMessage(this.terminationReason, this.field_20101_t);
        }
    }