From 81900d972ebb5d9c3280bb065c27eb190f975adb Mon Sep 17 00:00:00 2001 From: Tems Date: Fri, 3 Nov 2023 23:17:40 +0100 Subject: [PATCH] Add different message to console logs --- .../java/org/tems/ttotem/Listeners/InventoryClickEvent.kt | 5 +++-- src/main/resources/config.yml | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/tems/ttotem/Listeners/InventoryClickEvent.kt b/src/main/java/org/tems/ttotem/Listeners/InventoryClickEvent.kt index aed2626..6724eef 100644 --- a/src/main/java/org/tems/ttotem/Listeners/InventoryClickEvent.kt +++ b/src/main/java/org/tems/ttotem/Listeners/InventoryClickEvent.kt @@ -17,7 +17,6 @@ class InventoryClickEvent(private val plugin: Tetotem) : Listener { @EventHandler fun inventoryClickEvent(event: InventoryClickEvent) { - println(plugin.i) val item = event.cursor val player = event.whoClicked val ticks = plugin.config.getInt("maximumAllowedTicksToChangeTotem") @@ -35,7 +34,9 @@ class InventoryClickEvent(private val plugin: Tetotem) : Listener { val message = plugin.config.getString("adminMessage").toString().replace("%player%", player.name) .replace("%ticks%", ticks.toString()) val parsed: Component = mm.deserialize(message) - plugin.logger.info(message) + val consoleMessage = plugin.config.getString("consoleMessage").toString().replace("%player%", player.name) + .replace("%ticks%", ticks.toString()) + plugin.logger.info(consoleMessage) for (lp in plugin.server.onlinePlayers) { if (lp.hasPermission("ttotem.admin")) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 4d3560a..2cf5f70 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -9,5 +9,9 @@ punishments: # - "kill %player%" - "kick %player%" -# Message shown to administrators when player is flagged as cheater -adminMessage: "Gracz %player% uzył totemu w mniej niż %ticks% ticków. !SUS!" \ No newline at end of file +# Translation + +# Message shown to administrators when player is flagged as cheater, you can use Minimessage format https://docs.advntr.dev/minimessage/format.html +adminMessage: "Player %player% replaced his totem in under %ticks% ticks ඞඞඞ" +# Message logged to console, you can's use minimessage there +consoleMessage: "Player %player% replaced his totem in under %ticks% ticks" \ No newline at end of file