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 lombok.Getter;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.nio.file.Files;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@@ -126,14 +126,9 @@ public class FightStatistics {
|
|||||||
Config.EventKampf.setFight(fightId);
|
Config.EventKampf.setFight(fightId);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
Files.move(FileRecorder.getFile().toPath(), FileSource.replayFile(fightId).toPath());
|
||||||
if(!FileRecorder.getFile().renameTo(FileSource.replayFile(fightId)))
|
|
||||||
throw new IOException("Failed to move replay");
|
|
||||||
|
|
||||||
markReplayAvailable(fightId);
|
markReplayAvailable(fightId);
|
||||||
} catch (Exception e) {
|
|
||||||
Bukkit.getLogger().log(Level.INFO, "Failed to save replay", e);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, "Failed to save statistics", e);
|
Bukkit.getLogger().log(Level.SEVERE, "Failed to save statistics", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user