Use a different function to replace /say when permissions are not high enough

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2023-04-28 17:08:20 +02:00
parent 65d8aa75ee
commit 840e041817
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 4 deletions

View File

@ -15,12 +15,12 @@ data class Macro(
override var title: String = command
): ButtonImpl() {
override fun execAction(): Unit = with(Minecraft.getInstance().player!!) {
connection.sendCommand(
connection.run {
command.let {
if (it.startsWith("say") && !hasPermissions(2)) {
it.drop(4)
} else it
sendChat(it.drop(4))
} else sendCommand(it)
}
)
}
}
}