Package net.alpenblock.bungeeperms
Class BungeePermsAPI
- java.lang.Object
-
- net.alpenblock.bungeeperms.BungeePermsAPI
-
public class BungeePermsAPI extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description BungeePermsAPI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
groupAdd(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Adds the given permission to the groupstatic boolean
groupAddInheritance(java.lang.String group, java.lang.String groupadd)
Adds an inheritance to the groupstatic boolean
groupAddTimedInheritance(java.lang.String group, java.lang.String groupadd, java.util.Date start, int dur)
Adds a timed inheritance to the groupstatic java.lang.String
groupDisplay(java.lang.String group, java.lang.String server, java.lang.String world)
Gets the display of the given groupstatic boolean
groupHas(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Tests if a group has the given permissionstatic java.lang.String
groupPrefix(java.lang.String group, java.lang.String server, java.lang.String world)
Gets the full prefix of the given groupstatic boolean
groupRemove(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given permission from the groupstatic boolean
groupRemoveInheritance(java.lang.String group, java.lang.String groupremove)
Removes an inheritance from the groupstatic boolean
groupRemoveTimedInheritance(java.lang.String group, java.lang.String groupremove)
Removes a timed inheritance from the groupstatic java.util.List<java.lang.String>
groups()
Get all available groupsstatic java.lang.String
groupSuffix(java.lang.String group, java.lang.String server, java.lang.String world)
Gets the full suffix of the given groupstatic boolean
groupTimedAdd(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world, java.util.Date start, int dur)
Adds the given timed permission to the groupstatic boolean
groupTimedRemove(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given timed permission from the groupstatic boolean
hasSuperPermsCompat()
Whether or not super perms compat is enabledstatic boolean
userAdd(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Adds the given permission to the playerstatic boolean
userAddGroup(java.lang.String nameoruuid, java.lang.String group)
Adds a timed group to the playerstatic boolean
userAddTimedGroup(java.lang.String nameoruuid, java.lang.String group, java.util.Date start, int dur)
Adds a timed group to the playerstatic java.util.List<java.lang.String>
userAllGroups(java.lang.String nameoruuid)
Gets all ("normal" and timed) groups of the playerstatic java.util.List<java.lang.String>
userGroups(java.lang.String nameoruuid)
Get the "normal" groups of the playerstatic boolean
userHasPermission(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Tests if the player has the given permissionstatic boolean
userInGroup(java.lang.String nameoruuid, java.lang.String group)
Tests if the player is in a groupstatic boolean
userIsPermissionSet(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Tests if the player has the given permission set explictlystatic java.lang.String
userMainGroup(java.lang.String nameoruuid)
Gets the primary/main group to the given usersstatic java.lang.String
userPrefix(java.lang.String nameoruuid, java.lang.String server, java.lang.String world)
Gets the full prefix of the playerstatic boolean
userRemove(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given permission to the playerstatic boolean
userRemoveGroup(java.lang.String nameoruuid, java.lang.String group)
Removes a group from the playerstatic boolean
userRemoveTimedGroup(java.lang.String nameoruuid, java.lang.String group)
Removes a timed group from the playerstatic java.lang.String
userSuffix(java.lang.String nameoruuid, java.lang.String server, java.lang.String world)
Gets the full suffix of the playerstatic boolean
userTimedAdd(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world, java.util.Date start, int dur)
Adds the given timed permission to the playerstatic java.util.List<java.lang.String>
userTimedGroups(java.lang.String nameoruuid)
Gets the timed groups of the playerstatic boolean
userTimedRemove(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given timed permission to the player
-
-
-
Method Detail
-
groups
public static java.util.List<java.lang.String> groups()
Get all available groups- Returns:
- all available groups
-
groupHas
public static boolean groupHas(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Tests if a group has the given permission- Parameters:
group
- the grouppermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- whether or not the group has the permission
-
groupAdd
public static boolean groupAdd(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Adds the given permission to the group- Parameters:
group
- the grouppermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- true if the permission has been added successfully
-
groupRemove
public static boolean groupRemove(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given permission from the group- Parameters:
group
- the grouppermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- true if the permission has been removed successfully
-
groupTimedAdd
public static boolean groupTimedAdd(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world, java.util.Date start, int dur)
Adds the given timed permission to the group- Parameters:
group
- the grouppermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be nullstart
- when the permission takes effectdur
- the duration in seconds the permission is active- Returns:
- true if the permission has been added successfully
-
groupTimedRemove
public static boolean groupTimedRemove(java.lang.String group, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given timed permission from the group- Parameters:
group
- the grouppermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- true if the permission has been removed successfully
-
groupAddInheritance
public static boolean groupAddInheritance(java.lang.String group, java.lang.String groupadd)
Adds an inheritance to the group- Parameters:
group
- the groupgroupadd
- the group to add as inheritance- Returns:
- true if the inheritance has been added successfully
-
groupRemoveInheritance
public static boolean groupRemoveInheritance(java.lang.String group, java.lang.String groupremove)
Removes an inheritance from the group- Parameters:
group
- the groupgroupremove
- the group to remove as inheritance- Returns:
- true if the inheritance has been removed successfully
-
groupAddTimedInheritance
public static boolean groupAddTimedInheritance(java.lang.String group, java.lang.String groupadd, java.util.Date start, int dur)
Adds a timed inheritance to the group- Parameters:
group
- the groupgroupadd
- the group to add as inheritancestart
- when the inheritance takes effectdur
- the duration in seconds the inheritance is active- Returns:
- true if the inheritance has been added successfully
-
groupRemoveTimedInheritance
public static boolean groupRemoveTimedInheritance(java.lang.String group, java.lang.String groupremove)
Removes a timed inheritance from the group- Parameters:
group
- the groupgroupremove
- the group to remove as inheritance- Returns:
- true if the inheritance has been removed successfully
-
groupPrefix
public static java.lang.String groupPrefix(java.lang.String group, java.lang.String server, java.lang.String world)
Gets the full prefix of the given group- Parameters:
group
- the groupserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- the full prefix; may be null
-
groupSuffix
public static java.lang.String groupSuffix(java.lang.String group, java.lang.String server, java.lang.String world)
Gets the full suffix of the given group- Parameters:
group
- the groupserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- the full suffix; may be null
-
groupDisplay
public static java.lang.String groupDisplay(java.lang.String group, java.lang.String server, java.lang.String world)
Gets the display of the given group- Parameters:
group
- the groupserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- the display; may be null
-
userMainGroup
public static java.lang.String userMainGroup(java.lang.String nameoruuid)
Gets the primary/main group to the given users- Parameters:
nameoruuid
- the username or uuid of the player- Returns:
- the primary/main group of the player; may be null
-
userGroups
public static java.util.List<java.lang.String> userGroups(java.lang.String nameoruuid)
Get the "normal" groups of the player- Parameters:
nameoruuid
- the username or uuid of the player- Returns:
- the "normal" groups of the player
-
userTimedGroups
public static java.util.List<java.lang.String> userTimedGroups(java.lang.String nameoruuid)
Gets the timed groups of the player- Parameters:
nameoruuid
- the username or uuid of the player- Returns:
- the timed groups of the player
-
userAllGroups
public static java.util.List<java.lang.String> userAllGroups(java.lang.String nameoruuid)
Gets all ("normal" and timed) groups of the player- Parameters:
nameoruuid
- the username or uuid of the player- Returns:
- all grozup of the player
-
userInGroup
public static boolean userInGroup(java.lang.String nameoruuid, java.lang.String group)
Tests if the player is in a group- Parameters:
nameoruuid
- the username or uuid of the playergroup
- the group- Returns:
- whether or not the player is in the group
-
userHasPermission
public static boolean userHasPermission(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Tests if the player has the given permission- Parameters:
nameoruuid
- the username or uuid of the playerpermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- whether or not the player has the permission
-
userIsPermissionSet
public static boolean userIsPermissionSet(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Tests if the player has the given permission set explictly- Parameters:
nameoruuid
- the username or uuid of the playerpermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- whether or not the player has the permission set explictly
-
userAdd
public static boolean userAdd(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Adds the given permission to the player- Parameters:
nameoruuid
- the username or uuid of the playerpermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- true if the permission has been added successfully
-
userRemove
public static boolean userRemove(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given permission to the player- Parameters:
nameoruuid
- the username or uuid of the playerpermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- true if the permission has been removed successfully
-
userTimedAdd
public static boolean userTimedAdd(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world, java.util.Date start, int dur)
Adds the given timed permission to the player- Parameters:
nameoruuid
- the username or uuid of the playerpermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be nullstart
- when the permission takes effectdur
- the duration in seconds the permission is active- Returns:
- true if the permission has been added successfully
-
userTimedRemove
public static boolean userTimedRemove(java.lang.String nameoruuid, java.lang.String permission, java.lang.String server, java.lang.String world)
Removes the given timed permission to the player- Parameters:
nameoruuid
- the username or uuid of the playerpermission
- the permissionserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- true if the permission has been removed successfully
-
userAddGroup
public static boolean userAddGroup(java.lang.String nameoruuid, java.lang.String group)
Adds a timed group to the player- Parameters:
nameoruuid
- the username or uuid of the playergroup
- the group- Returns:
- true if the group has been added successfully
-
userRemoveGroup
public static boolean userRemoveGroup(java.lang.String nameoruuid, java.lang.String group)
Removes a group from the player- Parameters:
nameoruuid
- the username or uuid of the playergroup
- the group- Returns:
- true if the group has been removed successfully
-
userAddTimedGroup
public static boolean userAddTimedGroup(java.lang.String nameoruuid, java.lang.String group, java.util.Date start, int dur)
Adds a timed group to the player- Parameters:
nameoruuid
- the username or uuid of the playergroup
- the groupstart
- when the group takes effectdur
- the duration in seconds the group is active- Returns:
- true if the group has been added successfully
-
userRemoveTimedGroup
public static boolean userRemoveTimedGroup(java.lang.String nameoruuid, java.lang.String group)
Removes a timed group from the player- Parameters:
nameoruuid
- the username or uuid of the playergroup
- the group- Returns:
- true if the group has been removed successfully
-
userPrefix
public static java.lang.String userPrefix(java.lang.String nameoruuid, java.lang.String server, java.lang.String world)
Gets the full prefix of the player- Parameters:
nameoruuid
- the username or uuid of the playerserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- the full prefix; may be null
-
userSuffix
public static java.lang.String userSuffix(java.lang.String nameoruuid, java.lang.String server, java.lang.String world)
Gets the full suffix of the player- Parameters:
nameoruuid
- the username or uuid of the playerserver
- the server; may be null; if server == "" then the current server is used or null if BungeeCordworld
- the world; may be null- Returns:
- the full suffix; may be null
-
hasSuperPermsCompat
public static boolean hasSuperPermsCompat()
Whether or not super perms compat is enabled- Returns:
- whether or not super perms compat is enabled
-
-