public final class PermissionProvider extends Object
| Modifier and Type | Field and Description |
|---|---|
private static SimpleDateFormat |
simpleDateFormat
The date format for print statements regarding dates.
|
| Constructor and Description |
|---|
PermissionProvider() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPermission(String permissionGroupName,
String permission)
Adds the given permission to the given permission group.
|
static void |
addPlayerGroup(OfflinePlayer player,
String groupName,
long time)
Adds the given permission group by name to the player.
|
static void |
addPlayerPermission(OfflinePlayer offlinePlayer,
String permission)
Adds a permission to the given player.
|
static void |
addServerGroupPermission(String permissionGroupName,
String permission,
String serverGroup)
Adds the given permission to the given permission group for the given
server group.
|
static long |
calculateDays(int value)
Calculates the permission group timeout for the given days in future.
|
PermissionGroup |
createPermissionGroup(String permissionGroupName)
Creates the a new permission group with the given name.
|
static String |
getDisplay(OfflinePlayer offlinePlayer)
Gets the display for the given player by their highest permission group.
|
static String |
getDisplay(UUID uuid)
Gets the display of the player, identified by the given UUID
by their highest permission group.
|
static String |
getGroupDisplay(String groupName)
Gets the permission group display for the given permission group name.
|
static Integer |
getGroupJoinPower(String groupName)
Gets the join power of the specified permission group.
|
static String |
getGroupName(OfflinePlayer offlinePlayer)
Gets the name of the highest permission group for the given player.
|
static String |
getGroupName(UUID uuid)
Gets the name of the highest permission group for the given player
identified by their UUID.
|
static String |
getGroupPrefix(String groupName)
Gets the prefix of the given permission group.
|
static Collection<PermissionGroup> |
getGroups()
Returns all permission groups.
|
static String |
getGroupSuffix(String groupName)
Gets the suffix of the given permission group.
|
static Collection<String> |
getImplementedGroups(String groupName)
Gets the implemented permission groups of the specified permission group.
|
static int |
getJoinPower(OfflinePlayer player)
Gets the highest join power of the given player.
|
static PermissionGroup |
getPermissionGroup(String groupName)
Returns the specified permission group by name.
|
static long |
getPlayerGroupRemainingTime(OfflinePlayer offlinePlayer)
Gets the timeout of the player in their highest permission group.
|
static String |
getPlayerGroups(OfflinePlayer offlinePlayer)
Gets a string representation of the permission groups of the given player.
|
static int |
getPlayerGroupTagID(OfflinePlayer offlinePlayer)
Gets the TagID of the highest permission group of the given player.
|
static String |
getPrefix(OfflinePlayer offlinePlayer)
Gets the prefix of the given player by their highest permission group.
|
static String |
getPrefix(UUID uuid)
Gets the prefix of the given player identified by their UUID
by their highest permission group.
|
static String |
getSuffix(OfflinePlayer offlinePlayer)
Gets the suffix of the given player by their highest permission group.
|
static String |
getSuffix(UUID uuid)
Gets the suffix of the given player identified by their UUID
by their highest permission group.
|
static boolean |
isInGroup(String groupName,
OfflinePlayer offlinePlayer)
Checks if the player is in the specified permission group.
|
static void |
removePermission(String permissionGroupName,
String permission)
Removes the given permission from the given permission group.
|
static void |
removePlayerGroup(String groupName,
OfflinePlayer offlinePlayer)
Removes the given permission group by name from the given player.
|
static void |
removePlayerPermission(OfflinePlayer offlinePlayer,
String permission)
Removes a permission from the given player.
|
static void |
removeServerGroupPermission(String permissionGroupName,
String permission,
String serverGroup)
Removes the given permission from the given permission group for the given
server group.
|
static void |
setDefaultGroup(String groupName)
Sets the default permission group.
|
static void |
setDisplay(String groupName,
String display)
Sets the display for the given group by name.
|
static void |
setJoinPower(String groupName,
int joinPower)
Sets the join power of the specified permission group by name.
|
static void |
setPlayerGroup(OfflinePlayer offlinePlayer,
String groupName,
long time)
Sets permission group for the given player.
|
static void |
setPrefix(String groupName,
String prefix)
Sets the prefix for the given group by name.
|
static void |
setSuffix(String groupName,
String suffix)
Sets the suffix for the given group by name.
|
static void |
setTagID(String groupName,
int tagId)
Sets the tag id of the given permission group by name.
|
static void |
updatePermissionGroup(PermissionGroup permissionGroup)
Updates the permission group in the database.
|
static void |
updatePlayer(OfflinePlayer offlinePlayer)
Updates the given player in the player database.
|
private static final SimpleDateFormat simpleDateFormat
public static long calculateDays(int value)
value - the amount of daysPermissionGrouppublic static String getDisplay(OfflinePlayer offlinePlayer)
offlinePlayer - the player to get the display forPermissionGroup,
getDisplay(UUID)public static String getDisplay(UUID uuid)
uuid - the UUID of the playerPermissionGroup,
getDisplay(OfflinePlayer)public static String getSuffix(OfflinePlayer offlinePlayer)
offlinePlayer - the player to get the suffix forPermissionGroup,
getSuffix(UUID)public static String getSuffix(UUID uuid)
uuid - the UUID of the playerPermissionGroup,
getSuffix(OfflinePlayer)public static String getPrefix(OfflinePlayer offlinePlayer)
offlinePlayer - the player to get the prefix forPermissionGroup,
getPrefix(UUID)public static String getPrefix(UUID uuid)
uuid - the UUID of the playerPermissionGroup,
getPrefix(OfflinePlayer)public static String getGroupName(UUID uuid)
uuid - the UUID of the playergetGroupName(OfflinePlayer),
PermissionGroup,
PermissionEntitypublic static String getGroupPrefix(String groupName)
groupName - the name of the permission groupnull,
if the group doesn't exist.PermissionGroup,
PermissionPoolpublic static String getGroupSuffix(String groupName)
groupName - the name of the groupnull,
if the group doesn't exist.PermissionGroup,
PermissionPoolpublic static boolean isInGroup(String groupName, OfflinePlayer offlinePlayer)
groupName - the name of the groupofflinePlayer - the player to check for group membershipPermissionEntitypublic static String getGroupDisplay(String groupName)
groupName - the name of the groupPermissionGrouppublic static Collection<String> getImplementedGroups(String groupName)
groupName - the permission groupPermissionGrouppublic static int getJoinPower(OfflinePlayer player)
player - the playerPermissionGrouppublic static Integer getGroupJoinPower(String groupName)
groupName - the name of the grouppublic static int getPlayerGroupTagID(OfflinePlayer offlinePlayer)
offlinePlayer - the playerPermissionGrouppublic static long getPlayerGroupRemainingTime(OfflinePlayer offlinePlayer)
offlinePlayer - the player to get the timeout forGroupEntityDatapublic static String getGroupName(OfflinePlayer offlinePlayer)
offlinePlayer - the player to get the name of their highest
permission group for.getGroupName(UUID),
PermissionGroup,
PermissionEntitypublic static void addPlayerPermission(OfflinePlayer offlinePlayer, String permission)
offlinePlayer - the player to add the permission topermission - the permission to addpublic static void updatePlayer(OfflinePlayer offlinePlayer)
offlinePlayer - the player to updatepublic static void removePlayerPermission(OfflinePlayer offlinePlayer, String permission)
offlinePlayer - the player to remove the permission frompermission - the permission to removepublic static void addPermission(String permissionGroupName, String permission)
permissionGroupName - the name of the permission group
to add the permission to.permission - the permission to addpublic static void updatePermissionGroup(PermissionGroup permissionGroup)
permissionGroup - the permission group to updatepublic static void removePermission(String permissionGroupName, String permission)
permissionGroupName - the name of the permission group to remove the
permission from.permission - the permission to remove.public static void addServerGroupPermission(String permissionGroupName, String permission, String serverGroup)
permissionGroupName - the name of the permission group
to add the permission to.permission - the permission to addserverGroup - the server group to restrict the permission topublic static void removeServerGroupPermission(String permissionGroupName, String permission, String serverGroup)
permissionGroupName - the name of the permission group
to remove the permission from.permission - the permission to removeserverGroup - the server group to remove the permission frompublic static void setPlayerGroup(OfflinePlayer offlinePlayer, String groupName, long time)
offlinePlayer - the player to set the permission groups forgroupName - the group name of the group to addtime - the time after which the group will be removedGroupEntityDatapublic static void addPlayerGroup(OfflinePlayer player, String groupName, long time)
player - the player to add the permission group to.groupName - the group to add to the playertime - the time after which the group will be removedGroupEntityDatapublic static void removePlayerGroup(String groupName, OfflinePlayer offlinePlayer)
groupName - the name of the permission group to removeofflinePlayer - the player to remove the permission group fromPermissionGrouppublic static String getPlayerGroups(OfflinePlayer offlinePlayer)
offlinePlayer - the player to get the groups as a string forpublic static Collection<PermissionGroup> getGroups()
public static PermissionGroup getPermissionGroup(String groupName)
groupName - the name of the group to getpublic static void setDisplay(String groupName, String display)
groupName - the name of the groupdisplay - the display to setpublic static void setPrefix(String groupName, String prefix)
groupName - the name of the groupprefix - the prefix to setpublic static void setSuffix(String groupName, String suffix)
groupName - the name of the groupsuffix - the suffix to setpublic static void setDefaultGroup(String groupName)
groupName - the name of the group to set as defaultpublic static void setJoinPower(String groupName, int joinPower)
groupName - the name of the groupjoinPower - the new join power of the grouppublic static void setTagID(String groupName, int tagId)
groupName - the name of the grouptagId - the new tag id.public PermissionGroup createPermissionGroup(String permissionGroupName)
permissionGroupName - the name of the new permission groupnull, if the group already
exists.Copyright © 2020. All rights reserved.