public class SoundUtil extends Object
Constructor and Description |
---|
SoundUtil() |
Modifier and Type | Method and Description |
---|---|
static org.bukkit.SoundCategory |
buildSoundCategory(String category)
Convert a string to a SoundCategory.
|
static void |
playSoundAtLocationExcept(org.bukkit.Location location,
org.bukkit.Sound sound,
float volume,
float pitch,
GlowPlayer... exclude)
Plays a sound with a random pitch, but excludes specified players from hearing it.
|
static void |
playSoundPitchRange(org.bukkit.Location location,
org.bukkit.Sound sound,
float volume,
float pitchBase,
float pitchRange,
boolean allowNegative,
GlowPlayer... exclude)
Plays a sound with a random pitch, but excludes specified players from hearing it.
|
static void |
playSoundPitchRange(org.bukkit.Location location,
org.bukkit.Sound sound,
float volume,
float pitchBase,
float pitchRange,
GlowPlayer... exclude)
Plays a sound with a random pitch, but excludes specified players from hearing it.
|
static float |
randomReal(float range)
Generates a random float between
-range and range . |
public static void playSoundAtLocationExcept(org.bukkit.Location location, org.bukkit.Sound sound, float volume, float pitch, GlowPlayer... exclude)
location
- the sound locationsound
- the sound to playvolume
- the volume multiplierpitch
- the pitch modifierexclude
- the players not to play the sound forNullPointerException
- if any of the location, sound, or exclude parameters is null.public static void playSoundPitchRange(org.bukkit.Location location, org.bukkit.Sound sound, float volume, float pitchBase, float pitchRange, boolean allowNegative, GlowPlayer... exclude)
location
- the sound locationsound
- the sound to playvolume
- the volume multiplierpitchBase
- if allowNegative
, the average pitch modifier; otherwise, the
minimumpitchRange
- the maximum deviation of the pitch modifier compared to pitchBase
allowNegative
- if true, distribution is triangular rather than uniformexclude
- the players not to play the sound forpublic static void playSoundPitchRange(org.bukkit.Location location, org.bukkit.Sound sound, float volume, float pitchBase, float pitchRange, GlowPlayer... exclude)
location
- the sound locationsound
- the sound to playvolume
- the volume multiplierpitchBase
- the average pitch modifier.pitchRange
- the maximum deviation of the pitch modifier compared to pitchBase
exclude
- the players not to play the sound forpublic static float randomReal(float range)
-range
and range
.range
- the bounds of the random float.public static org.bukkit.SoundCategory buildSoundCategory(String category)
category
- The string name of the categoryCopyright © 2021. All rights reserved.