Interface VoicechatConnection


public interface VoicechatConnection
Note: It is not guaranteed that the state of this connection object is up to date. Please re-fetch the connection object to get the latest state.
  • Method Summary

    Modifier and Type
    Method
    Description
    Note: This only returns the group the player was in when fetching this connection object.
     
    boolean
    This might not represent the actual state of the voice chat connection, since other voice chat plugins can fake having a player connected.
    boolean
    Note: This only returns if the player has the voice chat disabled when fetching this connection object.
    boolean
    Note: This only returns if the player was in a group when fetching this connection object.
    boolean
     
    void
    setConnected(boolean connected)
    The players disconnected state will reset if its actual disconnected state changes or if the player reconnects.
    void
    setDisabled(boolean disabled)
    Sets the players disabled state.
    void
    setGroup(Group group)
    Joins this player to the provided group.
  • Method Details

    • getGroup

      @Nullable Group getGroup()
      Note: This only returns the group the player was in when fetching this connection object. Calling setGroup(Group) won't update the return value of this method.
      Returns:
      the group of the player - null if the player is not in a group
    • isInGroup

      boolean isInGroup()
      Note: This only returns if the player was in a group when fetching this connection object. Calling setGroup(Group) won't update the return value of this method.
      Returns:
      if the player is in a group
    • setGroup

      void setGroup(@Nullable Group group)
      Joins this player to the provided group.
      Parameters:
      group - the group to join or null to leave the current group
    • isConnected

      boolean isConnected()
      This might not represent the actual state of the voice chat connection, since other voice chat plugins can fake having a player connected.
      Note: This only returns if the player was connected fetching this connection object. Calling setConnected(boolean) won't update the return value of this method.
      Returns:
      if the player is connected to voice chat
    • setConnected

      void setConnected(boolean connected)
      The players disconnected state will reset if its actual disconnected state changes or if the player reconnects.
      NOTE: This method will only work for players that don't have the mod installed. See isInstalled().
      Parameters:
      connected - if the player should be shown as connected to voice chat
    • isDisabled

      boolean isDisabled()
      Note: This only returns if the player has the voice chat disabled when fetching this connection object. Calling setDisabled(boolean) won't update the return value of this method.
      Returns:
      If the player muted the sound
    • setDisabled

      void setDisabled(boolean disabled)
      Sets the players disabled state. NOTE: This method will only work for players that don't have the mod installed. See isInstalled().
      Parameters:
      disabled - if the player should have the voice chat disabled icon
    • isInstalled

      boolean isInstalled()
      Returns:
      if the player has a version of voice chat installed that is compatible with the server
    • getPlayer

      ServerPlayer getPlayer()
      Returns:
      the player