Inceptum/launcher/src/main/java/io/gitlab/jfronny/inceptum/launcher/system/source/ModSource.java

41 lines
1.1 KiB
Java

package io.gitlab.jfronny.inceptum.launcher.system.source;
import io.gitlab.jfronny.gson.compile.annotations.GSerializable;
import io.gitlab.jfronny.inceptum.common.GsonPreset;
import io.gitlab.jfronny.inceptum.common.MetaHolder;
import io.gitlab.jfronny.inceptum.launcher.gson.ModSourceAdapter;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Optional;
import java.util.Set;
@GSerializable(with = ModSourceAdapter.class, configure = GsonPreset.Api.class)
public interface ModSource {
ModDownload download() throws IOException;
Set<ModSource> getDependencies(String gameVersion) throws IOException;
Optional<ModSource> getUpdate(String gameVersion) throws IOException;
String getVersion();
String getName();
String getShortName();
String getFileName();
String getDescription();
String getSummary();
boolean equals(ModSource other);
boolean projectMatches(ModSource other);
default Path getJarPath() {
return MetaHolder.LIBRARIES_DIR.resolve("com").resolve(getName()).resolve(getFileName());
}
}