Skip to content

Commit

Permalink
🐛 fixed placeholders in chat messages not working on velocity
Browse files Browse the repository at this point in the history
Took 25 minutes
  • Loading branch information
itsTyrion committed Oct 3, 2024
1 parent 15675f7 commit 99e7a57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
}

group = "lu.r3flexi0n"
version = "8.4.1"
version = "8.4.2"
description = "BungeeOnlineTime"

tasks.withType(JavaCompile).configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ class OnlineTimeCommand(private val plugin: VelocityOnlineTimePlugin) : SimpleCo
}
}

private fun sendMessage(sender: CommandSource, messageId: String, placeholders: Map<String, Any>? = emptyMap()) {
private fun sendMessage(sender: CommandSource, messageId: String, placeholders: Map<String, Any>? = null) {
var message = messageId
if (placeholders != null) {
for ((key, value) in placeholders) {
message = message.replace(key, value.toString())
}
}
sender.sendMessage(LegacyComponentSerializer.legacyAmpersand().deserialize(messageId))
sender.sendMessage(LegacyComponentSerializer.legacyAmpersand().deserialize(message))
}
}

0 comments on commit 99e7a57

Please sign in to comment.