SteamWar/BauSystem2.0
Archiviert
12
0

Fixed Nullpointer in clear
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Made hacky fix for EOF
Dieser Commit ist enthalten in:
D4rkr34lm 2024-05-03 23:41:55 +02:00
Ursprung 4a334d8693
Commit c12e6d0525
2 geänderte Dateien mit 12 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -308,16 +308,20 @@ public class Trace {
/**
* Loads the records of this trace from storage to memory
*/
@SneakyThrows
private void loadRecords() {
List<TNTPoint> records = new ArrayList<>();
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
@Cleanup
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
while (fileInputStream.getChannel().position() < recordsSaveFile.length()) {
records.add((TNTPoint) inputStream.readObject());
try {
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
@Cleanup
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
while (fileInputStream.getChannel().position() < recordsSaveFile.length()) {
TNTPoint record = (TNTPoint) inputStream.readObject();
records.add(record);
}
} catch (EOFException e) {
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
Map<Integer, List<TNTPoint>> histories = new HashMap<>();

Datei anzeigen

@ -152,7 +152,7 @@ public class TraceManager implements Listener {
.keySet()
.forEach(player -> {
Set<Player> players = followerMap.getOrDefault(player, Collections.emptySet());
tracesByRegion.get(region).values().forEach(trace -> {
tracesByRegion.getOrDefault(region, new HashMap<>()).values().forEach(trace -> {
trace.hide(player);
players.forEach(trace::hide);
});