From d3e842be1fe56d0ed2ee6d2560ed4d8f23b288cf Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Sat, 21 Feb 2026 15:43:26 +0100 Subject: [PATCH] Fix some things not being lowercase/uppercase in Snowy.kt Signed-off-by: Username404-59 --- common/src/main/kotlin/fr/username404/snowygui/Snowy.kt | 8 ++++---- .../kotlin/fr/username404/snowygui/fabric/FabricInit.kt | 2 +- .../kotlin/fr/username404/snowygui/forge/ForgeInit.kt | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt b/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt index 38bba7f..537eed3 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/Snowy.kt @@ -19,7 +19,7 @@ abstract class Snowy { val MissingComponent: Component = translatable("MISSING_COMPONENT") @Suppress("JVM_STATIC_ON_CONST_OR_JVM_FIELD") // See KT-39868 @JvmStatic - protected const val FeaturePackage: String = "fr.username404.snowygui.gui.feature" + protected const val FEATURE_PACKAGE: String = "fr.username404.snowygui.gui.feature" lateinit var annotatedButtons: () -> Set> fun onEvent(e: Any, lambda: argsLambda) = EventSnowy[e.toString()].add(lambda) @JvmField @@ -28,9 +28,9 @@ abstract class Snowy { init { Companion.annotatedButtons = ::annotatedButtons::get } private fun eventsInit() { onEvent("EndTick") { - for (Key in AddKeyMaps.list.keys) { - if (Key.isDown) { - AddKeyMaps.list[Key]?.invoke() + for (key in AddKeyMaps.list.keys) { + if (key.isDown) { + AddKeyMaps.list[key]?.invoke() } } } diff --git a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt index 2ea75e0..038eccc 100644 --- a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt +++ b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/FabricInit.kt @@ -26,7 +26,7 @@ class FabricInit: Snowy(), ClientModInitializer { ) } override val annotatedButtons = FabricLoader.getInstance().allMods.mapNotNull { - it.findPath(FeaturePackage.replace('.', '/')).getOrNull() + it.findPath(FEATURE_PACKAGE.replace('.', '/')).getOrNull() }.filter { it.exists() && it.isDirectory() }.flatMap { buttonsDirectory -> mutableSetOf>().apply { buttonsDirectory.listDirectoryEntries("*.class").forEach { file -> diff --git a/neoforge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt b/neoforge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt index 4d54139..92d6f81 100644 --- a/neoforge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt +++ b/neoforge/src/main/kotlin/fr/username404/snowygui/forge/ForgeInit.kt @@ -11,7 +11,6 @@ import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent import net.neoforged.neoforge.client.gui.IConfigScreenFactory import net.neoforged.neoforge.common.NeoForge import net.neoforged.neoforgespi.language.ModFileScanData -import org.objectweb.asm.Type @Mod("snowygui") @Suppress("UNUSED_PARAMETER") @@ -22,7 +21,7 @@ class ForgeInit(container: ModContainer): Snowy() { .flatMap { obj: ModFileScanData -> obj.classes } .filter { data: ModFileScanData.ClassData? -> data!!.clazz.className.let { - it.startsWith(FeaturePackage) && Class.forName(it).isValidForButtonCollection() + it.startsWith(FEATURE_PACKAGE) && Class.forName(it).isValidForButtonCollection() } } .map { Class.forName((it!!.clazz.className)).asSubclass(ButtonImpl::class.java)}