SteamWar/BauSystem2.0
Archiviert
12
0

Fixed Nullpointer in clear #248

Geschlossen
D4rkr34lm möchte 1 Commits von tracer/fix-nullpointer-and-EOF nach master mergen
2 geänderte Dateien mit 12 neuen und 8 gelöschten Zeilen
Nur Änderungen aus Commit c12e6d0525 werden angezeigt - Alle Commits anzeigen

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<>();
try {
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
@Cleanup
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
while (fileInputStream.getChannel().position() < recordsSaveFile.length()) {
records.add((TNTPoint) inputStream.readObject());
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);
});