Skip to content

Commit

Permalink
fix listeners registering twice
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Jun 20, 2023
1 parent 7a5f281 commit 4ddbaf1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ class ChattyPlugin : JavaPlugin() {
autoscan(classLoader, "com.mineinabyss.chatty") {
all()
}
ChattyCommands()
listeners(ChatListener(), PlayerListener())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ChatListener : Listener {

@EventHandler
fun PlayerCommandPreprocessEvent.onPlayerCommand() {
Bukkit.getOnlinePlayers().filter { it != player && it.toGeary().has<CommandSpy>() }.forEach { p ->
Bukkit.getOnlinePlayers().filter { it.uniqueId != player.uniqueId && it.toGeary().has<CommandSpy>() }.forEach { p ->
p.sendFormattedMessage(chatty.config.chat.commandSpyFormat, message, optionalPlayer = player)
}
}
Expand Down

0 comments on commit 4ddbaf1

Please sign in to comment.