Convert main class to a main object and remove false nullable

This commit is contained in:
NoComment1105 2022-12-04 17:08:08 +00:00
parent ac0dd8e372
commit a051a50839
No known key found for this signature in database
GPG key ID: 4F0E376B44CBF79E

View file

@ -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())
}
}