mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
SPIGOT-1549: Fix custom String sounds.
This commit is contained in:
parent
7863085a62
commit
ef13ca4444
1 changed files with 5 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue