Skip to content

Commit

Permalink
Add different message to console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tems-py committed Nov 3, 2023
1 parent 7c18ebe commit 81900d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")) {
Expand Down
8 changes: 6 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ punishments:
# - "kill %player%"
- "kick %player%"

# Message shown to administrators when player is flagged as cheater
adminMessage: "<rainbow>Gracz %player% uzył totemu w mniej niż %ticks% ticków. !SUS!</rainbow>"
# Translation

# Message shown to administrators when player is flagged as cheater, you can use Minimessage format https://docs.advntr.dev/minimessage/format.html
adminMessage: "<rainbow>Player %player% replaced his totem in under %ticks% ticks ඞඞඞ</rainbow>"
# Message logged to console, you can's use minimessage there
consoleMessage: "Player %player% replaced his totem in under %ticks% ticks"

0 comments on commit 81900d9

Please sign in to comment.