Search in sources :

Example 1 with PlaySoundPacket

use of cn.nukkit.network.protocol.PlaySoundPacket in project Nukkit by Nukkit.

the class BlockEntityJukebox method play.

public void play() {
    if (this.recordItem instanceof ItemRecord) {
        PlaySoundPacket pk = new PlaySoundPacket();
        pk.name = ((ItemRecord) this.recordItem).getSoundId();
        pk.pitch = 1;
        pk.volume = 1;
        pk.x = getFloorX();
        pk.y = getFloorY();
        pk.z = getFloorZ();
        Server.broadcastPacket(this.level.getPlayers().values(), pk);
    }
}
Also used : ItemRecord(cn.nukkit.item.ItemRecord) PlaySoundPacket(cn.nukkit.network.protocol.PlaySoundPacket)

Aggregations

ItemRecord (cn.nukkit.item.ItemRecord)1 PlaySoundPacket (cn.nukkit.network.protocol.PlaySoundPacket)1