Class PermissionManager
java.lang.Object
dev.esophose.playerparticles.manager.Manager
dev.esophose.playerparticles.manager.PermissionManager
public class PermissionManager extends Manager
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PermissionManager(PlayerParticles playerParticles) -
Method Summary
Modifier and Type Method Description booleancanClearFixedEffects(PPlayer player)Checks if a player has permission to clear fixed effectsbooleancanOpenGui(PPlayer player)Checks if a player has permission to open the GUIbooleancanOverride(org.bukkit.command.CommandSender sender)Checks if a player can use /ppobooleancanPlayerSaveGroups(PPlayer pplayer)Checks if the given player is able to save groupsbooleancanReloadPlugin(org.bukkit.command.CommandSender sender)Checks if a player has permission to use /pp reloadbooleancanResetOthers(PPlayer player)Checks if a player can reset another offline player's particlesbooleancanTeleportToFixedEffects(PPlayer player)Checks if a player has permission to teleport to fixed effectsbooleancanUseFixedEffects(PPlayer player)Checks if a player has permission to created fixed effectsvoiddisable()Cleans up the Manager's resourcesjava.util.List<java.lang.String>getDisabledWorlds()Gets all the worlds that are disabledjava.util.List<java.lang.String>getEffectNamesUserHasPermissionFor(PPlayer p)Gets a String List of all effect names a player has permission forjava.util.List<ParticleEffect>getEffectsUserHasPermissionFor(PPlayer p)Gets a List of all effects a player has permission forjava.util.List<java.lang.String>getFixableStyleNamesUserHasPermissionFor(PPlayer p)Gets a String List of all fixable style names a player has permission forintgetMaxFixedEffectCreationDistance()Gets the max distance a fixed effect can be created from the playerintgetMaxParticlesAllowed(PPlayer pplayer)Gets the maximum number of particles a player is allowed to usejava.util.List<java.lang.String>getStyleNamesUserHasPermissionFor(PPlayer p)Gets a String List of all style names a player has permission forjava.util.List<ParticleStyle>getStylesUserHasPermissionFor(PPlayer p)Gets a List of all styles a player has permission forbooleanhasEffectPermission(PPlayer player, ParticleEffect effect)Checks if a player has permission to use an effectbooleanhasPermission(PPlayer pplayer, java.lang.String permission)Checks if the given player has the given permissionbooleanhasPlayerReachedMaxFixedEffects(PPlayer pplayer)Checks if the given player has reached the max number of fixed effectsbooleanhasPlayerReachedMaxGroups(PPlayer pplayer)Checks if the given player has reached the max number of saved particle groupsbooleanhasPlayerReachedMaxParticles(PPlayer pplayer)Checks if the given player has reached the max number of particles in their active groupbooleanhasStylePermission(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 particlesbooleanhasWorldGuardBypass(org.bukkit.entity.Player player)Checks if a player has the WorldGuard bypass permissionbooleanisWorldEnabled(java.lang.String world)Checks if a world is enabled for particles to spawn invoidreload()Reloads the Manager's settings
-
Constructor Details
-
Method Details
-
reload
public void reload()Description copied from class:ManagerReloads the Manager's settings -
disable
public void disable()Description copied from class:ManagerCleans up the Manager's resources -
hasPermission
Checks if the given player has the given permission- Parameters:
pplayer- The player to checkpermission- The permission to check- Returns:
- true if the player has the permission, otherwise false
-
hasPlayerReachedMaxParticles
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
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
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
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
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
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
Checks if a player has permission to use an effect- Parameters:
player- The player to check the permission foreffect- The effect to check- Returns:
- True if the player has permission to use the effect
-
hasStylePermission
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 forstyle- The style to check- Returns:
- If the player has permission to use the style
-
getEffectNamesUserHasPermissionFor
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
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
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
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
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
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
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
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
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
-