Do not bother recovering useless replays (fixes #444)

Useless replays being those for which auto-recording was disabled and Start
never pressed.
This commit is contained in:
Jonas Herzig
2021-02-16 22:38:39 +01:00
parent dabb64340e
commit 19ff1ef38b
2 changed files with 12 additions and 0 deletions

View File

@@ -476,6 +476,14 @@ public class ReplayMod implements
String name = path.getFileName().toString();
if (name.endsWith(".mcpr.tmp") && Files.isDirectory(path)) {
Path original = path.resolveSibling(FilenameUtils.getBaseName(name));
Path noRecoverMarker = original.resolveSibling(original.getFileName() + ".no_recover");
if (Files.exists(noRecoverMarker)) {
// This file, when its markers are processed, doesn't actually result in any replays.
// So we don't really need to recover it either, let's just get rid of it.
FileUtils.deleteDirectory(path.toFile());
Files.delete(noRecoverMarker);
continue;
}
new RestoreReplayGui(this, GuiScreen.wrap(mc.currentScreen), original.toFile()).display();
}
}