Class DefaultParticleStyle
java.lang.Object
dev.esophose.playerparticles.styles.DefaultParticleStyle
- All Implemented Interfaces:
ParticleStyle
- Direct Known Subclasses:
ParticleStyleArrows
,ParticleStyleBatman
,ParticleStyleBeam
,ParticleStyleBlockBreak
,ParticleStyleBlockPlace
,ParticleStyleCelebration
,ParticleStyleChains
,ParticleStyleCompanion
,ParticleStyleCube
,ParticleStyleDeath
,ParticleStyleFeet
,ParticleStyleFishing
,ParticleStyleHalo
,ParticleStyleHurt
,ParticleStyleIcosphere
,ParticleStyleInvocation
,ParticleStyleMove
,ParticleStyleNormal
,ParticleStyleOrbit
,ParticleStyleOutline
,ParticleStyleOverhead
,ParticleStylePoint
,ParticleStylePopper
,ParticleStylePulse
,ParticleStyleQuadhelix
,ParticleStyleRings
,ParticleStyleSphere
,ParticleStyleSpin
,ParticleStyleSpiral
,ParticleStyleSwords
,ParticleStyleTeleport
,ParticleStyleThick
,ParticleStyleTrail
,ParticleStyleTwins
,ParticleStyleVortex
,ParticleStyleWhirl
,ParticleStyleWhirlwind
,ParticleStyleWings
public abstract class DefaultParticleStyle extends java.lang.Object implements ParticleStyle
-
Field Summary
Fields Modifier and Type Field Description protected PlayerParticles
playerParticles
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultParticleStyle(java.lang.String internalStyleName, boolean canBeFixedByDefault, boolean canToggleWithMovementByDefault, double fixedEffectOffsetByDefault)
-
Method Summary
Modifier and Type Method Description boolean
canBeFixed()
Gets if the style can be used in a FixedParticleEffectboolean
canToggleWithCombat()
Gets if the style can be hidden if the player is in combat with the toggle-on-combat settingboolean
canToggleWithMovement()
Gets if the style can be displayed differently based on the toggle-on-move setting when the player is movingdouble
getFixedEffectOffset()
The Y-axis offset to be applied when using '/pp fixed create looking'org.bukkit.Material
getGuiIconMaterial()
protected abstract java.util.List<java.lang.String>
getGuiIconMaterialNames()
java.lang.String
getInternalName()
java.lang.String
getName()
boolean
isEnabled()
void
loadSettings(boolean reloadConfig)
Loads the settings shared for each style then calls loadSettings(CommentedFileConfiguration)protected abstract void
loadSettings(CommentedFileConfiguration config)
Loads the settings for this styleprotected abstract void
setDefaultSettings(CommentedFileConfiguration config)
Sets the default settings for this styleprotected void
setIfNotExists(java.lang.String setting, java.lang.Object value, java.lang.String... comments)
Sets a value to the config if it doesn't already existMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.esophose.playerparticles.styles.ParticleStyle
getParticles, getParticles, hasLongRangeVisibility, updateTimers
-
Field Details
-
Constructor Details
-
DefaultParticleStyle
protected DefaultParticleStyle(java.lang.String internalStyleName, boolean canBeFixedByDefault, boolean canToggleWithMovementByDefault, double fixedEffectOffsetByDefault)
-
-
Method Details
-
loadSettings
public final void loadSettings(boolean reloadConfig)Loads the settings shared for each style then calls loadSettings(CommentedFileConfiguration)- Parameters:
reloadConfig
- If the settings should be reloaded or not
-
setIfNotExists
protected final void setIfNotExists(java.lang.String setting, java.lang.Object value, java.lang.String... comments)Sets a value to the config if it doesn't already exist- Parameters:
setting
- The setting namevalue
- The setting valuecomments
- Comments for the setting
-
isEnabled
public final boolean isEnabled()- Specified by:
isEnabled
in interfaceParticleStyle
- Returns:
- true if the style is enabled, false otherwise
-
getInternalName
public final java.lang.String getInternalName()- Specified by:
getInternalName
in interfaceParticleStyle
- Returns:
- The style's internal name that will always remain constant
-
getName
public final java.lang.String getName()- Specified by:
getName
in interfaceParticleStyle
- Returns:
- The name that the style will display to the users as
-
getGuiIconMaterial
public final org.bukkit.Material getGuiIconMaterial()- Specified by:
getGuiIconMaterial
in interfaceParticleStyle
- Returns:
- The Material icon that represents this style in the GUI
-
canBeFixed
public final boolean canBeFixed()Description copied from interface:ParticleStyle
Gets if the style can be used in a FixedParticleEffect- Specified by:
canBeFixed
in interfaceParticleStyle
- Returns:
- If the style can be used in a FixedParticleEffect
-
canToggleWithMovement
public final boolean canToggleWithMovement()Description copied from interface:ParticleStyle
Gets if the style can be displayed differently based on the toggle-on-move setting when the player is moving- Specified by:
canToggleWithMovement
in interfaceParticleStyle
- Returns:
- True if it can be, otherwise False
-
canToggleWithCombat
public final boolean canToggleWithCombat()Description copied from interface:ParticleStyle
Gets if the style can be hidden if the player is in combat with the toggle-on-combat setting- Specified by:
canToggleWithCombat
in interfaceParticleStyle
- Returns:
- True if it can be, otherwise False
-
getFixedEffectOffset
public final double getFixedEffectOffset()Description copied from interface:ParticleStyle
The Y-axis offset to be applied when using '/pp fixed create looking'- Specified by:
getFixedEffectOffset
in interfaceParticleStyle
- Returns:
- How far to move the style up or down to get it centered on the block properly
-
getGuiIconMaterialNames
protected abstract java.util.List<java.lang.String> getGuiIconMaterialNames()- Returns:
- A list of Strings to try to turn into Materials
-
setDefaultSettings
Sets the default settings for this style- Parameters:
config
- The config to save to
-
loadSettings
Loads the settings for this style- Parameters:
config
- The config to load from
-