Class Speaker
java.lang.Object
fr.dreamin.dreamvoice.api.speaker.model.Speaker
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic Speaker.Builderbuilder()voidClears all authorized speakers.Returns an unmodifiable view of authorized speaker UUIDs.@NotNull org.bukkit.LocationResolves the current location of the speaker, updating coordinates if attached to an entity.booleanChecks whether audio is currently playing through this speaker.booleanisSpeakerAllowed(@NotNull UUID speakerUuid) Checks whether a player is authorized to broadcast their voice through this speaker.voidlinkSpeaker(@NotNull UUID playerUuid) Authorizes a player to broadcast their voice in RESTRICTED mode.voidStops any currently active audio playback on this speaker.voidunlinkSpeaker(@NotNull UUID playerUuid) Revokes broadcasting permission from a player.voidupdateDistance(@NotNull Float distance) Updates the audio falloff distance of the speaker.voidupdateFilter(@Nullable Predicate<de.maxhenkel.voicechat.api.ServerPlayer> filter) Updates the listener filter predicate of the speaker.voidupdatePosition(@NotNull org.bukkit.Location location) Updates the speaker position in world space and notifies SVC audio channels.
-
Method Details
-
isSpeakerAllowed
Checks whether a player is authorized to broadcast their voice through this speaker.- Parameters:
speakerUuid- the player UUID- Returns:
trueif allowed
-
linkSpeaker
Authorizes a player to broadcast their voice in RESTRICTED mode.- Parameters:
playerUuid- the player UUID
-
unlinkSpeaker
Revokes broadcasting permission from a player.- Parameters:
playerUuid- the player UUID
-
clearAllowedSpeakers
public void clearAllowedSpeakers()Clears all authorized speakers. -
getAllowedSpeakers
-
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:
trueif 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
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
-