java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.core.implementations.AudioPlayerSpigot
All Implemented Interfaces:
IAudioPlayer

@Singleton public class AudioPlayerSpigot extends Object implements IAudioPlayer
Represents an implementation of IAudioPlayer for the Spigot platform.
  • Constructor Details

    • AudioPlayerSpigot

      @Inject public AudioPlayerSpigot(IExecutor executor)
  • Method Details

    • playSound

      public void playSound(double x, double y, double z, IWorld world, String sound, float volume, float pitch, double range, @Nullable @Nullable DoubleUnaryOperator attenuationFunction)
      Description copied from interface: IAudioPlayer
      Play a sound for all players in a range of 15 blocks around the provided location.
      Specified by:
      playSound in interface IAudioPlayer
      Parameters:
      x - The x coordinate of the location.
      y - The y coordinate of the location.
      z - The z coordinate of the location.
      world - The world of the position.
      sound - The sound to play.
      volume - The volume
      pitch - The pitch
      range - The range of the sound.
      attenuationFunction - The function that determines how the volume of the sound changes with distance. If null, the volume will not change. The function takes the distance as input and returns the multiplier for the volume.

      For example, if the function returns 0.5 for a distance of 10, the volume will be multiplied by 0.5 for all players that are 10 blocks away from the sound.