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;
|
2022-11-18 21:58:40 +01:00
|
|
|
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-12-25 22:09:51 +01:00
|
|
|
|
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;
|
|
|
|
|
2022-11-18 21:58:40 +01:00
|
|
|
@GSerializable(with = ModSourceAdapter.class, configure = GsonPreset.Api.class)
|
2021-11-02 16:44:26 +01:00
|
|
|
public interface ModSource {
|
2021-12-25 22:09:51 +01:00
|
|
|
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
|
|
|
|
2021-12-25 22:09:51 +01:00
|
|
|
String getFileName();
|
2022-09-04 21:21:24 +02:00
|
|
|
|
2023-07-24 14:29:06 +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
|
|
|
|
2023-07-24 14:29:06 +02:00
|
|
|
boolean projectMatches(ModSource other);
|
|
|
|
|
2021-12-25 22:09:51 +01:00
|
|
|
default Path getJarPath() {
|
2023-05-05 18:49:56 +02:00
|
|
|
return MetaHolder.LIBRARIES_DIR.resolve("com").resolve(getName()).resolve(getFileName());
|
2021-12-25 22:09:51 +01:00
|
|
|
}
|
2021-11-02 16:44:26 +01:00
|
|
|
}
|