diff options
author | Lukas Hennig <lukas@wirsindwir.de> | 2016-03-04 15:55:40 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-04 15:55:40 +1100 |
commit | ef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe (patch) | |
tree | 1cfbe8d17ed632a10754dbb71967c1f3a545b95d /src/main/java | |
parent | 7863085a62b75733c4ee2f6b57c5efa519450804 (diff) | |
download | craftbukkit-ef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe.tar craftbukkit-ef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe.tar.gz craftbukkit-ef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe.tar.lz craftbukkit-ef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe.tar.xz craftbukkit-ef13ca4444c53ec5fd844ab078c7dcbf0e1f0bbe.zip |
SPIGOT-1549: Fix custom String sounds.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 0f9eeb96..303da2d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -296,17 +296,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void playSound(Location loc, Sound sound, float volume, float pitch) { - if (sound == null) { - return; - } - playSound(loc, CraftSound.getSound(sound), volume, pitch); + if (loc == null || sound == null || getHandle().playerConnection == null) return; + + PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect(CraftSound.getSound(sound)), SoundCategory.MASTER, loc.getX(), loc.getY(), loc.getZ(), volume, pitch); + getHandle().playerConnection.sendPacket(packet); } @Override public void playSound(Location loc, String sound, float volume, float pitch) { if (loc == null || sound == null || getHandle().playerConnection == null) return; - PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect(sound), SoundCategory.MASTER, loc.getX(), loc.getY(), loc.getZ(), volume, pitch); + PacketPlayOutCustomSoundEffect packet = new PacketPlayOutCustomSoundEffect(sound, SoundCategory.MASTER, loc.getX(), loc.getY(), loc.getZ(), volume, pitch); getHandle().playerConnection.sendPacket(packet); } |