3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00

SPIGOT-1549: Fix custom String sounds.

Dieser Commit ist enthalten in:
Lukas Hennig 2016-03-04 15:55:40 +11:00 committet von md_5
Ursprung 7863085a62
Commit ef13ca4444

Datei anzeigen

@ -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);
}