From 5ed74f2df49c93ed1617520a935078b59ad7e195 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sun, 1 Sep 2024 22:21:19 +0200 Subject: Add per compat project event listeners [no changelog] --- src/main/kotlin/features/texturepack/CustomBlockTextures.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin/features/texturepack/CustomBlockTextures.kt') diff --git a/src/main/kotlin/features/texturepack/CustomBlockTextures.kt b/src/main/kotlin/features/texturepack/CustomBlockTextures.kt index 0f2c2e6..a149928 100644 --- a/src/main/kotlin/features/texturepack/CustomBlockTextures.kt +++ b/src/main/kotlin/features/texturepack/CustomBlockTextures.kt @@ -168,7 +168,11 @@ object CustomBlockTextures { } private val sodiumReloadTask = runCatching { - Class.forName("moe.nea.firmament.compat.sodium.SodiumChunkReloader").getConstructor().newInstance() as Runnable + val r = Class.forName("moe.nea.firmament.compat.sodium.SodiumChunkReloader") + .getConstructor() + .newInstance() as Runnable + r.run() + r }.getOrElse { if (FabricLoader.getInstance().isModLoaded("sodium")) logger.error("Could not create sodium chunk reloader") @@ -192,7 +196,9 @@ object CustomBlockTextures { @JvmStatic fun getReplacement(block: BlockState, blockPos: BlockPos?): Replacement? { - if (isInFallback() && blockPos == null) return null + if (isInFallback() && blockPos == null) { + return null + } val replacements = currentIslandReplacements?.lookup?.get(block.block) ?: return null for (replacement in replacements) { if (replacement.checks == null || matchesPosition(replacement, blockPos)) -- cgit