Interface SoundPacket.Builder<T extends SoundPacket.Builder<T,P>, P extends SoundPacket>
- Type Parameters:
T- the builder itselfP- the packet, the builder builds
- All Known Subinterfaces:
EntitySoundPacket.Builder<T>, LocationalSoundPacket.Builder<T>, StaticSoundPacket.Builder<T>
- Enclosing interface:
SoundPacket
public static interface SoundPacket.Builder<T extends SoundPacket.Builder<T,P>, P extends SoundPacket>
A builder to build a sound packet.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the packet.Make sure you registered your category before using it.NOTE: Make sure to set this to a unique value to avoid conflicts with other channels.opusEncodedData(byte[] data) Sets the sender of the sound packet.sequenceNumber(long sequenceNumber) Sets the sequence number of the sound packet.
-
Method Details
-
channelId
-
sender
Sets the sender of the sound packet. This must be set if this is created usingVoicechatServerApi.createPacket().- Parameters:
sender- the sender of the sound packet- Returns:
- the builder
-
opusEncodedData
- Parameters:
data- the opus encoded audio data- Returns:
- the builder
-
sequenceNumber
Sets the sequence number of the sound packet. The sequence number is set automatically for everything except when usingVoicechatServerApi.createPacket().
NOTE: You should only change this when usingVoicechatServerApi.createPacket().- Parameters:
sequenceNumber- the sequence number of the sound packet- Returns:
- the builder
-
category
Make sure you registered your category before using it. SeeVoicechatServerApi.registerVolumeCategory(VolumeCategory).- Parameters:
category- the category ID of the sound packet- Returns:
- the builder
-
build
P build()Builds the packet. NOTE: If you are missing required values, this will throw anIllegalStateException.- Returns:
- the packet
-