SPIGOT-7071: Add Player#stopSound(SoundCategory category)

This commit is contained in:
SkytAsul 2022-07-01 20:46:16 +10:00 committed by md_5
parent 68f888ded3
commit 5c9a5f628a
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

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