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
|
override var title: String = command
|
||||||
): ButtonImpl() {
|
): ButtonImpl() {
|
||||||
override fun execAction(): Unit = with(Minecraft.getInstance().player!!) {
|
override fun execAction(): Unit = with(Minecraft.getInstance().player!!) {
|
||||||
connection.sendCommand(
|
connection.run {
|
||||||
command.let {
|
command.let {
|
||||||
if (it.startsWith("say") && !hasPermissions(2)) {
|
if (it.startsWith("say") && !hasPermissions(2)) {
|
||||||
it.drop(4)
|
sendChat(it.drop(4))
|
||||||
} else it
|
} else sendCommand(it)
|
||||||
}
|
}
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue