package net.knarcraft.timeismoney.manager; import net.milkbowl.vault.permission.Permission; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; /** * A manager that performs all Permission tasks */ public final class PermissionManager { private static Permission permission; private PermissionManager() { } /** * Initializes the permission manager * * @param permission
The permission object to use for everything permission-related
*/ public static void initialize(@NotNull Permission permission) { PermissionManager.permission = permission; } /** * Checks whether the permission manager has been initialized * * @returnTrue if the permission manager has been initialized
*/ public static boolean isInitialized() { return PermissionManager.permission != null; } /** * Gets all groups of a player * * @param playerThe player to get the groups for
* @returnThe player's groups
*/ public static @NotNull String[] getPlayerGroups(@NotNull Player player) { return permission.getPlayerGroups(player); } }