Class PermissionManager

java.lang.Object
dev.esophose.playerparticles.manager.Manager
dev.esophose.playerparticles.manager.PermissionManager

public class PermissionManager
extends Manager
  • Constructor Details

  • Method Details

    • reload

      public void reload()
      Description copied from class: Manager
      Reloads the Manager's settings
      Specified by:
      reload in class Manager
    • disable

      public void disable()
      Description copied from class: Manager
      Cleans up the Manager's resources
      Specified by:
      disable in class Manager
    • hasPermission

      public boolean hasPermission​(PPlayer pplayer, java.lang.String permission)
      Checks if the given player has the given permission
      Parameters:
      pplayer - The player to check
      permission - The permission to check
      Returns:
      true if the player has the permission, otherwise false
    • hasPlayerReachedMaxParticles

      public boolean hasPlayerReachedMaxParticles​(PPlayer pplayer)
      Checks if the given player has reached the max number of particles in their active group
      Parameters:
      pplayer - The player to check
      Returns:
      If the player has reached the max number of particles in their active group
    • hasPlayerReachedMaxGroups

      public boolean hasPlayerReachedMaxGroups​(PPlayer pplayer)
      Checks if the given player has reached the max number of saved particle groups
      Parameters:
      pplayer - The player to check
      Returns:
      If the player has reached the max number of saved particle groups
    • canPlayerSaveGroups

      public boolean canPlayerSaveGroups​(PPlayer pplayer)
      Checks if the given player is able to save groups
      Parameters:
      pplayer - The player to check
      Returns:
      If the player has permission to save groups
    • hasPlayerReachedMaxFixedEffects

      public boolean hasPlayerReachedMaxFixedEffects​(PPlayer pplayer)
      Checks if the given player has reached the max number of fixed effects
      Parameters:
      pplayer - The player to check
      Returns:
      If the player has reached the max number of fixed effects
    • getMaxFixedEffectCreationDistance

      public int getMaxFixedEffectCreationDistance()
      Gets the max distance a fixed effect can be created from the player
      Returns:
      The max distance a fixed effect can be created from the player
    • getMaxParticlesAllowed

      public int getMaxParticlesAllowed​(PPlayer pplayer)
      Gets the maximum number of particles a player is allowed to use
      Parameters:
      pplayer - The pplayer to check
      Returns:
      The maximum number of particles based on the config.yml value, or unlimited
    • isWorldEnabled

      public boolean isWorldEnabled​(java.lang.String world)
      Checks if a world is enabled for particles to spawn in
      Parameters:
      world - The world name to check
      Returns:
      True if the world is disabled
    • getDisabledWorlds

      public java.util.List<java.lang.String> getDisabledWorlds()
      Gets all the worlds that are disabled
      Returns:
      All world names that are disabled
    • canResetOthers

      public boolean canResetOthers​(PPlayer player)
      Checks if a player can reset another offline player's particles
      Parameters:
      player - The player to check the permission for
      Returns:
      True if the player has permission, otherwise false
    • hasEffectPermission

      public boolean hasEffectPermission​(PPlayer player, ParticleEffect effect)
      Checks if a player has permission to use an effect
      Parameters:
      player - The player to check the permission for
      effect - The effect to check
      Returns:
      True if the player has permission to use the effect
    • hasStylePermission

      public boolean hasStylePermission​(PPlayer player, ParticleStyle style)
      Checks if a player has permission to use a style Always returns true for 'normal', a player needs at least one style to apply particles
      Parameters:
      player - The player to check the permission for
      style - The style to check
      Returns:
      If the player has permission to use the style
    • getEffectNamesUserHasPermissionFor

      public java.util.List<java.lang.String> getEffectNamesUserHasPermissionFor​(PPlayer p)
      Gets a String List of all effect names a player has permission for
      Parameters:
      p - The player to get effect names for
      Returns:
      A String List of all effect names the given player has permission for
    • getStyleNamesUserHasPermissionFor

      public java.util.List<java.lang.String> getStyleNamesUserHasPermissionFor​(PPlayer p)
      Gets a String List of all style names a player has permission for
      Parameters:
      p - The player to get style names for
      Returns:
      A String List of all style names the given player has permission for
    • getFixableStyleNamesUserHasPermissionFor

      public java.util.List<java.lang.String> getFixableStyleNamesUserHasPermissionFor​(PPlayer p)
      Gets a String List of all fixable style names a player has permission for
      Parameters:
      p - The player to get style names for
      Returns:
      A String List of all fixable style names the given player has permission for
    • getEffectsUserHasPermissionFor

      public java.util.List<ParticleEffect> getEffectsUserHasPermissionFor​(PPlayer p)
      Gets a List of all effects a player has permission for
      Parameters:
      p - The player to get effects for
      Returns:
      A List of all effects the given player has permission for
    • getStylesUserHasPermissionFor

      public java.util.List<ParticleStyle> getStylesUserHasPermissionFor​(PPlayer p)
      Gets a List of all styles a player has permission for
      Parameters:
      p - The player to get styles for
      Returns:
      A List of all styles the given player has permission for
    • canUseFixedEffects

      public boolean canUseFixedEffects​(PPlayer player)
      Checks if a player has permission to created fixed effects
      Parameters:
      player - The player to check the permission for
      Returns:
      True if the player has permission
    • canClearFixedEffects

      public boolean canClearFixedEffects​(PPlayer player)
      Checks if a player has permission to clear fixed effects
      Parameters:
      player - The player to check the permission for
      Returns:
      True if the player has permission to use /pp fixed clear
    • canTeleportToFixedEffects

      public boolean canTeleportToFixedEffects​(PPlayer player)
      Checks if a player has permission to teleport to fixed effects
      Parameters:
      player - The player to check the permission for
      Returns:
      True if the player has permission to use /pp fixed teleport
    • canOpenGui

      public boolean canOpenGui​(PPlayer player)
      Checks if a player has permission to open the GUI
      Parameters:
      player - The player to check the permission for
      Returns:
      True if the player has permission to open the GUI
    • canReloadPlugin

      public boolean canReloadPlugin​(org.bukkit.command.CommandSender sender)
      Checks if a player has permission to use /pp reload
      Parameters:
      sender - The sender to check the permission for
      Returns:
      True if the sender has permission to reload the plugin's settings
    • canOverride

      public boolean canOverride​(org.bukkit.command.CommandSender sender)
      Checks if a player can use /ppo
      Parameters:
      sender - The CommandSender to check
      Returns:
      If the sender can use /ppo
    • hasWorldGuardBypass

      public boolean hasWorldGuardBypass​(org.bukkit.entity.Player player)
      Checks if a player has the WorldGuard bypass permission
      Parameters:
      player - The Player to check
      Returns:
      If the player has the WorldGuard bypass permission