Interface VoiceRoomService


public interface VoiceRoomService
Service managing acoustic rooms, soundproofing boundaries, and spatial reverberation zones.
  • Method Details

    • registerRoom

      void registerRoom(@NotNull @NotNull AcousticRoom room)
      Registers a new acoustic room.
      Parameters:
      room - the room instance
    • unregisterRoom

      void unregisterRoom(@NotNull @NotNull String roomId)
      Deletes an acoustic room by ID.
      Parameters:
      roomId - room identifier
    • getRoom

      @NotNull @NotNull Optional<AcousticRoom> getRoom(@NotNull @NotNull String roomId)
      Retrieves an acoustic room by its identifier.
      Parameters:
      roomId - room identifier
      Returns:
      optional room
    • getRooms

      @NotNull @NotNull Collection<AcousticRoom> getRooms()
      Retrieves all registered acoustic rooms.
      Returns:
      collection of rooms
    • getRoomAt

      @NotNull @NotNull Optional<AcousticRoom> getRoomAt(@NotNull @NotNull org.bukkit.Location location)
      Finds the acoustic room encompassing a specific world location.
      Parameters:
      location - world location
      Returns:
      optional room
    • getPlayerRoom

      @NotNull @NotNull Optional<AcousticRoom> getPlayerRoom(@NotNull @NotNull UUID playerUuid)
      Finds the acoustic room a player is currently located in.
      Parameters:
      playerUuid - player UUID
      Returns:
      optional room
    • registerPreset

      void registerPreset(@NotNull @NotNull RoomPreset preset)
      Registers or updates an acoustic preset.
      Parameters:
      preset - preset definition
    • getPreset

      @NotNull @NotNull Optional<RoomPreset> getPreset(@NotNull @NotNull String presetId)
      Retrieves an acoustic preset by ID.
      Parameters:
      presetId - preset ID
      Returns:
      optional preset
    • getPresets

      @NotNull @NotNull Collection<RoomPreset> getPresets()
      Retrieves all available room presets.
      Returns:
      collection of presets
    • getEffectiveIsolation

      int getEffectiveIsolation(@NotNull @NotNull AcousticRoom room)
      Returns effective sound isolation percentage for a given room (0 to 100).
      Parameters:
      room - acoustic room
      Returns:
      isolation percentage
    • calculateRoomAttenuationDb

      double calculateRoomAttenuationDb(@NotNull @NotNull UUID senderUuid, @NotNull @NotNull UUID receiverUuid)
      Checks whether two players can hear each other taking acoustic room boundaries into account.
      Parameters:
      senderUuid - sender player UUID
      receiverUuid - receiver player UUID
      Returns:
      attenuation loss in decibels (e.g. 0.0 for direct, 100.0 for completely blocked)
    • reload

      void reload()
      Reloads rooms and presets configuration.
    • save

      void save()
      Saves rooms data to storage.