Class VoicePeerOptions

java.lang.Object
com.craftmend.openaudiomc.api.voice.VoicePeerOptions
All Implemented Interfaces:
Cloneable

public class VoicePeerOptions extends Object implements Cloneable
Voice chat options are special flags set for each peer, giving the client extra information on how the connection should be treated and rendered. The initial state is defined by the default values in this class, and get passed during the connection request packet sent towards the client. These settings can also be changed on the fly, by pushing them in a separate client options update packet without needing the session to reload.
  • Field Details

    • DEFAULT

      public static final VoicePeerOptions DEFAULT
      Singleton default. Means we don't have to create a new object every time we want to use the default.
  • Constructor Details

    • VoicePeerOptions

      public VoicePeerOptions()
    • VoicePeerOptions

      public VoicePeerOptions(boolean visible, boolean spatialAudio, @Nullable @Nullable DisplayOverride displayOverride)
  • Method Details

    • clone

      public VoicePeerOptions clone()
      Clone the object
      Overrides:
      clone in class Object
      Returns:
      a clone of the object
    • isVisible

      public boolean isVisible()
      Weather or not the peer should be visible in the web UI. The client will still setup a voice stream to the peer if set to false, but completely hide the person's name/uuid from the web UI. This can be used for example to hide an opponent in a game, while still letting them hear each other.
    • isSpatialAudio

      public boolean isSpatialAudio()
      This flag decides if the stream should be rendered as a spatial stream. This also requires the client to receive location updates every few ticks. Setting it to false just renders it as a normal mono stream (think discord/teamspeak). The icon next to someone's name also gets controlled by this flag.
    • getDisplayOverride

      @Nullable public @Nullable DisplayOverride getDisplayOverride()
      An optional display override, which can be used to change the display name and skin of a player in the voice chat system. This can be left null if no override is needed.
      Since:
      6.10.2
    • setVisible

      public void setVisible(boolean visible)
      Weather or not the peer should be visible in the web UI. The client will still setup a voice stream to the peer if set to false, but completely hide the person's name/uuid from the web UI. This can be used for example to hide an opponent in a game, while still letting them hear each other.
    • setSpatialAudio

      public void setSpatialAudio(boolean spatialAudio)
      This flag decides if the stream should be rendered as a spatial stream. This also requires the client to receive location updates every few ticks. Setting it to false just renders it as a normal mono stream (think discord/teamspeak). The icon next to someone's name also gets controlled by this flag.
    • setDisplayOverride

      public void setDisplayOverride(@Nullable @Nullable DisplayOverride displayOverride)
      An optional display override, which can be used to change the display name and skin of a player in the voice chat system. This can be left null if no override is needed.
      Since:
      6.10.2
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object