Fixed Nullpointer in clear #248
@ -308,16 +308,20 @@ public class Trace {
|
|||||||
/**
|
/**
|
||||||
* Loads the records of this trace from storage to memory
|
* Loads the records of this trace from storage to memory
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
|
||||||
private void loadRecords() {
|
private void loadRecords() {
|
||||||
List<TNTPoint> records = new ArrayList<>();
|
List<TNTPoint> records = new ArrayList<>();
|
||||||
|
|
||||||
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
|
try {
|
||||||
|
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
|
||||||
@Cleanup
|
@Cleanup
|
||||||
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
|
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
|
||||||
while (fileInputStream.getChannel().position() < recordsSaveFile.length()) {
|
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<>();
|
Map<Integer, List<TNTPoint>> histories = new HashMap<>();
|
||||||
|
@ -152,7 +152,7 @@ public class TraceManager implements Listener {
|
|||||||
.keySet()
|
.keySet()
|
||||||
.forEach(player -> {
|
.forEach(player -> {
|
||||||
Set<Player> players = followerMap.getOrDefault(player, Collections.emptySet());
|
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);
|
trace.hide(player);
|
||||||
players.forEach(trace::hide);
|
players.forEach(trace::hide);
|
||||||
});
|
});
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren