-
Notifications
You must be signed in to change notification settings - Fork 0
Developer API
realpeyaj edited this page Jul 6, 2026
·
6 revisions
This page explains how to compile against and integrate with the peyajAuth API.
Since peyajAuth is obfuscated for security, we explicitly protect the API package from name scrambling. You can compile your custom plugins against it by using your compiled peyajAuth.jar as a local project dependency.
Place the peyajAuth.jar into your project's libs directory and configure your build tool:
repositories {
flatDir {
dirs("libs")
}
}
dependencies {
compileOnly(files("libs/peyajAuth.jar"))
}<dependency>
<groupId>me.peyaj</groupId>
<artifactId>peyajauth</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/libs/peyajAuth.jar</systemPath>
</dependency>To ensure your plugin loads after peyajAuth:
depend: [peyajAuth]You can retrieve the singleton API provider instance:
import me.peyaj.peyajauth.api.PeyajAuthAPI;
import org.bukkit.entity.Player;
public class MyPlugin {
public void performAction(Player player) {
// Fetch instance
PeyajAuthAPI api = PeyajAuthAPI.getInstance();
// Check if authenticated
if (api.isAuthenticated(player)) {
player.sendMessage("Welcome back, verified user!");
}
// Check if premium account
if (api.isPremium(player.getUniqueId())) {
player.sendMessage("Using official Mojang account!");
}
}
}