forked from TerraformersMC/ModMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModrinthUpdateInfo.java
More file actions
45 lines (36 loc) · 1.06 KB
/
ModrinthUpdateInfo.java
File metadata and controls
45 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.terraformersmc.modmenu.util.mod;
import com.terraformersmc.modmenu.api.UpdateChannel;
import com.terraformersmc.modmenu.api.UpdateInfo;
public class ModrinthUpdateInfo implements UpdateInfo {
protected final String projectId;
protected final String versionId;
protected final String versionNumber;
protected final UpdateChannel updateChannel;
public ModrinthUpdateInfo(String projectId, String versionId, String versionNumber, UpdateChannel updateChannel) {
this.projectId = projectId;
this.versionId = versionId;
this.versionNumber = versionNumber;
this.updateChannel = updateChannel;
}
@Override
public boolean isUpdateAvailable() {
return true;
}
@Override
public String getDownloadLink() {
return "https://modrinth.com/project/%s/version/%s".formatted(projectId, versionId);
}
public String getProjectId() {
return projectId;
}
public String getVersionId() {
return versionId;
}
public String getVersionNumber() {
return versionNumber;
}
@Override
public UpdateChannel getUpdateChannel() {
return this.updateChannel;
}
}