Fixed Nullpointer in clear #248
@ -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<>();
|
||||
|
@ -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);
|
||||
});
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren