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

41 lines
1.1 KiB
Java
Raw Normal View History

2022-09-04 21:21:24 +02:00
package io.gitlab.jfronny.inceptum.launcher.system.source;
2021-11-02 16:44:26 +01:00
2022-11-02 00:38:04 +01:00
import io.gitlab.jfronny.gson.compile.annotations.GSerializable;
import io.gitlab.jfronny.inceptum.common.GsonPreset;
2022-09-04 21:21:24 +02:00
import io.gitlab.jfronny.inceptum.common.MetaHolder;
2022-11-02 00:38:04 +01:00
import io.gitlab.jfronny.inceptum.launcher.gson.ModSourceAdapter;
2021-11-02 16:44:26 +01:00
import java.io.IOException;
import java.nio.file.Path;
2021-11-02 17:25:34 +01:00
import java.util.Optional;
2021-11-02 16:44:26 +01:00
import java.util.Set;
@GSerializable(with = ModSourceAdapter.class, configure = GsonPreset.Api.class)
2021-11-02 16:44:26 +01:00
public interface ModSource {
ModDownload download() throws IOException;
2022-09-04 21:21:24 +02:00
2022-06-05 16:45:22 +02:00
Set<ModSource> getDependencies(String gameVersion) throws IOException;
2022-09-04 21:21:24 +02:00
2021-11-02 17:25:34 +01:00
Optional<ModSource> getUpdate(String gameVersion) throws IOException;
2022-09-04 21:21:24 +02:00
2021-11-02 17:25:34 +01:00
String getVersion();
2022-09-04 21:21:24 +02:00
2021-11-04 14:07:34 +01:00
String getName();
2022-09-04 21:21:24 +02:00
2021-12-28 13:13:48 +01:00
String getShortName();
2022-09-04 21:21:24 +02:00
String getFileName();
2022-09-04 21:21:24 +02:00
String getDescription();
String getSummary();
2021-11-02 19:52:35 +01:00
boolean equals(ModSource other);
2022-09-04 21:21:24 +02:00
boolean projectMatches(ModSource other);
default Path getJarPath() {
return MetaHolder.LIBRARIES_DIR.resolve("com").resolve(getName()).resolve(getFileName());
}
2021-11-02 16:44:26 +01:00
}