Class AudioPlayerSpigot
java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.core.implementations.AudioPlayerSpigot
- All Implemented Interfaces:
IAudioPlayer
Represents an implementation of
IAudioPlayer for the Spigot platform.-
Field Summary
Fields inherited from interface nl.pim16aap2.animatedarchitecture.core.audio.IAudioPlayer
AUDIO_RANGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidplaySound(double x, double y, double z, IWorld world, String sound, float volume, float pitch, double range, @Nullable DoubleUnaryOperator attenuationFunction) Play a sound for all players in a range of 15 blocks around the provided location.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.audio.IAudioPlayer
playSound, playSound, playSound, playSound
-
Constructor Details
-
AudioPlayerSpigot
-
-
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:IAudioPlayerPlay a sound for all players in a range of 15 blocks around the provided location.- Specified by:
playSoundin interfaceIAudioPlayer- 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 volumepitch- The pitchrange- 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.
-