Fzzy Config

@WithCustomPerms and @AdminLevel

Introduced as of 0.4.0.

These two annotations work together as a pair to define permissions for a config based on LuckPerms/Forge Config API "node" style permissions. Permissions attached to a specific setting will take precedence over ones defined for the entire class.

  1. @WithCustomPerms - Use this like @WithPerms to define permissions for a setting or class. Define all the node strings that are permissible; generally speaking only the lowest level of a "chain" of nodes would be needed, admin wouldn't need to be called out if it inherits everything from mod, and mod is permissible in the annotation. Optionally a vanilla permission level can be provided as a fallback (in case LuckPerms isn't present, for example).
  2. @AdminLevel - In case of an access violation (a cheater, hacks, etc.), this annotation defines who should be alerted to the issue; using the example from above, only admins might be included in this annotation, not mods. If not provided, Fzzy Config will fall back to anyone with vanilla admin access or higher (permission level >= 3)
@AdminAccess(perms = {"permissions_example.admin"}, fallback = 3) // defines the permission nodes that are alerted of an access violation; falls back to vanilla admin or higher
public class MyConfig extends Config {
//constructor goes here
@WithCustomPerms(perms = {"permissions_example.moderator", "permissions_example.temporary_admin"}, fallback = 3) // permission nodes that have access to this setting (along with any inheriting nodes). Falls back to anyone with vanilla admin access or higher.
public int mySpecialField = 2;
}