Class PermissionManager

java.lang.Object
stawa.vitalstrike.PermissionManager

public class PermissionManager extends Object
Manages permissions for VitalStrike plugin, particularly for group-based damage formats. Handles loading, checking, and retrieving group permissions from configuration.
  • Constructor Details

    • PermissionManager

      public PermissionManager(org.bukkit.plugin.java.JavaPlugin plugin)
      Constructs a new PermissionManager.
      Parameters:
      plugin - the JavaPlugin instance
  • Method Details

    • loadPermissions

      public void loadPermissions()
      Loads all permission-related settings from the configuration.
    • getPlayerGroup

      public String getPlayerGroup(org.bukkit.entity.Player player)
      Gets the player's damage format group based on permissions.
      Parameters:
      player - the player to check
      Returns:
      the group name the player belongs to, or "default" if none
    • getDamageFormat

      public String getDamageFormat(org.bukkit.entity.Player player, String damageType, String defaultFormat)
      Gets the damage format for a player based on their permissions.
      Parameters:
      player - the player
      damageType - the type of damage
      defaultFormat - the default format to use if no permission-based format is found
      Returns:
      the formatted damage string
    • getGroupPermissions

      public Map<String,String> getGroupPermissions()
      Gets all group permissions.
      Returns:
      map of group names to permission strings
    • getGroupDamageFormats

      public Map<String,Map<String,String>> getGroupDamageFormats()
      Gets all group damage formats.
      Returns:
      map of group names to damage format maps