Skip to content

PermissionAPI for LuckPerms, GroupManager and PermissionsEX

Notifications You must be signed in to change notification settings

DiesesFloo/PermissionAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PermissionAPI

Compatible plugins

How to install the API?

Step 1
Add the Spigot plugin to your server.

Step 2
Add jitpack repository to you project.

Maven (pom.xml):

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Gradle (build.gradle):

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

Step 3
Add dependency to project

Maven (pom.xml):

<dependency>
    <groupId>com.github.DiesesFloo.PermissionAPI</groupId>
    <artifactId>api</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle (build.gradle)

dependencies {
    implementation 'com.github.DiesesFloo.PermissionAPI:api:1.0.0'
}

How to use the API?

Check if player has a permission

public boolean playerHasPermission(UUID uuid, String permission) {
    if (!Permission.isInitialized()) return false;
    return Permission.get().has(uuid, permission); 
}

Add permission to player

public void addPermissionToPlayer(UUID uuid, String permission) {
    if (!Permission.isInitialized()) return;
    Permission.get().add(uuid, permission); 
}

Remove permission from player

public void addPermissionToPlayer(UUID uuid, String permission) {
    if (!Permission.isInitialized()) return;
    Permission.get().remove(uuid, permission); 
}