Basic API Information - kyngs/LibreLogin GitHub Wiki

LibreLogin offers a vast API, which allows you to fit LibreLogin exactly to your needs. If you are clueless about what something does, fill up an issue, and I will try to answer it ASAP.

Obtaining

Adding the repository

Gradle (KTS):

maven("https://repo.kyngs.xyz/public")

Gradle (Groovy):

maven {
    url "https://repo.kyngs.xyz/public"
}

Maven:

<repository>
  <id>kyngs-repo-public</id>
  <name>Repository</name>
  <url>https://repo.kyngs.xyz/public</url>
</repository>

Adding the artifact

Substitute <version> for the version you want to depend on. You can browse available releases here, or you can browse available snapshots (dev builds) here.

Gradle (KTS):

compileOnly("xyz.kyngs.librelogin:API:<version>")

Gradle (Groovy):

compileOnly "xyz.kyngs.librelogin:API:<version>"

Maven

<dependency>
  <groupId>xyz.kyngs.librelogin</groupId>
  <artifactId>API</artifactId>
  <version><version></version>
  <scope>provided</scope>
</dependency>

I am writing a plugin for...

Paper, Purpur, etc.

You must declare "LibreLogin" as a dependency in your plugin.yml. Then you can get the API instance:

var api = ((LibreLoginProvider<Player, World>) Bukkit.getPluginManager().getPlugin("LibreLogin")).getLibreLogin();

Velocity

You must declare "librelogin" as a dependency in your plugin annotation. Then you can get the API instance:

var api = ((LibreLoginProvider<Player, RegisteredServer>) server.getPluginManager().getPlugin("librelogin").orElseThrow().getInstance().orElseThrow()).getLibreLogin();

BungeeCord, Waterfall, Flamecord, etc.

You must declare "LibreLogin" as a dependency in your plugin.yml/bungee.yml. Then you can get the API instance:

var api = ((LibreLoginProvider<ProxiedPlayer, ServerInfo>) getProxy().getPluginManager().getPlugin("librelogin")).getLibreLogin();

multiple platforms.

You must get the LibreLogin plugin instance from your platform's plugin manager. Then you need to cast it into LibreLoginProvider<?, ?>

Usage

All methods in the API are documented. Sources should be downloaded by your IDE, so you can just look into it. For events, see API Events

Warnings

If there is a feature that is contained in the implementation, but not in the API, please open up an issue and we will solve it

⚠️ **GitHub.com Fallback** ⚠️