Package de.delinkedde.pipes
Klasse Caps
java.lang.Object
de.delinkedde.pipes.Caps
Resolves per-player caps from a permission-keyed config map.
A cap map is keyed by permission suffix. The default entry (if present) is the base cap
everyone gets; every other entry grants its cap to players holding <prefix><suffix>. A
player's effective cap is the highest value they qualify for, so stacking permissions never lowers
a limit.
- Seit:
- 0.1.0
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final StringThe config key whose value applies to every player without any permission. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic intResolves the effective cap using an arbitrary permission check, so the same tiered logic can run against sources other than a livePermissible— for example an offline player's cached permissions from a permissions plugin.static intresolve(org.bukkit.permissions.Permissible player, Map<String, Integer> caps, String prefix, int fallback) Resolves the effective cap for a player.
-
Felddetails
-
DEFAULT_KEY
The config key whose value applies to every player without any permission.- Siehe auch:
-
-
Methodendetails
-
resolve
public static int resolve(org.bukkit.permissions.Permissible player, Map<String, Integer> caps, String prefix, int fallback) Resolves the effective cap for a player.- Parameter:
player- the player (or other permissible) to resolve for; nevernullcaps- the permission-suffix → cap map; nevernullprefix- the permission prefix, e.g."pipes.network.cap."; nevernullfallback- the cap to use when the map has nodefaultentry- Gibt zurück:
- the highest cap the player qualifies for
-
resolve
public static int resolve(Predicate<String> hasPermission, Map<String, Integer> caps, String prefix, int fallback) Resolves the effective cap using an arbitrary permission check, so the same tiered logic can run against sources other than a livePermissible— for example an offline player's cached permissions from a permissions plugin.- Parameter:
hasPermission- tests whether the subject holds a permission node; nevernullcaps- the permission-suffix → cap map; nevernullprefix- the permission prefix, e.g."pipes.collector.cap."; nevernullfallback- the cap to use when the map has nodefaultentry- Gibt zurück:
- the highest cap the subject qualifies for
-