Interface SoundPacket.Builder<T extends SoundPacket.Builder<T,P>,P extends SoundPacket>

Type Parameters:
T - the builder itself
P - 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 Type
    Method
    Description
    Builds the packet.
    category(String category)
    Make sure you registered your category before using it.
    channelId(UUID channelId)
    NOTE: Make sure to set this to a unique value to avoid conflicts with other channels.
    opusEncodedData(byte[] data)
     
  • Method Details

    • channelId

      T channelId(UUID 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

      T opusEncodedData(byte[] data)
      Parameters:
      data - the opus encoded audio data
      Returns:
      the builder
    • category

      T category(@Nullable String category)
      Make sure you registered your category before using it. See VoicechatServerApi.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 an IllegalStateException.
      Returns:
      the packet