public void shutdownMinecraftApplet()
    {
        try
        {
            this.statFileWriter.func_27175_b();
            this.statFileWriter.syncStats();

            if (this.mcApplet != null)
            {
                this.mcApplet.clearApplet();
            }

            try
            {
                if (this.downloadResourcesThread != null)
                {
                    this.downloadResourcesThread.closeMinecraft();
                }
            }
            catch (Exception var9)
            {
                ;
            }

            System.out.println("Stopping!");

            try
            {
                this.changeWorld1((World)null);
            }
            catch (Throwable var8)
            {
                ;
            }

            try
            {
                GLAllocation.deleteTexturesAndDisplayLists();
            }
            catch (Throwable var7)
            {
                ;
            }

            this.sndManager.closeMinecraft();
            Mouse.destroy();
            Keyboard.destroy();
        }
        finally
        {
            Display.destroy();

            if (!this.hasCrashed)
            {
                System.exit(0);
            }
        }

        System.gc();
    }