Made hacky fix for EOF
Dieser Commit ist enthalten in:
Ursprung
4a334d8693
Commit
c12e6d0525
@ -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<>();
|
||||
|
@ -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