A Modrinth API wrapper for Kotlin.
Getting Started
Usage
Import Kotrinth
Add the repository and dependency to your build.gradle.kts
:
Beta, Alpha (Snapshots Repo)
maven {
name = "TheClashFruit's Maven Snapshots"
url = uri("https://mvn.theclashfruit.me/snapshots")
}
Stable (Releases Repo)
maven {
name = "TheClashFruit's Maven Releases"
url = uri("https://mvn.theclashfruit.me/releases")
}
implementation("me.theclashfruit:kotrinth:$version")
Example
package com.example
import me.theclashfruit.kotrinth.v2.Kotrinth
suspend fun main() {
// Create a new Kotrinth instance.
val kotrinth = Kotrinth(
appName = "Example",
appVersion = "1.0.0",
appContact = "admin@example.com"
)
// Get a user by their username.
val user = kotrinth.user("TheClashFruit")
// Print the user's id.
println(user.id)
}
Cloning
This repository doesn't use any special stuff, so we can clone it in to old-fashioned way of git clone https://github.com/TheClashFruit/Kotrinth.git
.
Building
Building is also straight forward, open the project in your desired code editor, IDE or just a terminal then just run ./gradlew build
in a terminal.
Contributing
You can read the CONTRIBUTING.md file for details on the project's code of conduct, and the process for submitting pull requests to this project, have fun!
License
This project is licensed under MIT, if you want to learn more check the LICENSE file.