#752: Add the ability to retrieve hit, step, fall, and other sounds from blocks.

By: Martoph <sager1018@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2020-11-26 09:36:57 +11:00
parent ec41049c8d
commit d9f5dbb3e6
7 changed files with 99 additions and 1012 deletions

View File

@@ -475,7 +475,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch) {
if (loc == null || sound == null || category == null || getHandle().playerConnection == null) return;
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect(CraftSound.getSound(sound)), net.minecraft.server.SoundCategory.valueOf(category.name()), loc.getX(), loc.getY(), loc.getZ(), volume, pitch);
PacketPlayOutNamedSoundEffect packet = new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect(sound), net.minecraft.server.SoundCategory.valueOf(category.name()), loc.getX(), loc.getY(), loc.getZ(), volume, pitch);
getHandle().playerConnection.sendPacket(packet);
}
@@ -499,7 +499,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void stopSound(Sound sound, org.bukkit.SoundCategory category) {
stopSound(CraftSound.getSound(sound), category);
stopSound(sound.getKey().getKey(), category);
}
@Override