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 VoiceLocation anchorLocation) Creates a static voice projection point for a player.@NotNull VoiceProjectioncreateProjection(@NotNull UUID playerUuid, @NotNull VoiceLocation anchorLocation, @Nullable UUID anchorEntityUuid) Creates a dynamic voice projection bound to a moving entity.de.maxhenkel.voicechat.api.VoicechatServerApigetAPI()Gets the underlying VoicechatServerApi instance.@Nullable VoiceProjectiongetProjection(@NotNull UUID playerUuid) Retrieves the active voice projection for a player.@Nullable VoiceProjectiongetProjectionById(@NotNull UUID projectionId) Retrieves a projection by its unique ID.@NotNull Collection<VoiceProjection> Returns all active voice projections.de.maxhenkel.voicechat.api.VolumeCategoryRetrieves the VolumeCategory used for projection channels.booleanhasProjection(@NotNull UUID playerUuid) Checks whether a player has an active voice projection.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 voidregisterProjection(@NotNull VoiceProjection projection) default voidremoveProjection(@NotNull VoiceProjection projection) voidremoveProjection(@NotNull UUID playerUuid) Removes a player's active voice projection.voidsave()Saves all active projections to disk.voidupdateLocation(@NotNull UUID playerUuid, @NotNull VoiceLocation 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
-
getVolumeCategory
de.maxhenkel.voicechat.api.VolumeCategory getVolumeCategory()Retrieves the VolumeCategory used for projection channels. -
createProjection
@NotNull @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull VoiceLocation 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 @NotNull VoiceProjection createProjection(@NotNull @NotNull UUID playerUuid, @NotNull @NotNull VoiceLocation anchorLocation, @Nullable @Nullable UUID anchorEntityUuid) Creates a dynamic voice projection bound to a moving entity.- Parameters:
playerUuid- the player UUIDanchorLocation- the initial locationanchorEntityUuid- the entity UUID to attach the projection to- Returns:
- the created
VoiceProjection
-
register
Registers an existing projection into the service.- Parameters:
projection- the projection instance
-
registerProjection
-
removeProjection
Removes a player's active voice projection.- Parameters:
playerUuid- the player UUID
-
removeProjection
-
getProjection
Retrieves the active voice projection for a player.- Parameters:
playerUuid- the player UUID- Returns:
- the
VoiceProjection, ornullif none active
-
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
-
getProjections
Returns all active voice projections.- Returns:
- collection of active
VoiceProjections
-
clearProjections
void clearProjections()Clears and removes all active voice projections. -
updateLocation
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.
-