diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt index 30eb7d1..2be5877 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Macro.kt @@ -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) } - ) + } } } \ No newline at end of file