forked from SteamWar/SteamWar
Fix replay saving
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user