Class PlayerParticlesAPI

java.lang.Object
dev.esophose.playerparticles.api.PlayerParticlesAPI

public final class PlayerParticlesAPI
extends java.lang.Object
The API for the PlayerParticles plugin. Used to manipulate a player's particles and data. Note: This API will bypass all permissions and does not send any messages. Any changes made through the API will be saved to the database automatically.
  • Method Details

    • getInstance

      @NotNull public static @NotNull PlayerParticlesAPI getInstance()
      Returns:
      the instance of the PlayerParticlesAPI
    • getVersion

      @NotNull public @NotNull java.lang.String getVersion()
      Returns:
      the currently installed version of the plugin
    • getPPlayer

      @Nullable public @Nullable PPlayer getPPlayer​(@NotNull @NotNull java.util.UUID uuid)
      Gets a PPlayer from their UUID
      Parameters:
      uuid - The UUID of the PPlayer
      Returns:
      The PPlayer, or null if not found
    • getPPlayer

      @Nullable public @Nullable PPlayer getPPlayer​(@NotNull @NotNull org.bukkit.entity.Player player)
      Gets a PPlayer from a Player
      Parameters:
      player - The Player
      Returns:
      The PPlayer, or null if not found
    • getPPlayer

      @Nullable public @Nullable PPlayer getPPlayer​(@NotNull @NotNull org.bukkit.command.CommandSender sender)
      Gets a PPlayer from a CommandSender
      Parameters:
      sender - The CommandSender, either a Player or ConsoleCommandSender
      Returns:
      The PPlayer, or null if not found
    • getConsolePPlayer

      @Nullable public @Nullable PPlayer getConsolePPlayer()
      Gets the PPlayer representing the console
      Returns:
      The PPlayer, or null if not found
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticlePair particle)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      particle - The particle to add
      Returns:
      The ParticlePair that was added or null if failed
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      effect - The effect of the particle
      style - The style of the particle
      Returns:
      The ParticlePair that was added or null if failed
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull OrdinaryColor colorData)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      effect - The effect of the particle
      style - The style of the particle
      colorData - The color data of the particle.
      Returns:
      The ParticlePair that was added or null if failed
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull NoteColor noteColorData)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      effect - The effect of the particle
      style - The style of the particle
      noteColorData - The note color data of the particle
      Returns:
      The ParticlePair that was added or null if failed
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull org.bukkit.Material materialData)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      effect - The effect of the particle
      style - The style of the particle
      materialData - The material data of the particle
      Returns:
      The ParticlePair that was added or null if failed
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull ColorTransition colorTransitionData)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      effect - The effect of the particle
      style - The style of the particle
      colorTransitionData - The color transition data of the particle
      Returns:
      The ParticlePair that was added or null if failed
    • addActivePlayerParticle

      @Nullable public @Nullable ParticlePair addActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull Vibration vibrationData)
      Adds an active particle to a Player's particles
      Parameters:
      player - The player to add to
      effect - The effect of the particle
      style - The style of the particle
      vibrationData - The vibration data of the particle
      Returns:
      The ParticlePair that was added or null if failed
    • editActivePlayerParticle

      @Nullable public @Nullable ParticlePair editActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id, @NotNull @NotNull ParticleEffect effect)
      Edits an active particle of a Player
      Parameters:
      player - The player to edit from
      id - The ID of the target particle
      effect - The new effect for the particle
      Returns:
      The ParticlePair that was edited or null if failed
    • editActivePlayerParticle

      @Nullable public @Nullable ParticlePair editActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id, @NotNull @NotNull ParticleStyle style)
      Edits an active particle of a Player
      Parameters:
      player - The player to edit from
      id - The ID of the target particle
      style - The new style for the particle
      Returns:
      The ParticlePair that was edited or null if failed
    • editActivePlayerParticle

      @Nullable public @Nullable ParticlePair editActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id, @NotNull @NotNull OrdinaryColor colorData)
      Edits an active particle of a Player
      Parameters:
      player - The player to edit from
      id - The ID of the target particle
      colorData - The new color data for the particle
      Returns:
      The ParticlePair that was edited or null if failed
    • editActivePlayerParticle

      @Nullable public @Nullable ParticlePair editActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id, @NotNull @NotNull NoteColor noteColorData)
      Edits an active particle of a Player
      Parameters:
      player - The player to edit from
      id - The ID of the target particle
      noteColorData - The new note color data for the particle
      Returns:
      The ParticlePair that was edited or null if failed
    • editActivePlayerParticle

      @Nullable public @Nullable ParticlePair editActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id, @NotNull @NotNull org.bukkit.Material materialData)
      Edits an active particle of a Player
      Parameters:
      player - The player to edit from
      id - The ID of the target particle
      materialData - The new material data for the particle
      Returns:
      The ParticlePair that was edited or null if failed
    • removeActivePlayerParticle

      @Nullable public @Nullable ParticlePair removeActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id)
      Removes an active particle from a player by ID
      Parameters:
      player - The player to remove from
      id - The ID of the particle to remove
      Returns:
      The ParticlePair that was removed or null if failed
    • removeActivePlayerParticles

      @Nullable public @Nullable java.util.Set<ParticlePair> removeActivePlayerParticles​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleEffect effect)
      Removes active particles from a player by effect
      Parameters:
      player - The player to remove from
      effect - The effect of the particle(s) to remove
      Returns:
      A Set of removed ParticlePairs or null if failed
    • removeActivePlayerParticles

      @Nullable public @Nullable java.util.Set<ParticlePair> removeActivePlayerParticles​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleStyle style)
      Removes active particles from a player by style
      Parameters:
      player - The player to remove from
      style - The style of the particle(s) to remove
      Returns:
      A Set of removed ParticlePairs or null if failed
    • resetActivePlayerParticles

      @Nullable public @Nullable java.lang.Integer resetActivePlayerParticles​(@NotNull @NotNull org.bukkit.entity.Player player)
      Removes all active particles from a player
      Parameters:
      player - The player to remove from
      Returns:
      The number of particles removed or null if failed
    • resetActivePlayerParticles

      public void resetActivePlayerParticles​(@NotNull @NotNull java.lang.String playerName, @Nullable @Nullable java.util.function.Consumer<java.lang.Boolean> successConsumer)
      Attempts to reset the active particles for the given player name. This works even if the player is offline.
      Parameters:
      playerName - The name of the player to reset the active particles for
      successConsumer - The callback to execute when finished
    • getActivePlayerParticles

      @NotNull public @NotNull java.util.Collection<ParticlePair> getActivePlayerParticles​(@NotNull @NotNull org.bukkit.entity.Player player)
      Gets all active particles from a player
      Parameters:
      player - The player to get from
      Returns:
      A collection of the player's active particles
    • getActivePlayerParticle

      @Nullable public @Nullable ParticlePair getActivePlayerParticle​(@NotNull @NotNull org.bukkit.entity.Player player, int id)
      Gets an active particle from a player
      Parameters:
      player - The player to get from
      id - The ID of the particle to get
      Returns:
      A particle or null if one doesn't exist
    • savePlayerParticleGroup

      @Nullable public @Nullable ParticleGroup savePlayerParticleGroup​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleGroup particleGroup)
      Saves a particle group to a player or edits an existing one
      Parameters:
      player - The player to save to
      particleGroup - The particle group to save
      Returns:
      The ParticleGroup that was saved or null if failed
    • savePlayerParticleGroup

      @Nullable public @Nullable ParticleGroup savePlayerParticleGroup​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull java.lang.String groupName, @NotNull @NotNull java.util.Collection<ParticlePair> particles)
      Saves a particle group to a player or edits an existing one
      Parameters:
      player - The player to save to
      groupName - The name of the group to save
      particles - Particles that are part of the group
      Returns:
      The ParticleGroup that was saved or null if failed
    • removePlayerParticleGroup

      @Nullable public @Nullable ParticleGroup removePlayerParticleGroup​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull java.lang.String groupName)
      Removes a particle group from a player
      Parameters:
      player - The player to remove from
      groupName - The name of the particle group to remove
      Returns:
      The ParticleGroup that was removed or null if failed
    • removePlayerParticleGroup

      @Nullable public @Nullable ParticleGroup removePlayerParticleGroup​(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ParticleGroup particleGroup)
      Removes a particle group from a player
      Parameters:
      player - The player to remove from
      particleGroup - The particle group
      Returns:
      The ParticleGroup that was removed or null if failed
    • getPlayerParticleGroups

      @NotNull public @NotNull java.util.Collection<ParticleGroup> getPlayerParticleGroups​(@NotNull @NotNull org.bukkit.entity.Player player)
      Gets a collection of the player's particle groups
      Parameters:
      player - The player to get from
      Returns:
      A collection of the player's particle groups
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull FixedParticleEffect fixedEffect)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      fixedEffect - The FixedParticleEffect
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticlePair particle)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      particle - The particle to display
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      effect - The effect of the particle
      style - The style of the particle
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull OrdinaryColor colorData)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      effect - The effect of the particle
      style - The style of the particle
      colorData - The color data of the particle
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull NoteColor noteColorData)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      effect - The effect of the particle
      style - The style of the particle
      noteColorData - The note color data of the particle
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull org.bukkit.Material materialData)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      effect - The effect of the particle
      style - The style of the particle
      materialData - The material data of the particle
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull ColorTransition colorTransitionData)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      effect - The effect of the particle
      style - The style of the particle
      colorTransitionData - The color transition data of the particle
      Returns:
      The FixedParticleEffect that was created or null if failed
    • createFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect createFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull ParticleEffect effect, @NotNull @NotNull ParticleStyle style, @NotNull @NotNull Vibration vibrationData)
      Creates a fixed particle effect for a player
      Parameters:
      sender - The sender to create for, either a Player or ConsoleCommandSender
      location - The location to create at
      effect - The effect of the particle
      style - The style of the particle
      vibrationData - The vibration data of the particle
      Returns:
      The FixedParticleEffect that was created or null if failed
    • editFixedParticleEffect

      public FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull FixedParticleEffect fixedEffect)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      fixedEffect - The modified fixed effect to edit
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • editFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id, @NotNull @NotNull org.bukkit.Location location)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      location - The new location
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • editFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id, @NotNull @NotNull ParticleEffect effect)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      effect - The new effect
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • editFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id, @NotNull @NotNull ParticleStyle style)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      style - The new style
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • editFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id, @NotNull @NotNull OrdinaryColor colorData)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      colorData - The new color data
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • editFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id, @NotNull @NotNull NoteColor noteColorData)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      noteColorData - The new note color data
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • editFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect editFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id, @NotNull @NotNull org.bukkit.Material materialData)
      Edits a fixed particle effect for a player
      Parameters:
      sender - The sender to edit from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      materialData - The new material data
      Returns:
      The FixedParticleEffect that was edited or null if failed
    • removeFixedEffect

      @Nullable public @Nullable FixedParticleEffect removeFixedEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id)
      Removes a fixed particle effect from a player
      Parameters:
      sender - The sender to remove from, either a Player or ConsoleCommandSender
      id - The ID of the fixed particle effect
      Returns:
      The FixedParticleEffect that was removed or null if failed
    • removeFixedEffectsInRange

      public int removeFixedEffectsInRange​(@NotNull @NotNull org.bukkit.Location location, double radius)
      Removes fixed effects within a given radius of a location
      Parameters:
      location - The location to search around
      radius - The radius to remove
      Returns:
      The number of fixed effects that were removed
    • getFixedParticleEffect

      @Nullable public @Nullable FixedParticleEffect getFixedParticleEffect​(@NotNull @NotNull org.bukkit.command.CommandSender sender, int id)
      Gets a fixed particle effect for a player
      Parameters:
      sender - The sender to get from, either a Player or CommandSender
      id - The ID of the fixed particle effect
      Returns:
      The fixed particle effect, or null if not found
    • getFixedParticleEffects

      @NotNull public @NotNull java.util.Collection<FixedParticleEffect> getFixedParticleEffects​(@NotNull @NotNull org.bukkit.command.CommandSender sender)
      Gets a collection of a player's fixed particle effects
      Parameters:
      sender - The sender to get from, either a Player or CommandSender
      Returns:
      A collection of the player's fixed particle effects
    • openParticlesGui

      public void openParticlesGui​(@NotNull @NotNull org.bukkit.entity.Player player)
      Opens the particles gui for a player
      Parameters:
      player - The player to open the gui for
    • togglePlayerParticleVisibility

      public void togglePlayerParticleVisibility​(@NotNull @NotNull org.bukkit.entity.Player player, boolean particlesHidden)
      Toggles a player's particle visibility on/off
      Parameters:
      player - The player to toggle visibility for
      particlesHidden - true if the particles should be hidden, or false for visible
    • togglePlayerParticleSelfVisibility

      public void togglePlayerParticleSelfVisibility​(@NotNull @NotNull org.bukkit.entity.Player player, boolean particlesHidden)
      Toggles a player's particle visibility for their own particles on/off
      Parameters:
      player - The player to toggle visibility for
      particlesHidden - true if the player's own particles should be hidden, or false for visible