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 FixedParticleEffect
    boolean canToggleWithCombat()
    Gets if the style can be hidden if the player is in combat with the toggle-on-combat setting
    boolean canToggleWithMovement()
    Gets if the style can be displayed differently based on the toggle-on-move setting when the player is moving
    double 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 style
    protected abstract void setDefaultSettings​(CommentedFileConfiguration config)
    Sets the default settings for this style
    protected 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

    Methods 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 name
      value - The setting value
      comments - Comments for the setting
    • isEnabled

      public final boolean isEnabled()
      Specified by:
      isEnabled in interface ParticleStyle
      Returns:
      true if the style is enabled, false otherwise
    • getInternalName

      public final java.lang.String getInternalName()
      Specified by:
      getInternalName in interface ParticleStyle
      Returns:
      The style's internal name that will always remain constant
    • getName

      public final java.lang.String getName()
      Specified by:
      getName in interface ParticleStyle
      Returns:
      The name that the style will display to the users as
    • getGuiIconMaterial

      public final org.bukkit.Material getGuiIconMaterial()
      Specified by:
      getGuiIconMaterial in interface ParticleStyle
      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 interface ParticleStyle
      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 interface ParticleStyle
      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 interface ParticleStyle
      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 interface ParticleStyle
      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

      protected abstract void setDefaultSettings​(CommentedFileConfiguration config)
      Sets the default settings for this style
      Parameters:
      config - The config to save to
    • loadSettings

      protected abstract void loadSettings​(CommentedFileConfiguration config)
      Loads the settings for this style
      Parameters:
      config - The config to load from