SPIGOT-6436: Add Player#stopAllSounds

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2021-11-05 21:02:22 +11:00
parent 148964d14e
commit e4cce46e63

View File

@ -513,6 +513,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().connection.sendPacket(new PacketPlayOutStopSound(new MinecraftKey(sound), category == null ? net.minecraft.sounds.SoundCategory.MASTER : net.minecraft.sounds.SoundCategory.valueOf(category.name())));
}
@Override
public void stopAllSounds() {
if (getHandle().connection == null) return;
getHandle().connection.sendPacket(new PacketPlayOutStopSound(null, null));
}
@Override
public void playEffect(Location loc, Effect effect, int data) {
if (getHandle().connection == null) return;