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
-
Method Details
-
channelId
NOTE: Make sure to set this to a unique value to avoid conflicts with other channels. This value needs to be the same when sending multiple packets of the same channel.- Parameters:
channelId
- the channel ID of the sound packet- Returns:
- the builder
-
opusEncodedData
- Parameters:
data
- the opus encoded audio data- 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
-