mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 03:52:45 +01:00
Add Player.stopSound
By: md_5 <git@md-5.net>
This commit is contained in:
parent
5dffeea6ee
commit
ec0a8a1910
1 changed files with 15 additions and 0 deletions
|
@ -310,6 +310,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||||
getHandle().playerConnection.sendPacket(packet);
|
getHandle().playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopSound(Sound sound) {
|
||||||
|
stopSound(CraftSound.getSound(sound));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stopSound(String sound) {
|
||||||
|
if (getHandle().playerConnection == null) return;
|
||||||
|
PacketDataSerializer packetdataserializer = new PacketDataSerializer(Unpooled.buffer());
|
||||||
|
|
||||||
|
packetdataserializer.a(sound);
|
||||||
|
packetdataserializer.a("");
|
||||||
|
getHandle().playerConnection.sendPacket(new PacketPlayOutCustomPayload("MC|StopSound", packetdataserializer));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void playEffect(Location loc, Effect effect, int data) {
|
public void playEffect(Location loc, Effect effect, int data) {
|
||||||
if (getHandle().playerConnection == null) return;
|
if (getHandle().playerConnection == null) return;
|
||||||
|
|
Loading…
Reference in a new issue