Some updates
This commit is contained in:
parent
1f10d8a59a
commit
ce5ee87317
|
@ -1,6 +1,5 @@
|
|||
package ley.anvil.addonscript.curse;
|
||||
|
||||
import com.therandomlabs.curseapi.file.CurseFile;
|
||||
import ley.anvil.addonscript.v1.AddonscriptJSON;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -27,7 +26,19 @@ public class CurseTools {
|
|||
}
|
||||
|
||||
public static String toArtifact(int projectID, int fileID) {
|
||||
return "curse:" + projectID + ":" + fileID;
|
||||
return "curse>" + projectID + ":" + fileID;
|
||||
}
|
||||
|
||||
public static boolean isCurseArtifact(String artifact, AddonscriptJSON as) {
|
||||
String[] parts = artifact.split(">");
|
||||
if (parts.length == 2 && as.repositories != null) {
|
||||
for (AddonscriptJSON.Repository repo : as.repositories) {
|
||||
if (repo.type != null && repo.type.equals("curseforge") && parts[0].equals(repo.id)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class ForgeTools {
|
|||
rel.type = "included";
|
||||
}
|
||||
rel.installer = "internal.forge";
|
||||
rel.file = forgeVersion;
|
||||
rel.file = "forge>"+ forgeVersion;
|
||||
if (ver.relations == null) {
|
||||
ver.relations = new ArrayList<>();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
package ley.anvil.addonscript.util;
|
||||
|
||||
/**
|
||||
* Interface for all repository types
|
||||
*/
|
||||
public interface IRepository {
|
||||
|
||||
/**
|
||||
* Gets the file URL from an artifact
|
||||
* @param artifact The artifact without the repo ID prefix
|
||||
* @return The URL of the file
|
||||
*/
|
||||
String getFileURL(String artifact);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue