Class VoiceWiretap

java.lang.Object
fr.dreamin.dreamvoice.api.wiretap.model.VoiceWiretap

public final class VoiceWiretap extends Object
Model representing a covert spy microphone / wiretap listening point. Can be fixed in the world or attached to moving entities with live eavesdropping and recording.
  • Constructor Details

    • VoiceWiretap

      public VoiceWiretap(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.Location location)
    • VoiceWiretap

      public VoiceWiretap(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.entity.Entity targetEntity)
    • VoiceWiretap

      public VoiceWiretap(@NotNull @NotNull UUID uuid, @NotNull @NotNull String name, @NotNull @NotNull org.bukkit.Location location)
  • Method Details

    • getLocation

      @NotNull public @NotNull org.bukkit.Location getLocation()
      Resolves the wiretap position, dynamically tracking the target entity if attached and valid.
      Returns:
      current Location
    • isAttachedToEntity

      public boolean isAttachedToEntity()
      Checks whether this wiretap is actively attached to a valid entity.
      Returns:
      true if attached
    • addListener

      public void addListener(@NotNull @NotNull UUID playerUuid)
      Adds an eavesdropping listener player to this wiretap.
      Parameters:
      playerUuid - the player UUID
    • removeListener

      public void removeListener(@NotNull @NotNull UUID playerUuid)
      Removes an eavesdropping listener player from this wiretap.
      Parameters:
      playerUuid - the player UUID
    • hasListener

      public boolean hasListener(@NotNull @NotNull UUID playerUuid)
      Checks whether a player is actively listening to this wiretap.
      Parameters:
      playerUuid - the player UUID
      Returns:
      true if listening
    • getListeners

      @NotNull public @NotNull Set<UUID> getListeners()
      Returns an unmodifiable set of all active listener player UUIDs.
      Returns:
      set of listener UUIDs
    • startRecording

      @NotNull public @NotNull VoiceRecording startRecording()
      Starts secret audio recording on this wiretap.
      Returns:
      the started VoiceRecording
    • stopRecording

      @Nullable public @Nullable VoiceRecording stopRecording()
      Stops active secret recording and stores the completed recording in history.
      Returns:
      the finished VoiceRecording, or null if not recording
    • isRecording

      public boolean isRecording()
      Checks whether this wiretap is actively recording audio.
      Returns:
      true if recording
    • getRecordings

      @NotNull public @NotNull List<VoiceRecording> getRecordings()
      Returns an unmodifiable list of all completed recordings from this wiretap.
      Returns:
      list of VoiceRecordings