Interface VoiceProjectionService


public interface VoiceProjectionService
Service managing player voice projections, body anchors, and remote acoustic routing.
  • 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
    • getVolumeCategory

      de.maxhenkel.voicechat.api.VolumeCategory getVolumeCategory()
      Retrieves the VolumeCategory used for projection channels.
    • createProjection

      @NotNull @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull VoiceLocation 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 @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull VoiceLocation anchorLocation, @Nullable @Nullable UUID anchorEntityUuid)
      Creates a dynamic voice projection bound to a moving entity.
      Parameters:
      playerUuid - the player UUID
      anchorLocation - the initial location
      anchorEntityUuid - the entity UUID to attach the projection to
      Returns:
      the created VoiceProjection
    • register

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

      default void registerProjection(@NotNull @NotNull VoiceProjection projection)
    • 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 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
    • 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
    • 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 VoiceLocation 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.