Add "percentLoaded" to resource statuses.

This commit is contained in:
CalDescent 2023-03-31 17:27:04 +01:00
parent a83e332c11
commit 073d124aef

View File

@ -34,6 +34,7 @@ public class ArbitraryResourceStatus {
private Integer localChunkCount;
private Integer totalChunkCount;
private Float percentLoaded;
public ArbitraryResourceStatus() {
}
@ -45,6 +46,7 @@ public class ArbitraryResourceStatus {
this.description = status.description;
this.localChunkCount = localChunkCount;
this.totalChunkCount = totalChunkCount;
this.percentLoaded = (this.localChunkCount != null && this.totalChunkCount != null) ? this.localChunkCount / (float)this.totalChunkCount * 100.0f : null;
}
public ArbitraryResourceStatus(Status status) {