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'
}
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);
}