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:
parent
65d8aa75ee
commit
840e041817
|
@ -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)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue