A Java library for handling interactions with CurseForge.
All public-facing code is documented with Javadoc and (mostly) tested with JUnit.
The methods found in CurseAPI
can be used to retrieve information about projects and files.
CurseAPI#project(int)
can be used to retrieve aCurseProject
instance for a project ID. ThisCurseProject
instance can then be used to retrieve information about a CurseForge project.CurseAPI#searchProjects(CurseSearchQuery)
can be used with aCurseSearchQuery
instance to search for CurseForge projects.CurseAPI#files(int)
andCurseProject#files
can be used to retrieve aCurseFiles
instance containing all files for a project.CurseFiles
extendsTreeSet
and contains a few utility methods forCurseFile
s.CurseAPI#file(int, int)
can be used to retrieve aCurseFile
instance for a project and file ID.CurseFiles#fileWithID(int)
can be used instead if aCurseFiles
instance is already available.CurseAPI#fileDownloadURL(int, int)
can be used to retrieve a download URL for a project and file ID. If aCurseFile
is already available,CurseFile#downloadURL()
can be used instead.CurseAPI#downloadFile(int, int, Path)
andCurseAPI#downloadFileToDirectory(int, int, Path)
can be used to download a file with a specific project and file ID. If aCurseFile
is already available,CurseFile#download(Path)
andCurseFile#downloadToDirectory(Path)
can be used instead.CurseFiles
instances can be filtered usingCurseFileFilter
s:
final Optional<CurseFiles<CurseFile>> optionalFiles = CurseAPI.files(285612);
if (optionalFiles.isPresent()) {
final CurseFiles<CurseFile> files = optionalFiles.get();
new CurseFileFilter().gameVersionStrings("1.12.2").apply(files);
//Or:
//files.filter(new CurseFileFilter().gameVersionStrings("1.12.2"));
logger.info("Latest 1.12.2 file: {}", files.first());
}
CurseAPI#games()
can be used to retrieve aSet
containingCurseGame
instances that represent all supported games on CurseForge.CurseAPI#streamGames()
can be used to stream these games.CurseAPI#game(int)
can be used to retrieve aCurseGame
instance that represents the CurseForge game with a specific ID.- If an extension such as CurseAPI-Minecraft
is installed,
CurseAPI#gameVersions(int)
can be used to retrieveCurseGameVersion
instances representing versions of the specified game supported by CurseForge. CurseAPI#categories()
andCurseAPI#categories(int)
can be used to retrieve aSet
ofCurseCategory
instances representing CurseForge project categories.CurseAPI#streamCategories()
andCurseAPI#streamCategories(int)
can be used to retrieve aStream
for theseSet
s.CurseAPI#category(int)
can be used to retrieve aCurseCategory
instance representing the CurseForge project category with the specified ID.- In general,
null
values are not returned. Methods in theCurseAPI
class returnOptional
s.
CurseAPI can be found on Jitpack:
repositories {
mavenCentral()
maven {
url "https://jitpack.io"
}
}
dependencies {
api "com.github.TheRandomLabs:CurseAPI:master-SNAPSHOT"
}
CurseAPI uses SLF4J to log warnings, errors and information messages.