forked from SteamWar/SteamWar
Fixed trace record count in trace objects created through recording
This commit is contained in:
@@ -27,6 +27,7 @@ import de.steamwar.bausystem.region.Region;
|
||||
import de.steamwar.entity.REntity;
|
||||
import de.steamwar.entity.REntityServer;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.SneakyThrows;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -72,8 +73,9 @@ public class Trace {
|
||||
*/
|
||||
private SoftReference<List<TNTPoint>> records;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
private final int recordsCount;
|
||||
private int recordsCount;
|
||||
|
||||
/**
|
||||
* A map of all REntityServers rendering this trace
|
||||
@@ -91,7 +93,6 @@ public class Trace {
|
||||
this.uuid = UUID.randomUUID();
|
||||
this.region = region;
|
||||
this.date = new Date();
|
||||
recordsCount = recordList.size();
|
||||
records = new SoftReference<>(recordList);
|
||||
recordsSaveFile = new File(TraceRepository.tracesFolder, uuid + ".records");
|
||||
metadataSaveFile = new File(TraceRepository.tracesFolder, uuid + ".meta");
|
||||
@@ -310,6 +311,7 @@ public class Trace {
|
||||
", region=" + region +
|
||||
", creationTime=" + date +
|
||||
", recordsSaveFile=" + recordsSaveFile.getName() +
|
||||
", recordCount=" + recordsCount +
|
||||
", records=" + getRecords() +
|
||||
'}';
|
||||
}
|
||||
|
||||
+1
@@ -65,6 +65,7 @@ public class TraceRecordingWrapper {
|
||||
TraceManager.instance.showPartial(trace, recordsToAdd);
|
||||
|
||||
recordList.addAll(recordsToAdd);
|
||||
trace.setRecordsCount(recordList.size());
|
||||
recordsToAdd.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user