feat: Add macro editing UI

This commit is contained in:
Linnea Gräf
2025-06-04 18:45:39 +02:00
parent 9c32c6e824
commit 3695589a47
14 changed files with 379 additions and 47 deletions

View File

@@ -75,4 +75,7 @@ object ErrorUtil {
return nullable
}
fun softUserError(string: String) {
MC.sendChat(tr("frimanet.usererror", "Firmament encountered a user caused error: $string"))
}
}

View File

@@ -1,6 +1,7 @@
package moe.nea.firmament.util
import io.github.moulberry.repo.data.Coordinate
import io.github.notenoughupdates.moulconfig.gui.GuiComponentWrapper
import java.util.concurrent.ConcurrentLinkedQueue
import kotlin.jvm.optionals.getOrNull
import net.minecraft.client.MinecraftClient
@@ -126,6 +127,8 @@ object MC {
}
private set
val currentMoulConfigContext
get() = (screen as? GuiComponentWrapper)?.context
fun openUrl(uri: String) {
Util.getOperatingSystem().open(uri)

View File

@@ -2,6 +2,7 @@ package moe.nea.firmament.util
object TestUtil {
inline fun <T> unlessTesting(block: () -> T): T? = if (isInTest) null else block()
@JvmField
val isInTest =
Thread.currentThread().stackTrace.any {
it.className.startsWith("org.junit.") || it.className.startsWith("io.kotest.")