Class PermissionsManager
java.lang.Object
net.sacredlabyrinth.phaed.simpleclans.managers.PermissionsManager
- Author:
- phaed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGives the player permissions linked to a clanvoidaddPlayerPermissions(@Nullable ClanPlayer cp) Adds permissions for a playerbooleanchargePlayer(@NotNull org.bukkit.OfflinePlayer player, double money, @Nullable EconomyTransactionEvent.Cause cause) Charges the specified amount of money from the player's account.booleanchargePlayer(org.bukkit.OfflinePlayer player, double money) Charges the specified amount of money from the player's account.format(double value) getPermissions(Clan clan) getPrefix(org.bukkit.entity.Player p) getSuffix(org.bukkit.entity.Player p) booleangrantPlayer(@NotNull org.bukkit.OfflinePlayer player, double money, @Nullable EconomyTransactionEvent.Cause cause) Grants the specified amount of money to the player's account.booleangrantPlayer(org.bukkit.OfflinePlayer player, double money) Grants the specified amount of money to the player's account.booleanCheck if a player has permissionsbooleanhas(org.bukkit.entity.Player player, RankPermission permission, boolean notify) Checks if the player has the rank permission or the permission level, and the equivalent Bukkit permissionbooleanhas(org.bukkit.entity.Player player, RankPermission permission, PermissionLevel level, boolean notify) Deprecated.booleanWhether economy plugin exists and is enabledvoidLoads the permissions for each clan from the configbooleanplayerChargeMoney(org.bukkit.OfflinePlayer player, double money) Deprecated.usechargePlayer(OfflinePlayer, double)insteaddoubleplayerGetMoney(org.bukkit.OfflinePlayer player) Returns the players moneybooleanplayerGrantMoney(org.bukkit.OfflinePlayer player, double money) Deprecated.usegrantPlayer(OfflinePlayer, double)insteadbooleanplayerHasMoney(org.bukkit.OfflinePlayer player, double money) Check if a user has the moneyvoidremoveClanPermissions(Clan clan) Removes permissions for a clan (when it gets disbanded for example)voidRemoves permissions linked to a clan from the playervoidremoveClanPlayerPermissions(@Nullable ClanPlayer cp) Removes permissions for a player (when he gets kicked for example)voidSaves the permissions for each clan from the configvoidupdateClanPermissions(Clan clan) Adds all permissions for a clan
-
Constructor Details
-
PermissionsManager
public PermissionsManager()
-
-
Method Details
-
hasEconomy
public boolean hasEconomy()Whether economy plugin exists and is enabled -
loadPermissions
public void loadPermissions()Loads the permissions for each clan from the config -
savePermissions
public void savePermissions()Saves the permissions for each clan from the config -
updateClanPermissions
Adds all permissions for a clan -
addPlayerPermissions
Adds permissions for a player -
removeClanPermissions
Removes permissions for a clan (when it gets disbanded for example) -
removeClanPlayerPermissions
Removes permissions for a player (when he gets kicked for example) -
removeClanPermissions
Removes permissions linked to a clan from the player -
getPermissions
- Returns:
- the permissions for a clan
-
format
-
playerChargeMoney
Deprecated.usechargePlayer(OfflinePlayer, double)insteadCharge a player some money -
chargePlayer
public boolean chargePlayer(org.bukkit.OfflinePlayer player, double money) Charges the specified amount of money from the player's account.As the
EconomyTransactionEvent.Causeis not passed, this method won't fire theEconomyTransactionEvent. Use this method when you don't need to track the cause or handle custom transaction events.- Parameters:
player- The player whose account will be charged.money- The amount of money to charge.- See Also:
-
chargePlayer
public boolean chargePlayer(@NotNull @NotNull org.bukkit.OfflinePlayer player, double money, @Nullable @Nullable EconomyTransactionEvent.Cause cause) Charges the specified amount of money from the player's account.- Parameters:
player- The player whose account will be charged.money- The amount of money to charge.cause- The cause of the transaction.- Returns:
trueif the charge was successful,falseotherwise.- See Also:
-
playerGrantMoney
Deprecated.usegrantPlayer(OfflinePlayer, double)insteadGrants a player some money -
grantPlayer
public boolean grantPlayer(org.bukkit.OfflinePlayer player, double money) Grants the specified amount of money to the player's account.As the
EconomyTransactionEvent.Causeis not passed, this method won't fire theEconomyTransactionEvent. Use this method when you don't need to track the cause or handle custom transaction events.- Parameters:
player- The player to whom the money will be granted.money- The amount of money to grant.- See Also:
-
grantPlayer
public boolean grantPlayer(@NotNull @NotNull org.bukkit.OfflinePlayer player, double money, @Nullable @Nullable EconomyTransactionEvent.Cause cause) Grants the specified amount of money to the player's account.- Parameters:
player- The player to whom the money will be granted.money- The amount of money to grant.cause- The cause of the transaction.- Returns:
trueif the grant was successful,falseotherwise.- See Also:
-
playerHasMoney
public boolean playerHasMoney(org.bukkit.OfflinePlayer player, double money) Check if a user has the money- Returns:
- whether he has the money
-
playerGetMoney
public double playerGetMoney(org.bukkit.OfflinePlayer player) Returns the players money- Returns:
- the players money
-
has
Check if a player has permissions- Parameters:
player- the playerperm- the permission- Returns:
- whether he has the permission
-
has
@Deprecated public boolean has(org.bukkit.entity.Player player, RankPermission permission, PermissionLevel level, boolean notify) Deprecated.Checks if the player has the rank permission or the permission level, and the equivalent Bukkit permission- Parameters:
player- the playerpermission- the rank permissionnotify- notify the player if they don't have permission
-
has
Checks if the player has the rank permission or the permission level, and the equivalent Bukkit permission- Parameters:
player- the playerpermission- the rank permissionnotify- notify the player if they don't have permission
-
addClanPermissions
Gives the player permissions linked to a clan -
getPrefix
-
getSuffix
-
has(Player, RankPermission, boolean)orhas(Player, String)