From e497ac833cc72cd703c93ac6be122a9d7fcf7758 Mon Sep 17 00:00:00 2001 From: Danielle Voznyy Date: Wed, 4 Dec 2024 02:31:11 -0500 Subject: [PATCH] fix: Geary breaking changes --- .../src/main/kotlin/com/mineinabyss/chatty/ChattyChannel.kt | 2 +- .../com/mineinabyss/chatty/listeners/ChattyProxyListener.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/ChattyChannel.kt b/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/ChattyChannel.kt index d5fa3ff..4f0474d 100644 --- a/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/ChattyChannel.kt +++ b/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/ChattyChannel.kt @@ -66,7 +66,7 @@ data class ChattyChannel( } // Add spying players - val spies = chatty.spyingPlayers.mapWithEntity { this.player.takeIf { key in this.spying.channels } }.mapNotNull { it.data } + val spies = chatty.spyingPlayers.mapWithEntity { q -> q.player.takeIf { key in q.spying.channels } }.mapNotNull { it.data } audiences.addAll(spies) return audiences diff --git a/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChattyProxyListener.kt b/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChattyProxyListener.kt index 298f1c3..2b0c885 100644 --- a/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChattyProxyListener.kt +++ b/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChattyProxyListener.kt @@ -36,8 +36,8 @@ class ChattyProxyListener : PluginMessageListener { val channel = chatty.config.channels[channelId] val onlinePlayers = Bukkit.getOnlinePlayers().filter { it.server == Bukkit.getServer() } - val canSpy = chatty.spyingPlayers.mapWithEntity { - this.player.takeIf { spying.channels.contains(channelId) } + val canSpy = chatty.spyingPlayers.mapWithEntity { q -> + q.player.takeIf { q.spying.channels.contains(channelId) } }.mapNotNull { it.data } // If the channel is not found, it is discord