From 94ef98502e9db8abc45c862070bc0b96bd6267d7 Mon Sep 17 00:00:00 2001 From: ChronosX88 Date: Sat, 15 Jan 2022 16:38:07 +0300 Subject: [PATCH] Restrict posting message from MC to TG if chat msg event was cancelled --- .../kotlin/org/kraftwerk28/spigot_tg_bridge/EventHandler.kt | 1 + src/main/resources/plugin.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/EventHandler.kt b/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/EventHandler.kt index d66bb7d..dee71a5 100644 --- a/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/EventHandler.kt +++ b/src/main/kotlin/org/kraftwerk28/spigot_tg_bridge/EventHandler.kt @@ -17,6 +17,7 @@ class EventHandler( @EventHandler fun onPlayerChat(event: AsyncPlayerChatEvent) { if (!config.logFromMCtoTG) return + if (event.isCancelled()) return; event.run { sendMessage(message, player.displayName) } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index abd297d..7b37a3e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: SpigotTGBridge -version: "0.19" +version: "0.20-alpha" api-version: "1.15" main: org.kraftwerk28.spigot_tg_bridge.Plugin description: Telegram <-> Minecraft communication plugin for Spigot.