Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
wtlgo committed Mar 8, 2023
1 parent 146286a commit f5a5e8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ internal open class BaseChatListener(private val plugin: ChatPlugin) {

return false
} else {
event.format = mcncEvent.formattedMessage
event.format = mcncEvent.formattedMessage.replace("%", "%%")
event.recipients.clear()
event.recipients.addAll(mcncEvent.recipients)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ internal class FallbackFormatter(private val plugin: ChatPlugin) : BaseFormatter
alwaysTranslateColors: Boolean = false,
to: (() -> String?)? = null
): String {
val name = { "%1\$s" }

val name = { player.displayName }
return prepareTemplate(template, name, to ?: name, name, name, name, name) {
if (alwaysTranslateColors || player.hasPermission("mcn.chat.colors")) {
ChatColor.translateAlternateColorCodes(
Expand Down

0 comments on commit f5a5e8f

Please # to comment.