mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +01:00
Don't round the location of playSound to the center of a block
This commit is contained in:
parent
09b4549a29
commit
bad994e724
@ -306,11 +306,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public void playSound(Location loc, String sound, float volume, float pitch) {
|
public void playSound(Location loc, String sound, float volume, float pitch) {
|
||||||
if (loc == null || sound == null || getHandle().playerConnection == null) return;
|
if (loc == null || sound == null || getHandle().playerConnection == null) return;
|
||||||
|
|
||||||
double x = loc.getBlockX() + 0.5;
|
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect(sound), SoundCategory.MASTER, loc.getX(), loc.getY(), loc.getZ(), volume, pitch);
|
||||||
double y = loc.getBlockY() + 0.5;
|
|
||||||
double z = loc.getBlockZ() + 0.5;
|
|
||||||
|
|
||||||
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect(sound), SoundCategory.MASTER, x, y, z, volume, pitch);
|
|
||||||
getHandle().playerConnection.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user