use of org.spongepowered.api.block.entity.Jukebox in project SpongeCommon by SpongePowered.
the class SpongeCommonEventFactory method callPlaySoundRecordEvent.
public static PlaySoundEvent.Record callPlaySoundRecordEvent(final Cause cause, final JukeboxBlockEntity jukebox, final MusicDisc recordType, final int data) {
final Jukebox apiJuke = (Jukebox) jukebox;
final ServerLocation location = (ServerLocation) apiJuke.location();
final PlaySoundEvent.Record event = data == 0 ? SpongeEventFactory.createPlaySoundEventRecordStart(cause, apiJuke, location, recordType, Sound.Source.RECORD, recordType.sound(), 1.0F, 4.0F) : SpongeEventFactory.createPlaySoundEventRecordStop(cause, apiJuke, location, recordType, Sound.Source.RECORD, recordType.sound(), 1.0F, 4.0F);
SpongeCommon.post(event);
return event;
}
Aggregations