Code Monkey home page Code Monkey logo

curseapi's Introduction

CurseAPI

License: MIT

Build Dependabot

Average time to resolve an issue

A Java library for handling interactions with CurseForge.

All public-facing code is documented with Javadoc and (mostly) tested with JUnit.

Usage

The methods found in CurseAPI can be used to retrieve information about projects and files.

  • CurseAPI#project(int) can be used to retrieve a CurseProject instance for a project ID. This CurseProject instance can then be used to retrieve information about a CurseForge project.
  • CurseAPI#searchProjects(CurseSearchQuery) can be used with a CurseSearchQuery instance to search for CurseForge projects.
  • CurseAPI#files(int) and CurseProject#files can be used to retrieve a CurseFiles instance containing all files for a project. CurseFiles extends TreeSet and contains a few utility methods for CurseFiles.
  • CurseAPI#file(int, int) can be used to retrieve a CurseFile instance for a project and file ID. CurseFiles#fileWithID(int) can be used instead if a CurseFiles instance is already available.
  • CurseAPI#fileDownloadURL(int, int) can be used to retrieve a download URL for a project and file ID. If a CurseFile is already available, CurseFile#downloadURL() can be used instead.
  • CurseAPI#downloadFile(int, int, Path) and CurseAPI#downloadFileToDirectory(int, int, Path) can be used to download a file with a specific project and file ID. If a CurseFile is already available, CurseFile#download(Path) and CurseFile#downloadToDirectory(Path) can be used instead.
  • CurseFiles instances can be filtered using CurseFileFilters:
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 a Set containing CurseGame 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 a CurseGame 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 retrieve CurseGameVersion instances representing versions of the specified game supported by CurseForge.
  • CurseAPI#categories() and CurseAPI#categories(int) can be used to retrieve a Set of CurseCategory instances representing CurseForge project categories. CurseAPI#streamCategories() and CurseAPI#streamCategories(int) can be used to retrieve a Stream for these Sets.
  • CurseAPI#category(int) can be used to retrieve a CurseCategory instance representing the CurseForge project category with the specified ID.
  • In general, null values are not returned. Methods in the CurseAPI class return Optionals.

Using with Gradle

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.

curseapi's People

Contributors

dependabot-preview[bot] avatar therandomlabs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.