File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/main/kotlin/xyz/bluspring/unitytranslate/compat/voicechat Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 11package xyz.bluspring.unitytranslate.compat.voicechat
22
33import de.maxhenkel.voicechat.api.ForgeVoicechatPlugin
4+ import de.maxhenkel.voicechat.api.Group
45import de.maxhenkel.voicechat.api.VoicechatPlugin
56import de.maxhenkel.voicechat.api.VoicechatServerApi
67import de.maxhenkel.voicechat.api.events.EventRegistration
@@ -53,15 +54,20 @@ class SimpleVoiceChatCompat : VoicechatPlugin {
5354 return source.serverLevel().getPlayers {
5455 (! isPlayerDeafened(it) &&
5556 ((it.distanceToSqr(source) <= voiceChatServer.voiceChatDistance * voiceChatServer.voiceChatDistance && UTVoiceChatCompat .areBothSpectator(source, it)) ||
56- playerSharesGroup(it, source ))
57+ playerSharesGroup(source, it ))
5758 )
5859 || it == source
5960 }
6061 }
6162
6263 fun playerSharesGroup (player : ServerPlayer , other : ServerPlayer ): Boolean {
6364 val firstGroup = voiceChatServer.getConnectionOf(player.uuid)?.group ? : return false
65+ if (firstGroup.type == Group .Type .OPEN )
66+ return true
67+
6468 val secondGroup = voiceChatServer.getConnectionOf(other.uuid)?.group ? : return false
69+ if (secondGroup.type == Group .Type .ISOLATED && firstGroup.id != secondGroup.id)
70+ return false
6571
6672 return firstGroup.id == secondGroup.id
6773 }
You can’t perform that action at this time.
0 commit comments