From a051a50839efdc8289e50e442d94e01845fb5b31 Mon Sep 17 00:00:00 2001 From: NoComment1105 Date: Sun, 4 Dec 2022 17:08:08 +0000 Subject: [PATCH] Convert main class to a main object and remove false nullable --- src/main/kotlin/com/example/example_mod/ExampleMod.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/example/example_mod/ExampleMod.kt b/src/main/kotlin/com/example/example_mod/ExampleMod.kt index c973f5a..7dabc46 100644 --- a/src/main/kotlin/com/example/example_mod/ExampleMod.kt +++ b/src/main/kotlin/com/example/example_mod/ExampleMod.kt @@ -5,12 +5,10 @@ import org.quiltmc.qsl.base.api.entrypoint.ModInitializer import org.slf4j.Logger import org.slf4j.LoggerFactory -class ExampleMod : ModInitializer { - override fun onInitialize(mod: ModContainer?) { - LOGGER.info("Hello Quilt world from {}!", mod?.metadata()?.name()) - } +object ExampleMod : ModInitializer { + private val LOGGER: Logger = LoggerFactory.getLogger("Example Mod") - companion object { - val LOGGER: Logger = LoggerFactory.getLogger("Example Mod") + override fun onInitialize(mod: ModContainer) { + LOGGER.info("Hello Quilt world from {}!", mod.metadata()?.name()) } }