Interface VoiceProjectionService
public interface VoiceProjectionService
Service managing player voice projections, body anchors, and remote acoustic routing.
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears and removes all active voice projections.@NotNull VoiceProjectioncreateProjection(@NotNull UUID playerUuid, @NotNull org.bukkit.Location anchorLocation) Creates a static voice projection point for a player.@NotNull VoiceProjectioncreateProjection(@NotNull UUID playerUuid, @NotNull org.bukkit.entity.Entity anchorEntity) Creates a dynamic voice projection bound to a moving entity.default @NotNull VoiceProjectioncreateProjection(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.Location anchorLocation) default @NotNull VoiceProjectioncreateProjection(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.entity.Entity anchorEntity) de.maxhenkel.voicechat.api.VoicechatServerApigetAPI()Gets the underlying VoicechatServerApi instance.@Nullable VoiceProjectiongetProjection(@NotNull UUID playerUuid) Retrieves the active voice projection for a player.default @Nullable VoiceProjectiongetProjection(@NotNull org.bukkit.entity.Player player) @Nullable VoiceProjectiongetProjectionById(@NotNull UUID projectionId) Retrieves a projection by its unique ID.@NotNull Collection<VoiceProjection> Returns all active voice projections.booleanhasProjection(@NotNull UUID playerUuid) Checks whether a player has an active voice projection.default booleanhasProjection(@NotNull org.bukkit.entity.Player player) voidinit(@NotNull de.maxhenkel.voicechat.api.VoicechatServerApi api) Initializes the projection service with the Simple Voice Chat server API.voidload()Reloads saved projections from disk.voidregister(@NotNull VoiceProjection projection) Registers an existing projection into the service.default voidremoveProjection(@NotNull VoiceProjection projection) voidremoveProjection(@NotNull UUID playerUuid) Removes a player's active voice projection.default voidremoveProjection(@NotNull org.bukkit.entity.Player player) voidsave()Saves all active projections to disk.voidupdateLocation(@NotNull UUID playerUuid, @NotNull org.bukkit.Location newLocation) Updates the static coordinates of a player's projection.
-
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
-
createProjection
@NotNull @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull org.bukkit.Location anchorLocation) Creates a static voice projection point for a player.- Parameters:
playerUuid- the player UUIDanchorLocation- the static location of the anchor- Returns:
- the created
VoiceProjection
-
createProjection
@NotNull default @NotNull VoiceProjection createProjection(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.Location anchorLocation) -
createProjection
@NotNull @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull org.bukkit.entity.Entity anchorEntity) Creates a dynamic voice projection bound to a moving entity.- Parameters:
playerUuid- the player UUIDanchorEntity- the entity to attach the projection to- Returns:
- the created
VoiceProjection
-
createProjection
@NotNull default @NotNull VoiceProjection createProjection(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.entity.Entity anchorEntity) -
register
Registers an existing projection into the service.- Parameters:
projection- the projection instance
-
removeProjection
Removes a player's active voice projection.- Parameters:
playerUuid- the player UUID
-
removeProjection
default void removeProjection(@NotNull @NotNull org.bukkit.entity.Player player) -
removeProjection
-
getProjection
Retrieves the active voice projection for a player.- Parameters:
playerUuid- the player UUID- Returns:
- the
VoiceProjection, ornullif none active
-
getProjection
@Nullable default @Nullable VoiceProjection getProjection(@NotNull @NotNull org.bukkit.entity.Player player) -
getProjectionById
Retrieves a projection by its unique ID.- Parameters:
projectionId- the projection UUID- Returns:
- the
VoiceProjection, ornullif not found
-
hasProjection
Checks whether a player has an active voice projection.- Parameters:
playerUuid- the player UUID- Returns:
trueif an active projection exists
-
hasProjection
default boolean hasProjection(@NotNull @NotNull org.bukkit.entity.Player player) -
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 org.bukkit.Location newLocation) Updates the static coordinates of a player's projection.- Parameters:
playerUuid- the player UUIDnewLocation- the updated location
-
save
void save()Saves all active projections to disk. -
load
void load()Reloads saved projections from disk.
-