feat(mod): WIP: mod update.
This commit is contained in:
@@ -202,10 +202,10 @@ public class Datapack {
|
||||
private Path file;
|
||||
private final BooleanProperty active;
|
||||
private final String id;
|
||||
private final LocalMod.Description description;
|
||||
private final LocalModFile.Description description;
|
||||
private final Datapack datapack;
|
||||
|
||||
public Pack(Path file, String id, LocalMod.Description description, Datapack datapack) {
|
||||
public Pack(Path file, String id, LocalModFile.Description description, Datapack datapack) {
|
||||
this.file = file;
|
||||
this.id = id;
|
||||
this.description = description;
|
||||
@@ -235,7 +235,7 @@ public class Datapack {
|
||||
return id;
|
||||
}
|
||||
|
||||
public LocalMod.Description getDescription() {
|
||||
public LocalModFile.Description getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,14 +64,14 @@ public final class FabricModMetadata {
|
||||
this.contact = contact;
|
||||
}
|
||||
|
||||
public static LocalMod fromFile(File modFile) throws IOException, JsonParseException {
|
||||
public static LocalModFile fromFile(File modFile) throws IOException, JsonParseException {
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(modFile.toPath())) {
|
||||
Path mcmod = fs.getPath("fabric.mod.json");
|
||||
if (Files.notExists(mcmod))
|
||||
throw new IOException("File " + modFile + " is not a Fabric mod.");
|
||||
FabricModMetadata metadata = JsonUtils.fromNonNullJson(FileUtils.readText(mcmod), FabricModMetadata.class);
|
||||
String authors = metadata.authors == null ? "" : metadata.authors.stream().map(author -> author.name).collect(Collectors.joining(", "));
|
||||
return new LocalMod(modFile, ModLoaderType.FABRIC, metadata.id, metadata.name, new LocalMod.Description(metadata.description),
|
||||
return new LocalModFile(modFile, ModLoaderType.FABRIC, metadata.id, metadata.name, new LocalModFile.Description(metadata.description),
|
||||
authors, metadata.version, "", metadata.contact != null ? metadata.contact.getOrDefault("homepage", "") : "", metadata.icon);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public final class ForgeNewModMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
public static LocalMod fromFile(File modFile) throws IOException, JsonParseException {
|
||||
public static LocalModFile fromFile(File modFile) throws IOException, JsonParseException {
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(modFile.toPath())) {
|
||||
Path modstoml = fs.getPath("META-INF/mods.toml");
|
||||
if (Files.notExists(modstoml))
|
||||
@@ -135,7 +135,7 @@ public final class ForgeNewModMetadata {
|
||||
LOG.log(Level.WARNING, "Failed to parse MANIFEST.MF in file " + modFile.getPath());
|
||||
}
|
||||
}
|
||||
return new LocalMod(modFile, ModLoaderType.FORGE, mod.getModId(), mod.getDisplayName(), new LocalMod.Description(mod.getDescription()),
|
||||
return new LocalModFile(modFile, ModLoaderType.FORGE, mod.getModId(), mod.getDisplayName(), new LocalModFile.Description(mod.getDescription()),
|
||||
mod.getAuthors(), mod.getVersion().replace("${file.jarVersion}", jarVersion), "",
|
||||
mod.getDisplayURL(),
|
||||
metadata.getLogoFile());
|
||||
|
||||
@@ -120,7 +120,7 @@ public final class ForgeOldModMetadata {
|
||||
return authors;
|
||||
}
|
||||
|
||||
public static LocalMod fromFile(File modFile) throws IOException, JsonParseException {
|
||||
public static LocalModFile fromFile(File modFile) throws IOException, JsonParseException {
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(modFile.toPath())) {
|
||||
Path mcmod = fs.getPath("mcmod.info");
|
||||
if (Files.notExists(mcmod))
|
||||
@@ -138,7 +138,7 @@ public final class ForgeOldModMetadata {
|
||||
authors = String.join(", ", metadata.getAuthorList());
|
||||
if (StringUtils.isBlank(authors))
|
||||
authors = metadata.getCredits();
|
||||
return new LocalMod(modFile, ModLoaderType.FORGE, metadata.getModId(), metadata.getName(), new LocalMod.Description(metadata.getDescription()),
|
||||
return new LocalModFile(modFile, ModLoaderType.FORGE, metadata.getModId(), metadata.getName(), new LocalModFile.Description(metadata.getDescription()),
|
||||
authors, metadata.getVersion(), metadata.getGameVersion(),
|
||||
StringUtils.isBlank(metadata.getUrl()) ? metadata.getUpdateUrl() : metadata.url,
|
||||
metadata.getLogoFile());
|
||||
|
||||
@@ -108,7 +108,7 @@ public final class LiteModMetadata {
|
||||
return updateURI;
|
||||
}
|
||||
|
||||
public static LocalMod fromFile(File modFile) throws IOException, JsonParseException {
|
||||
public static LocalModFile fromFile(File modFile) throws IOException, JsonParseException {
|
||||
try (ZipFile zipFile = new ZipFile(modFile)) {
|
||||
ZipEntry entry = zipFile.getEntry("litemod.json");
|
||||
if (entry == null)
|
||||
@@ -116,7 +116,7 @@ public final class LiteModMetadata {
|
||||
LiteModMetadata metadata = JsonUtils.GSON.fromJson(IOUtils.readFullyAsString(zipFile.getInputStream(entry)), LiteModMetadata.class);
|
||||
if (metadata == null)
|
||||
throw new IOException("Mod " + modFile + " `litemod.json` is malformed.");
|
||||
return new LocalMod(modFile, ModLoaderType.FORGE, null, metadata.getName(), new LocalMod.Description(metadata.getDescription()), metadata.getAuthor(),
|
||||
return new LocalModFile(modFile, ModLoaderType.FORGE, null, metadata.getName(), new LocalModFile.Description(metadata.getDescription()), metadata.getAuthor(),
|
||||
metadata.getVersion(), metadata.getGameVersion(), metadata.getUpdateURI(), "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
|
||||
*
|
||||
* @author huangyuhui
|
||||
*/
|
||||
public final class LocalMod implements Comparable<LocalMod> {
|
||||
public final class LocalModFile implements Comparable<LocalModFile> {
|
||||
|
||||
private Path file;
|
||||
private final ModLoaderType modLoaderType;
|
||||
@@ -49,11 +49,11 @@ public final class LocalMod implements Comparable<LocalMod> {
|
||||
private final String logoPath;
|
||||
private final BooleanProperty activeProperty;
|
||||
|
||||
public LocalMod(File file, ModLoaderType modLoaderType, String id, String name, Description description) {
|
||||
public LocalModFile(File file, ModLoaderType modLoaderType, String id, String name, Description description) {
|
||||
this(file, modLoaderType, id, name, description, "", "", "", "", "");
|
||||
}
|
||||
|
||||
public LocalMod(File file, ModLoaderType modLoaderType, String id, String name, Description description, String authors, String version, String gameVersion, String url, String logoPath) {
|
||||
public LocalModFile(File file, ModLoaderType modLoaderType, String id, String name, Description description, String authors, String version, String gameVersion, String url, String logoPath) {
|
||||
this.file = file.toPath();
|
||||
this.modLoaderType = modLoaderType;
|
||||
this.id = id;
|
||||
@@ -68,13 +68,13 @@ public final class LocalMod implements Comparable<LocalMod> {
|
||||
activeProperty = new SimpleBooleanProperty(this, "active", !ModManager.isDisabled(file)) {
|
||||
@Override
|
||||
protected void invalidated() {
|
||||
Path path = LocalMod.this.file.toAbsolutePath();
|
||||
Path path = LocalModFile.this.file.toAbsolutePath();
|
||||
|
||||
try {
|
||||
if (get())
|
||||
LocalMod.this.file = ModManager.enableMod(path);
|
||||
LocalModFile.this.file = ModManager.enableMod(path);
|
||||
else
|
||||
LocalMod.this.file = ModManager.disableMod(path);
|
||||
LocalModFile.this.file = ModManager.disableMod(path);
|
||||
} catch (IOException e) {
|
||||
Logging.LOG.log(Level.SEVERE, "Unable to invert state of mod file " + path, e);
|
||||
}
|
||||
@@ -153,13 +153,13 @@ public final class LocalMod implements Comparable<LocalMod> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(LocalMod o) {
|
||||
public int compareTo(LocalModFile o) {
|
||||
return getFileName().compareTo(o.getFileName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof LocalMod && Objects.equals(getFileName(), ((LocalMod) obj).getFileName());
|
||||
return obj instanceof LocalModFile && Objects.equals(getFileName(), ((LocalModFile) obj).getFileName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,18 +168,18 @@ public final class LocalMod implements Comparable<LocalMod> {
|
||||
}
|
||||
|
||||
public static class ModUpdate {
|
||||
private final LocalMod localMod;
|
||||
private final LocalModFile localModFile;
|
||||
private final RemoteMod.Version currentVersion;
|
||||
private final List<RemoteMod.Version> candidates;
|
||||
|
||||
public ModUpdate(LocalMod localMod, RemoteMod.Version currentVersion, List<RemoteMod.Version> candidates) {
|
||||
this.localMod = localMod;
|
||||
public ModUpdate(LocalModFile localModFile, RemoteMod.Version currentVersion, List<RemoteMod.Version> candidates) {
|
||||
this.localModFile = localModFile;
|
||||
this.currentVersion = currentVersion;
|
||||
this.candidates = candidates;
|
||||
}
|
||||
|
||||
public LocalMod getLocalMod() {
|
||||
return localMod;
|
||||
public LocalModFile getLocalMod() {
|
||||
return localModFile;
|
||||
}
|
||||
|
||||
public RemoteMod.Version getCurrentVersion() {
|
||||
@@ -32,7 +32,7 @@ import java.util.TreeSet;
|
||||
public final class ModManager {
|
||||
private final GameRepository repository;
|
||||
private final String id;
|
||||
private final TreeSet<LocalMod> localMods = new TreeSet<>();
|
||||
private final TreeSet<LocalModFile> localModFiles = new TreeSet<>();
|
||||
|
||||
private boolean loaded = false;
|
||||
|
||||
@@ -55,12 +55,12 @@ public final class ModManager {
|
||||
|
||||
private void addModInfo(File file) {
|
||||
try {
|
||||
localMods.add(getModInfo(file));
|
||||
localModFiles.add(getModInfo(file));
|
||||
} catch (IllegalArgumentException ignore) {
|
||||
}
|
||||
}
|
||||
|
||||
public static LocalMod getModInfo(File modFile) {
|
||||
public static LocalModFile getModInfo(File modFile) {
|
||||
File file = isDisabled(modFile) ? new File(modFile.getAbsoluteFile().getParentFile(), FileUtils.getNameWithoutExtension(modFile)) : modFile;
|
||||
String description, extension = FileUtils.getExtension(file);
|
||||
switch (extension) {
|
||||
@@ -98,11 +98,11 @@ public final class ModManager {
|
||||
default:
|
||||
throw new IllegalArgumentException("File " + modFile + " is not a mod file.");
|
||||
}
|
||||
return new LocalMod(modFile, ModLoaderType.UNKNOWN, null, FileUtils.getNameWithoutExtension(modFile), new LocalMod.Description(description));
|
||||
return new LocalModFile(modFile, ModLoaderType.UNKNOWN, null, FileUtils.getNameWithoutExtension(modFile), new LocalModFile.Description(description));
|
||||
}
|
||||
|
||||
public void refreshMods() throws IOException {
|
||||
localMods.clear();
|
||||
localModFiles.clear();
|
||||
if (Files.isDirectory(getModsDirectory())) {
|
||||
try (DirectoryStream<Path> modsDirectoryStream = Files.newDirectoryStream(getModsDirectory())) {
|
||||
for (Path subitem : modsDirectoryStream) {
|
||||
@@ -122,10 +122,10 @@ public final class ModManager {
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
public Collection<LocalMod> getMods() throws IOException {
|
||||
public Collection<LocalModFile> getMods() throws IOException {
|
||||
if (!loaded)
|
||||
refreshMods();
|
||||
return localMods;
|
||||
return localModFiles;
|
||||
}
|
||||
|
||||
public void addMod(File file) throws IOException {
|
||||
@@ -145,9 +145,9 @@ public final class ModManager {
|
||||
addModInfo(newFile);
|
||||
}
|
||||
|
||||
public void removeMods(LocalMod... localMods) throws IOException {
|
||||
for (LocalMod localMod : localMods) {
|
||||
Files.deleteIfExists(localMod.getFile());
|
||||
public void removeMods(LocalModFile... localModFiles) throws IOException {
|
||||
for (LocalModFile localModFile : localModFiles) {
|
||||
Files.deleteIfExists(localModFile.getFile());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,10 @@ public final class ModManager {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public static boolean isOld(File file) {
|
||||
return file.getPath().endsWith(OLD_EXTENSION);
|
||||
}
|
||||
|
||||
public static boolean isDisabled(File file) {
|
||||
return file.getPath().endsWith(DISABLED_EXTENSION);
|
||||
}
|
||||
@@ -228,4 +232,5 @@ public final class ModManager {
|
||||
}
|
||||
|
||||
public static final String DISABLED_EXTENSION = ".disabled";
|
||||
public static final String OLD_EXTENSION = ".old";
|
||||
}
|
||||
|
||||
@@ -66,13 +66,13 @@ public class PackMcMeta implements Validation {
|
||||
private final int packFormat;
|
||||
|
||||
@SerializedName("description")
|
||||
private final LocalMod.Description description;
|
||||
private final LocalModFile.Description description;
|
||||
|
||||
public PackInfo() {
|
||||
this(0, new LocalMod.Description(Collections.emptyList()));
|
||||
this(0, new LocalModFile.Description(Collections.emptyList()));
|
||||
}
|
||||
|
||||
public PackInfo(int packFormat, LocalMod.Description description) {
|
||||
public PackInfo(int packFormat, LocalModFile.Description description) {
|
||||
this.packFormat = packFormat;
|
||||
this.description = description;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class PackMcMeta implements Validation {
|
||||
return packFormat;
|
||||
}
|
||||
|
||||
public LocalMod.Description getDescription() {
|
||||
public LocalModFile.Description getDescription() {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
@@ -112,13 +112,13 @@ public class PackMcMeta implements Validation {
|
||||
}
|
||||
}
|
||||
|
||||
public LocalMod.Description.Part deserialize(JsonElement json, JsonDeserializationContext context) throws JsonParseException {
|
||||
public LocalModFile.Description.Part deserialize(JsonElement json, JsonDeserializationContext context) throws JsonParseException {
|
||||
if (json.isJsonPrimitive()) {
|
||||
return new LocalMod.Description.Part(parseText(json));
|
||||
return new LocalModFile.Description.Part(parseText(json));
|
||||
} else if (json.isJsonObject()) {
|
||||
JsonObject obj = json.getAsJsonObject();
|
||||
String text = parseText(obj.get("text"));
|
||||
return new LocalMod.Description.Part(text);
|
||||
return new LocalModFile.Description.Part(text);
|
||||
} else {
|
||||
throw new JsonParseException("pack.mcmeta Raw JSON text should be string or an object");
|
||||
}
|
||||
@@ -126,31 +126,31 @@ public class PackMcMeta implements Validation {
|
||||
|
||||
@Override
|
||||
public PackInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
|
||||
List<LocalMod.Description.Part> parts = new ArrayList<>();
|
||||
List<LocalModFile.Description.Part> parts = new ArrayList<>();
|
||||
JsonObject packInfo = json.getAsJsonObject();
|
||||
int packFormat = packInfo.get("pack_format").getAsInt();
|
||||
JsonElement description = packInfo.get("description");
|
||||
if (description.isJsonPrimitive()) {
|
||||
parts.add(new LocalMod.Description.Part(parseText(description)));
|
||||
parts.add(new LocalModFile.Description.Part(parseText(description)));
|
||||
} else if (description.isJsonArray()) {
|
||||
for (JsonElement element : description.getAsJsonArray()) {
|
||||
JsonObject descriptionPart = element.getAsJsonObject();
|
||||
parts.add(new LocalMod.Description.Part(descriptionPart.get("text").getAsString(), descriptionPart.get("color").getAsString()));
|
||||
parts.add(new LocalModFile.Description.Part(descriptionPart.get("text").getAsString(), descriptionPart.get("color").getAsString()));
|
||||
}
|
||||
} else {
|
||||
throw new JsonParseException("pack.mcmeta::pack::description should be String or array of text objects with text and color fields");
|
||||
}
|
||||
return new PackInfo(packFormat, new LocalMod.Description(parts));
|
||||
return new PackInfo(packFormat, new LocalModFile.Description(parts));
|
||||
}
|
||||
}
|
||||
|
||||
public static LocalMod fromFile(File modFile) throws IOException, JsonParseException {
|
||||
public static LocalModFile fromFile(File modFile) throws IOException, JsonParseException {
|
||||
try (FileSystem fs = CompressingUtils.createReadOnlyZipFileSystem(modFile.toPath())) {
|
||||
Path mcmod = fs.getPath("pack.mcmeta");
|
||||
if (Files.notExists(mcmod))
|
||||
throw new IOException("File " + modFile + " is not a resource pack.");
|
||||
PackMcMeta metadata = JsonUtils.fromNonNullJson(FileUtils.readText(mcmod), PackMcMeta.class);
|
||||
return new LocalMod(modFile, ModLoaderType.PACK, null, FileUtils.getNameWithoutExtension(modFile), metadata.pack.description, "", "", "", "", "");
|
||||
return new LocalModFile(modFile, ModLoaderType.PACK, null, FileUtils.getNameWithoutExtension(modFile), metadata.pack.description, "", "", "", "", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,14 +82,23 @@ public class RemoteMod {
|
||||
Alpha
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
CURSEFORGE,
|
||||
MODRINTH
|
||||
}
|
||||
|
||||
public interface IMod {
|
||||
List<RemoteMod> loadDependencies() throws IOException;
|
||||
|
||||
Stream<Version> loadVersions() throws IOException;
|
||||
}
|
||||
|
||||
public interface IVersion {
|
||||
Type getType();
|
||||
}
|
||||
|
||||
public static class Version {
|
||||
private final Object self;
|
||||
private final IVersion self;
|
||||
private final String modid;
|
||||
private final String name;
|
||||
private final String version;
|
||||
@@ -101,7 +110,7 @@ public class RemoteMod {
|
||||
private final List<String> gameVersions;
|
||||
private final List<ModLoaderType> loaders;
|
||||
|
||||
public Version(Object self, String modid, String name, String version, String changelog, Instant datePublished, VersionType versionType, File file, List<String> dependencies, List<String> gameVersions, List<ModLoaderType> loaders) {
|
||||
public Version(IVersion self, String modid, String name, String version, String changelog, Instant datePublished, VersionType versionType, File file, List<String> dependencies, List<String> gameVersions, List<ModLoaderType> loaders) {
|
||||
this.self = self;
|
||||
this.modid = modid;
|
||||
this.name = name;
|
||||
@@ -115,7 +124,7 @@ public class RemoteMod {
|
||||
this.loaders = loaders;
|
||||
}
|
||||
|
||||
public Object getSelf() {
|
||||
public IVersion getSelf() {
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface RemoteModRepository {
|
||||
Stream<RemoteMod> search(String gameVersion, Category category, int pageOffset, int pageSize, String searchFilter, int sort)
|
||||
throws IOException;
|
||||
|
||||
Optional<RemoteMod.Version> getRemoteVersionByLocalFile(LocalMod localMod, Path file) throws IOException;
|
||||
Optional<RemoteMod.Version> getRemoteVersionByLocalFile(LocalModFile localModFile, Path file) throws IOException;
|
||||
|
||||
RemoteMod getModById(String id) throws IOException;
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ public class CurseAddon implements RemoteMod.IMod {
|
||||
}
|
||||
|
||||
@Immutable
|
||||
public static class LatestFile {
|
||||
public static class LatestFile implements RemoteMod.IVersion {
|
||||
private final int id;
|
||||
private final String displayName;
|
||||
private final String fileName;
|
||||
@@ -481,6 +481,11 @@ public class CurseAddon implements RemoteMod.IMod {
|
||||
return fileDataInstant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteMod.Type getType() {
|
||||
return RemoteMod.Type.CURSEFORGE;
|
||||
}
|
||||
|
||||
public RemoteMod.Version toVersion() {
|
||||
RemoteMod.VersionType versionType;
|
||||
switch (getReleaseType()) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
package org.jackhuang.hmcl.mod.curse;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.jackhuang.hmcl.mod.LocalMod;
|
||||
import org.jackhuang.hmcl.mod.LocalModFile;
|
||||
import org.jackhuang.hmcl.mod.RemoteMod;
|
||||
import org.jackhuang.hmcl.mod.RemoteModRepository;
|
||||
import org.jackhuang.hmcl.util.MurmurHash2;
|
||||
@@ -71,7 +71,7 @@ public final class CurseForgeRemoteModRepository implements RemoteModRepository
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<RemoteMod.Version> getRemoteVersionByLocalFile(LocalMod localMod, Path file) throws IOException {
|
||||
public Optional<RemoteMod.Version> getRemoteVersionByLocalFile(LocalModFile localModFile, Path file) throws IOException {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try (InputStream stream = Files.newInputStream(file)) {
|
||||
byte[] buf = new byte[1024];
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.jackhuang.hmcl.mod.modrinth;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import org.jackhuang.hmcl.mod.LocalMod;
|
||||
import org.jackhuang.hmcl.mod.LocalModFile;
|
||||
import org.jackhuang.hmcl.mod.ModLoaderType;
|
||||
import org.jackhuang.hmcl.mod.RemoteMod;
|
||||
import org.jackhuang.hmcl.mod.RemoteModRepository;
|
||||
@@ -74,7 +74,7 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<RemoteMod.Version> getRemoteVersionByLocalFile(LocalMod localMod, Path file) throws IOException {
|
||||
public Optional<RemoteMod.Version> getRemoteVersionByLocalFile(LocalModFile localModFile, Path file) throws IOException {
|
||||
String sha1 = Hex.encodeHex(DigestUtils.digest("SHA-1", file));
|
||||
|
||||
try {
|
||||
@@ -198,7 +198,7 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository {
|
||||
}
|
||||
}
|
||||
|
||||
public static class ModVersion {
|
||||
public static class ModVersion implements RemoteMod.IVersion {
|
||||
private final String id;
|
||||
|
||||
@SerializedName("mod_id")
|
||||
@@ -299,6 +299,11 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository {
|
||||
return loaders;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteMod.Type getType() {
|
||||
return RemoteMod.Type.MODRINTH;
|
||||
}
|
||||
|
||||
public Optional<RemoteMod.Version> toVersion() {
|
||||
RemoteMod.VersionType type;
|
||||
if ("release".equals(versionType)) {
|
||||
|
||||
Reference in New Issue
Block a user