Class CustomSoundMechanic

All Implemented Interfaces:
InlineSerializer<Mechanic>, Serializer<Mechanic>, net.kyori.adventure.key.Keyed, org.bukkit.Keyed

public class CustomSoundMechanic extends PlayerEffectMechanic
  • Constructor Details

    • CustomSoundMechanic

      public CustomSoundMechanic()
      Default constructor for serializer.
    • CustomSoundMechanic

      public CustomSoundMechanic(String sound, float volume, float pitch, float noise, org.bukkit.SoundCategory category, Targeter listeners, List<Condition> listenerConditions)
  • Method Details

    • getSound

      public String getSound()
    • getVolume

      public float getVolume()
    • getPitch

      public float getPitch()
    • getNoise

      public float getNoise()
    • getCategory

      public Object getCategory()
    • getListeners

      public Targeter getListeners()
    • getListenerConditions

      public List<Condition> getListenerConditions()
    • use0

      protected void use0(CastData cast)
      Description copied from class: Mechanic
      This method should be overridden to define the behavior of the Mechanic. For example, a Potion mechanic may use the CastData.getTarget() method to apply a potion effect.
      Specified by:
      use0 in class Mechanic
      Parameters:
      cast - The non-null data including source/target information.
    • getKey

      @NotNull public @NotNull org.bukkit.NamespacedKey getKey()
    • getWikiLink

      @Nullable public @Nullable String getWikiLink()
      Description copied from interface: Serializer
      Returns a link to the page on the wiki that describes this serializer. This method is called from SerializeData, and is used to help the user find potential solutions to their problem.
      Returns:
      The nullable link to the wiki.
    • serialize

      @NotNull public @NotNull Mechanic serialize(@NotNull @NotNull me.deecaad.core.file.SerializeData data) throws me.deecaad.core.file.SerializerException
      Description copied from interface: Serializer
      Instantiates a new Object to be added into the finalized configuration. The object should be built off of SerializeData.getConfig(). If there is any misconfiguration (or any other issue preventing the construction of an object), then this method should throw a SerializerException. This method may not return null.
      Parameters:
      data - The non-null data containing config
      Returns:
      The non-null serialized data.
      Throws:
      me.deecaad.core.file.SerializerException - If there is an error in config.
    • playFor

      public void playFor(CastData cast, List<org.bukkit.entity.Player> viewers)
      Description copied from class: PlayerEffectMechanic
      Similar to Mechanic.use0(CastData) but instead of using this Mechanic's viewer targeter and viewer conditions, the mechanic is used for the given viewer.

      This is done to address a performance issue associated with having multiple per-player mechanics in the same list. See #311 for more info.

      Specified by:
      playFor in class PlayerEffectMechanic
      Parameters:
      cast - The source of the mechanic... who is casting.
      viewers - The target of the mechanic.
    • getViewerTargeter

      @Nullable public @Nullable Targeter getViewerTargeter()
      Specified by:
      getViewerTargeter in class PlayerEffectMechanic
    • getViewerConditions

      public List<Condition> getViewerConditions()
      Specified by:
      getViewerConditions in class PlayerEffectMechanic