diff options
author | Wesley Wolfe <weswolf@aol.com> | 2013-08-03 18:26:31 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-08-03 18:26:31 -0500 |
commit | 6a779790eb2308aefaa0b1416d35a4b4fdb7012e (patch) | |
tree | 77d1216222233c4b44b3d77802516fc30b55993c /src | |
parent | 0971807a343040c202fad4265718270ecde684e7 (diff) | |
download | bukkit-6a779790eb2308aefaa0b1416d35a4b4fdb7012e.tar bukkit-6a779790eb2308aefaa0b1416d35a4b4fdb7012e.tar.gz bukkit-6a779790eb2308aefaa0b1416d35a4b4fdb7012e.tar.lz bukkit-6a779790eb2308aefaa0b1416d35a4b4fdb7012e.tar.xz bukkit-6a779790eb2308aefaa0b1416d35a4b4fdb7012e.zip |
Use player as point of reference for min volume. Fixes BUKKIT-4640
When the minimum volume is being used because the distance is over a
threshold, the unit vector delta should be added to the player's
location, instead of where the command specified location.
This change makes the player's location the point of reference for
playing sounds when distance to volume scale is lower than minimum
specified volume.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java b/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java index 3dfb0483..0cb5ca2d 100644 --- a/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PlaySoundCommand.java @@ -74,10 +74,10 @@ public class PlaySoundCommand extends VanillaCommand { final double delta = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ) / 2.0D; if (delta > 0.0D) { - soundLocation.add(deltaX / delta, deltaY / delta, deltaZ / delta); + location.add(deltaX / delta, deltaY / delta, deltaZ / delta); } - player.playSound(soundLocation, soundArg, (float) minimumVolume, (float) pitch); + player.playSound(location, soundArg, (float) minimumVolume, (float) pitch); } else { player.playSound(soundLocation, soundArg, (float) volume, (float) pitch); } |