Skip to content

Commit

Permalink
显示 Forge 发版时间 (#3256)
Browse files Browse the repository at this point in the history
* 显示时间

* Fix

* update

* update

---------

Co-authored-by: Glavo <zjx001202@gmail.com>
  • Loading branch information
zkitefly and Glavo authored Aug 30, 2024
1 parent 738000f commit 48417b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public final class ForgeVersion implements Validation {
private final String jobver;
private final String version;
private final int build;
private final double modified;
private final long modified;
private final String[][] files;

/**
Expand All @@ -44,7 +44,7 @@ public ForgeVersion() {
this(null, null, null, null, 0, 0, null);
}

public ForgeVersion(String branch, String mcversion, String jobver, String version, int build, double modified, String[][] files) {
public ForgeVersion(String branch, String mcversion, String jobver, String version, int build, long modified, String[][] files) {
this.branch = branch;
this.mcversion = mcversion;
this.jobver = jobver;
Expand Down Expand Up @@ -74,7 +74,7 @@ public int getBuild() {
return build;
}

public double getModified() {
public long getModified() {
return modified;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.jackhuang.hmcl.util.io.HttpRequest;
import org.jackhuang.hmcl.util.versioning.VersionNumber;

import java.time.Instant;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -79,8 +80,12 @@ public CompletableFuture<?> refreshAsync() {

if (jar == null)
continue;

versions.put(gameVersion, new ForgeRemoteVersion(
toLookupVersion(version.getGameVersion()), version.getVersion(), null, Collections.singletonList(jar)
toLookupVersion(version.getGameVersion()),
version.getVersion(),
version.getModified() > 0 ? Instant.ofEpochSecond(version.getModified()) : null,
Collections.singletonList(jar)
));
}
}
Expand Down

0 comments on commit 48417b9

Please sign in to comment.