Class PPlayer

java.lang.Object
dev.esophose.playerparticles.particles.PPlayer
Direct Known Subclasses:
ConsolePPlayer, OtherPPlayer

public class PPlayer
extends java.lang.Object
  • Constructor Details

    • PPlayer

      public PPlayer​(java.util.UUID uuid, java.util.Map<java.lang.String,​ParticleGroup> particleGroups, java.util.Map<java.lang.Integer,​FixedParticleEffect> fixedParticles, boolean particlesHidden, boolean particlesHiddenSelf)
      Constructs a new PPlayer
      Parameters:
      uuid - The player UUID
      particleGroups - The ParticleGroups this PPlayer has
      fixedParticles - The FixedParticleEffects this PPlayer has
      particlesHidden - If this player has all particles hidden from view
      particlesHiddenSelf - If this player has their own particles hidden from view
  • Method Details

    • getUniqueId

      public java.util.UUID getUniqueId()
      Gets the player's UUID
      Returns:
      The player's UUID
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Returns:
      the underlying CommandSender who executed the command
    • clearCachedPlayer

      public void clearCachedPlayer()
      Clears the cached player to prevent the reference from lingering
    • getUnderlyingExecutor

      public org.bukkit.command.CommandSender getUnderlyingExecutor()
      Gets the underlying CommandSender who executed the command
      Returns:
      The destination for messages
    • canSeeParticles

      public boolean canSeeParticles()
      Gets if the Player can see particles spawned by the plugin or not
      Returns:
      True if the player can see particles, otherwise false
    • canSeeOwnParticles

      public boolean canSeeOwnParticles()
      Gets if the Player can see their own particles spawned by the plugin or not
      Returns:
      True if the player can see their own particles, otherwise false
    • setParticlesHidden

      public void setParticlesHidden​(boolean hidden)
      Sets if the player can see particles spawned by the plugin or not
      Parameters:
      hidden - True if the player can see particles, otherwise false
    • setParticlesHiddenSelf

      public void setParticlesHiddenSelf​(boolean hidden)
      Sets if the player can see their own particles spawned by the plugin or not
      Parameters:
      hidden - True if the player can see their own particles, otherwise false
    • getParticleGroups

      public java.util.Map<java.lang.String,​ParticleGroup> getParticleGroups()
      Get a map of ParticleGroups this user has saved
      Returns:
      A List of ParticleGroups this player has
    • setMoving

      public void setMoving​(boolean isMoving)
      Sets the player's movement state
      Parameters:
      isMoving - true if the player is moving, otherwise false if they are standing still
    • isMoving

      public boolean isMoving()
      Returns:
      true if the player is moving, otherwise false
    • setInCombat

      public void setInCombat​(boolean inCombat)
      Sets the player's combat state
      Parameters:
      inCombat - true if the player is in combat, otherwise false
    • isInCombat

      public boolean isInCombat()
      Returns:
      true if the player is in combat, otherwise false
    • setInAllowedRegion

      public void setInAllowedRegion​(boolean inAllowedRegion)
      Sets the player's region state
      Parameters:
      inAllowedRegion - true if the player is in an allowed region, otherwise false
    • isInAllowedRegion

      public boolean isInAllowedRegion()
      Returns:
      true if the player is in an allowed region, otherwise false
    • getParticleGroupByName

      public ParticleGroup getParticleGroupByName​(java.lang.String name)
      Gets a ParticleGroup this player has by its name
      Parameters:
      name - The name of the ParticleGroup
      Returns:
      The target named ParticleGroup
    • getActiveParticles

      public java.util.Collection<ParticlePair> getActiveParticles()
      Get the effect/style/data for particles this player has set
      Returns:
      A List of ParticlePairs this player has set
    • getActiveParticleGroup

      public ParticleGroup getActiveParticleGroup()
      Get the PPlayer's active ParticleGroup
      Returns:
      A ParticleGroup of this player's active particles
    • getActiveParticlesForStyle

      public java.util.Set<ParticlePair> getActiveParticlesForStyle​(ParticleStyle style)
      Get all ParticlePairs with a style matching the input
      Parameters:
      style - The style to match
      Returns:
      A List of ParticlePairs with a matching style
    • getActiveParticle

      public ParticlePair getActiveParticle​(int id)
      Get a ParticlePair by its id
      Parameters:
      id - The id of the ParticlePair
      Returns:
      A ParticlePair with the given id, otherwise null
    • getFixedParticles

      public java.util.Collection<FixedParticleEffect> getFixedParticles()
      Get the effect/style/data for all fixed particles this has has set
      Returns:
      A collection of FixedParticleEffects this player has set
    • getFixedParticlesMap

      public java.util.Map<java.lang.Integer,​FixedParticleEffect> getFixedParticlesMap()
      Get a map of the effect/style/data for all fixed particles this has has set
      Returns:
      A map of FixedParticleEffects this player has set
    • getFixedEffectById

      public FixedParticleEffect getFixedEffectById​(int id)
      Get a FixedParticleEffect this player owns by id
      Parameters:
      id - The id
      Returns:
      The FixedParticleEffect the player owns
    • getFixedEffectIds

      public java.util.Set<java.lang.Integer> getFixedEffectIds()
      Gets a set of ids of all fixed effect this player has
      Returns:
      A set of Integer ids this player's fixed effects have
    • addFixedEffect

      public void addFixedEffect​(FixedParticleEffect fixedEffect)
      Adds a fixed effect
      Parameters:
      fixedEffect - The fixed effect to add
    • removeFixedEffect

      public void removeFixedEffect​(int id)
      Removes a fixed effect for the given pplayer with the given id
      Parameters:
      id - The id of the fixed effect to remove
    • getNextFixedEffectId

      public int getNextFixedEffectId()
      Gets the next Id for a player's fixed effects
      Returns:
      The next available fixed effect id
    • getNextActiveParticleId

      public int getNextActiveParticleId()
      Gets the next Id for a player's active particles
      Returns:
      The next available active particle id
    • getPrimaryParticle

      public ParticlePair getPrimaryParticle()
      Gets the primary particle (ID 1) for the PPlayer
      Returns:
      The particle with an ID of 1 for the PPlayer or a new one if one doesn't exist