Fix replay saving

This commit is contained in:
Lixfel
2025-01-20 16:09:40 +01:00
parent ee705792bf
commit 052e549606
@@ -38,7 +38,7 @@ import de.steamwar.sql.SteamwarUser;
import lombok.Getter;
import org.bukkit.Bukkit;
import java.io.IOException;
import java.nio.file.Files;
import java.sql.Timestamp;
import java.time.Instant;
import java.util.logging.Level;
@@ -126,14 +126,9 @@ public class FightStatistics {
Config.EventKampf.setFight(fightId);
}
try {
if(!FileRecorder.getFile().renameTo(FileSource.replayFile(fightId)))
throw new IOException("Failed to move replay");
Files.move(FileRecorder.getFile().toPath(), FileSource.replayFile(fightId).toPath());
markReplayAvailable(fightId);
} catch (Exception e) {
Bukkit.getLogger().log(Level.INFO, "Failed to save replay", e);
}
markReplayAvailable(fightId);
} catch (Exception e) {
Bukkit.getLogger().log(Level.SEVERE, "Failed to save statistics", e);
}