Add tint override to texture packs

This commit is contained in:
Linnea Gräf
2024-11-01 23:00:53 +01:00
parent 653454e290
commit 8b410fbdf2
29 changed files with 466 additions and 156 deletions

View File

@@ -7,10 +7,24 @@ object ErrorUtil {
Thread.currentThread().stackTrace.any { it.className.startsWith("org.junit.") } || Firmament.DEBUG
}
inline fun softCheck(message: String, func: () -> Boolean) {
if (!aggressiveErrors) return
if (func()) return
error(message)
}
@Suppress("NOTHING_TO_INLINE") // Suppressed since i want the logger to not pick up the ErrorUtil stack-frame
inline fun softError(message: String) {
if (aggressiveErrors) error(message)
else Firmament.logger.error(message)
}
inline fun <T : Any> notNullOr(nullable: T?, message: String, orElse: () -> T): T {
if (nullable == null) {
softError(message)
return orElse()
}
return nullable
}
}