Add Api
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package me.lucko.luckperms;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.lucko.luckperms.api.LuckPermsApi;
|
||||
|
||||
/**
|
||||
* Static access to LuckPerms
|
||||
*/
|
||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class LuckPerms {
|
||||
|
||||
private static LuckPermsApi api = null;
|
||||
|
||||
public static LuckPermsApi getApi() {
|
||||
if (api == null) {
|
||||
throw new IllegalStateException("API is not loaded.");
|
||||
}
|
||||
return api;
|
||||
}
|
||||
|
||||
static void registerProvider(LuckPermsApi luckPermsApi) {
|
||||
api = luckPermsApi;
|
||||
}
|
||||
|
||||
static void unregisterProvider() {
|
||||
api = null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user