Class Speaker

java.lang.Object
fr.dreamin.dreamvoice.api.speaker.model.Speaker

public final class Speaker extends Object
Model representing a 3D locational speaker in the Minecraft world. Supports dual channels (speech + music), static or mobile entity attachment, and access controls.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder class for Speaker.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    Clears all authorized speakers.
    @NotNull Set<UUID>
    Returns an unmodifiable view of authorized speaker UUIDs.
    @NotNull org.bukkit.Location
    Resolves the current location of the speaker, updating coordinates if attached to an entity.
    boolean
    Checks whether audio is currently playing through this speaker.
    boolean
    isSpeakerAllowed(@NotNull UUID speakerUuid)
    Checks whether a player is authorized to broadcast their voice through this speaker.
    void
    linkSpeaker(@NotNull UUID playerUuid)
    Authorizes a player to broadcast their voice in RESTRICTED mode.
    void
    Stops any currently active audio playback on this speaker.
    void
    unlinkSpeaker(@NotNull UUID playerUuid)
    Revokes broadcasting permission from a player.
    void
    updateDistance(@NotNull Float distance)
    Updates the audio falloff distance of the speaker.
    void
    updateFilter(@Nullable Predicate<de.maxhenkel.voicechat.api.ServerPlayer> filter)
    Updates the listener filter predicate of the speaker.
    void
    updatePosition(@NotNull org.bukkit.Location location)
    Updates the speaker position in world space and notifies SVC audio channels.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isSpeakerAllowed

      public boolean isSpeakerAllowed(@NotNull @NotNull UUID speakerUuid)
      Checks whether a player is authorized to broadcast their voice through this speaker.
      Parameters:
      speakerUuid - the player UUID
      Returns:
      true if allowed
    • linkSpeaker

      public void linkSpeaker(@NotNull @NotNull UUID playerUuid)
      Authorizes a player to broadcast their voice in RESTRICTED mode.
      Parameters:
      playerUuid - the player UUID
    • unlinkSpeaker

      public void unlinkSpeaker(@NotNull @NotNull UUID playerUuid)
      Revokes broadcasting permission from a player.
      Parameters:
      playerUuid - the player UUID
    • clearAllowedSpeakers

      public void clearAllowedSpeakers()
      Clears all authorized speakers.
    • getAllowedSpeakers

      @NotNull public @NotNull Set<UUID> getAllowedSpeakers()
      Returns an unmodifiable view of authorized speaker UUIDs.
      Returns:
      set of authorized player UUIDs
    • stopPlaying

      public void stopPlaying()
      Stops any currently active audio playback on this speaker.
    • isPlaying

      public boolean isPlaying()
      Checks whether audio is currently playing through this speaker.
      Returns:
      true if active playback in progress
    • getLocation

      @NotNull public @NotNull org.bukkit.Location getLocation()
      Resolves the current location of the speaker, updating coordinates if attached to an entity.
      Returns:
      current Location
    • updatePosition

      public void updatePosition(@NotNull @NotNull org.bukkit.Location location)
      Updates the speaker position in world space and notifies SVC audio channels.
      Parameters:
      location - the new location
    • updateDistance

      public void updateDistance(@NotNull @NotNull Float distance)
      Updates the audio falloff distance of the speaker.
      Parameters:
      distance - new distance in blocks
    • updateFilter

      public void updateFilter(@Nullable @Nullable Predicate<de.maxhenkel.voicechat.api.ServerPlayer> filter)
      Updates the listener filter predicate of the speaker.
      Parameters:
      filter - listener predicate
    • builder

      public static Speaker.Builder builder()