Class LimitsManager
java.lang.Object
nl.pim16aap2.animatedarchitecture.core.managers.LimitsManager
Manages the limits of players.
It checks the global limit, any admin bypass permission, and the player's personal limit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexceedsLimit(IPlayer player, Limit limit, int value) Checks if a given value exceeds the limit for this player.Gets the value of theLimitfor the given player.
-
Constructor Details
-
LimitsManager
-
-
Method Details
-
getLimit
Gets the value of theLimitfor the given player. It checks the global limit, any admin bypass permission, and the player's personal limit.- Parameters:
player- The player for whom to check the limit.limit- TheLimitto check.- Returns:
- The value of the limit for the given player, or an empty OptionalInt if none was found.
If there is a global limit in place (see
Limit.getGlobalLimit(IConfig)), the returned value cannot exceed this. Not even admins and OPs can bypass this limit.If the player has a player limit as well as a global limit, the lowest value of the two will be used.
-
exceedsLimit
Checks if a given value exceeds the limit for this player. For more info, seegetLimit(IPlayer, Limit).- Parameters:
player- The player for whom to check the limit.limit- TheLimitto check.value- The value to compare to the limit.- Returns:
- True if the given value exceeds the limit for this player. If value <= limit, this will return false.
-