From 5377574bc26a2a62bba63efdba7e9aad4c59c786 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 1 Jul 2022 20:46:16 +1000 Subject: [PATCH] SPIGOT-7071: Add Player#stopSound(SoundCategory category) By: SkytAsul --- .../java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 2304c078a9..616c85bc2d 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -554,6 +554,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().connection.send(new PacketPlayOutStopSound(new MinecraftKey(sound), category == null ? net.minecraft.sounds.SoundCategory.MASTER : net.minecraft.sounds.SoundCategory.valueOf(category.name()))); } + @Override + public void stopSound(org.bukkit.SoundCategory category) { + if (getHandle().connection == null) return; + + getHandle().connection.send(new PacketPlayOutStopSound(null, net.minecraft.sounds.SoundCategory.valueOf(category.name()))); + } + @Override public void stopAllSounds() { if (getHandle().connection == null) return;