Class PPlayer
java.lang.Object
dev.esophose.playerparticles.particles.PPlayer
- Direct Known Subclasses:
ConsolePPlayer
,OtherPPlayer
public class PPlayer
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description 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 -
Method Summary
Modifier and Type Method Description void
addFixedEffect(FixedParticleEffect fixedEffect)
Adds a fixed effectboolean
canSeeOwnParticles()
Gets if the Player can see their own particles spawned by the plugin or notboolean
canSeeParticles()
Gets if the Player can see particles spawned by the plugin or notvoid
clearCachedPlayer()
Clears the cached player to prevent the reference from lingeringParticlePair
getActiveParticle(int id)
Get a ParticlePair by its idParticleGroup
getActiveParticleGroup()
Get the PPlayer's active ParticleGroupjava.util.Collection<ParticlePair>
getActiveParticles()
Get the effect/style/data for particles this player has setjava.util.Set<ParticlePair>
getActiveParticlesForStyle(ParticleStyle style)
Get all ParticlePairs with a style matching the inputFixedParticleEffect
getFixedEffectById(int id)
Get a FixedParticleEffect this player owns by idjava.util.Set<java.lang.Integer>
getFixedEffectIds()
Gets a set of ids of all fixed effect this player hasjava.util.Collection<FixedParticleEffect>
getFixedParticles()
Get the effect/style/data for all fixed particles this has has setjava.util.Map<java.lang.Integer,FixedParticleEffect>
getFixedParticlesMap()
Get a map of the effect/style/data for all fixed particles this has has setint
getNextActiveParticleId()
Gets the next Id for a player's active particlesint
getNextFixedEffectId()
Gets the next Id for a player's fixed effectsParticleGroup
getParticleGroupByName(java.lang.String name)
Gets a ParticleGroup this player has by its namejava.util.Map<java.lang.String,ParticleGroup>
getParticleGroups()
Get a map of ParticleGroups this user has savedorg.bukkit.entity.Player
getPlayer()
ParticlePair
getPrimaryParticle()
Gets the primary particle (ID 1) for the PPlayerorg.bukkit.command.CommandSender
getUnderlyingExecutor()
Gets the underlying CommandSender who executed the commandjava.util.UUID
getUniqueId()
Gets the player's UUIDboolean
isInAllowedRegion()
boolean
isInCombat()
boolean
isMoving()
void
removeFixedEffect(int id)
Removes a fixed effect for the given pplayer with the given idvoid
setInAllowedRegion(boolean inAllowedRegion)
Sets the player's region statevoid
setInCombat(boolean inCombat)
Sets the player's combat statevoid
setMoving(boolean isMoving)
Sets the player's movement statevoid
setParticlesHidden(boolean hidden)
Sets if the player can see particles spawned by the plugin or notvoid
setParticlesHiddenSelf(boolean hidden)
Sets if the player can see their own particles spawned by the plugin or not
-
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 UUIDparticleGroups
- The ParticleGroups this PPlayer hasfixedParticles
- The FixedParticleEffects this PPlayer hasparticlesHidden
- If this player has all particles hidden from viewparticlesHiddenSelf
- 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
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
Gets a ParticleGroup this player has by its name- Parameters:
name
- The name of the ParticleGroup- Returns:
- The target named ParticleGroup
-
getActiveParticles
Get the effect/style/data for particles this player has set- Returns:
- A List of ParticlePairs this player has set
-
getActiveParticleGroup
Get the PPlayer's active ParticleGroup- Returns:
- A ParticleGroup of this player's active particles
-
getActiveParticlesForStyle
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
Get a ParticlePair by its id- Parameters:
id
- The id of the ParticlePair- Returns:
- A ParticlePair with the given id, otherwise null
-
getFixedParticles
Get the effect/style/data for all fixed particles this has has set- Returns:
- A collection of FixedParticleEffects this player has set
-
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
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
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
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
-