Interface VoiceProjectionService


public interface VoiceProjectionService
Service managing player voice projections, body anchors, and remote acoustic routing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears and removes all active voice projections.
    createProjection(@NotNull UUID playerUuid, @NotNull org.bukkit.Location anchorLocation)
    Creates a static voice projection point for a player.
    createProjection(@NotNull UUID playerUuid, @NotNull org.bukkit.entity.Entity anchorEntity)
    Creates a dynamic voice projection bound to a moving entity.
    default @NotNull VoiceProjection
    createProjection(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location anchorLocation)
     
    default @NotNull VoiceProjection
    createProjection(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.entity.Entity anchorEntity)
     
    de.maxhenkel.voicechat.api.VoicechatServerApi
    Gets the underlying VoicechatServerApi instance.
    @Nullable VoiceProjection
    getProjection(@NotNull UUID playerUuid)
    Retrieves the active voice projection for a player.
    default @Nullable VoiceProjection
    getProjection(@NotNull org.bukkit.entity.Player player)
     
    @Nullable VoiceProjection
    getProjectionById(@NotNull UUID projectionId)
    Retrieves a projection by its unique ID.
    Returns all active voice projections.
    boolean
    hasProjection(@NotNull UUID playerUuid)
    Checks whether a player has an active voice projection.
    default boolean
    hasProjection(@NotNull org.bukkit.entity.Player player)
     
    void
    init(@NotNull de.maxhenkel.voicechat.api.VoicechatServerApi api)
    Initializes the projection service with the Simple Voice Chat server API.
    void
    Reloads saved projections from disk.
    void
    register(@NotNull VoiceProjection projection)
    Registers an existing projection into the service.
    default void
    removeProjection(@NotNull VoiceProjection projection)
     
    void
    removeProjection(@NotNull UUID playerUuid)
    Removes a player's active voice projection.
    default void
    removeProjection(@NotNull org.bukkit.entity.Player player)
     
    void
    Saves all active projections to disk.
    void
    updateLocation(@NotNull UUID playerUuid, @NotNull org.bukkit.Location newLocation)
    Updates the static coordinates of a player's projection.
  • Method Details

    • init

      void init(@NotNull @NotNull de.maxhenkel.voicechat.api.VoicechatServerApi api)
      Initializes the projection service with the Simple Voice Chat server API.
      Parameters:
      api - the VoicechatServerApi instance
    • getAPI

      de.maxhenkel.voicechat.api.VoicechatServerApi getAPI()
      Gets the underlying VoicechatServerApi instance.
      Returns:
      the active API instance
    • createProjection

      @NotNull @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull org.bukkit.Location anchorLocation)
      Creates a static voice projection point for a player.
      Parameters:
      playerUuid - the player UUID
      anchorLocation - the static location of the anchor
      Returns:
      the created VoiceProjection
    • createProjection

      @NotNull default @NotNull VoiceProjection createProjection(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location anchorLocation)
    • createProjection

      @NotNull @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull org.bukkit.entity.Entity anchorEntity)
      Creates a dynamic voice projection bound to a moving entity.
      Parameters:
      playerUuid - the player UUID
      anchorEntity - the entity to attach the projection to
      Returns:
      the created VoiceProjection
    • createProjection

      @NotNull default @NotNull VoiceProjection createProjection(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.entity.Entity anchorEntity)
    • register

      void register(@NotNull @NotNull VoiceProjection projection)
      Registers an existing projection into the service.
      Parameters:
      projection - the projection instance
    • removeProjection

      void removeProjection(@NotNull @NotNull UUID playerUuid)
      Removes a player's active voice projection.
      Parameters:
      playerUuid - the player UUID
    • removeProjection

      default void removeProjection(@NotNull @NotNull org.bukkit.entity.Player player)
    • removeProjection

      default void removeProjection(@NotNull @NotNull VoiceProjection projection)
    • getProjection

      @Nullable @Nullable VoiceProjection getProjection(@NotNull @NotNull UUID playerUuid)
      Retrieves the active voice projection for a player.
      Parameters:
      playerUuid - the player UUID
      Returns:
      the VoiceProjection, or null if none active
    • getProjection

      @Nullable default @Nullable VoiceProjection getProjection(@NotNull @NotNull org.bukkit.entity.Player player)
    • getProjectionById

      @Nullable @Nullable VoiceProjection getProjectionById(@NotNull @NotNull UUID projectionId)
      Retrieves a projection by its unique ID.
      Parameters:
      projectionId - the projection UUID
      Returns:
      the VoiceProjection, or null if not found
    • hasProjection

      boolean hasProjection(@NotNull @NotNull UUID playerUuid)
      Checks whether a player has an active voice projection.
      Parameters:
      playerUuid - the player UUID
      Returns:
      true if an active projection exists
    • hasProjection

      default boolean hasProjection(@NotNull @NotNull org.bukkit.entity.Player player)
    • getProjections

      @NotNull @NotNull Collection<VoiceProjection> getProjections()
      Returns all active voice projections.
      Returns:
      collection of active VoiceProjections
    • clearProjections

      void clearProjections()
      Clears and removes all active voice projections.
    • updateLocation

      void updateLocation(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull org.bukkit.Location newLocation)
      Updates the static coordinates of a player's projection.
      Parameters:
      playerUuid - the player UUID
      newLocation - the updated location
    • save

      void save()
      Saves all active projections to disk.
    • load

      void load()
      Reloads saved projections from disk.