Contents
Class VoiceRouter
java.lang.Object
com.hypixel.hytale.server.core.modules.voice.VoiceRouter
Routes voice frames to listeners. Player voice and plugin-emitted voice (entity-tracked, fixed-position,
and non-spatial direct) share this path: proximity sources reach nearby same-world listeners via the
world-partitioned player sets, while direct sources reach an explicit listener set with no distance falloff.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidremovePlayerFromWorldSets(UUID playerId) Removes a player from world-partitioned tracking.voidrouteVoiceFromCache(PlayerRef speaker, VoiceData packet) Adapter for player voice: validates the inbound frame, resolves the speaker's cached position, and forwards it to proximity routing.voidsendVoiceConfig(PlayerRef player) Sends voice configuration to a player.voidupdateSpeakerPositionCache(PlayerRef speaker, org.joml.Vector3d position, float eyeHeight, boolean isUnderwater, UUID worldId, int networkId, boolean isDead) Updates the position cache for a speaker (called from WorldThread).
-
Constructor Details
-
VoiceRouter
-
-
Method Details
-
updateSpeakerPositionCache
public void updateSpeakerPositionCache(@Nonnull PlayerRef speaker, @Nonnull org.joml.Vector3d position, float eyeHeight, boolean isUnderwater, @Nonnull UUID worldId, int networkId, boolean isDead) Updates the position cache for a speaker (called from WorldThread). Also maintains the world-partitioned player sets for efficient cache routing. -
removePlayerFromWorldSets
Removes a player from world-partitioned tracking. Should be called when a player disconnects. -
sendVoiceConfig
Sends voice configuration to a player. -
routeVoiceFromCache
Adapter for player voice: validates the inbound frame, resolves the speaker's cached position, and forwards it to proximity routing. Runs on a voice executor thread (not WorldThread) to avoid ~50ms tick latency.When a
PlayerVoiceInterceptoris registered the frame runs through the chain first, which can rewrite metadata or audio, choose the audience, or drop it. Otherwise it routes by proximity directly.
-