public final void shutdown() {
		try {
			if(this.soundPlayer != null) {
				SoundPlayer var1 = this.soundPlayer;
				this.soundPlayer.running = false;
			}

			if(this.resourceThread != null) {
				ResourceDownloadThread var4 = this.resourceThread;
				this.resourceThread.running = true;
			}
		} catch (Exception var3) {
			;
		}

		Minecraft var5 = this;
		if(!this.levelLoaded) {
			try {
				if(var5.level.creativeMode)
				{
					LevelIO.save(var5.level, (OutputStream)(new FileOutputStream(new File(mcDir, "levelc.dat"))));
				} else {
					LevelIO.save(var5.level, (OutputStream)(new FileOutputStream(new File(mcDir, "levels.dat"))));
				}
			} catch (Exception var2) {
				var2.printStackTrace();
			}
		}

		Mouse.destroy();
		Keyboard.destroy();
		if(!isSystemShuttingDown())
		{
			Display.destroy();
		}
	}