Fix failed compilation from possible syntax errors (#2)

* fix cause of IllegalAccessException

* logger not supposed to be private?

* Revert "logger not supposed to be private?"

This reverts commit 4674c49b1b.

* Revert "fix cause of IllegalAccessException"

This reverts commit 1edbf0204d.

* Fix QMJ to use kotlin language adapter
This commit is contained in:
Lilly Rosaline 2022-12-12 12:51:08 -06:00 committed by GitHub
parent a4f7f39196
commit 52195ceb2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -11,6 +11,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class TitleScreenMixin { public class TitleScreenMixin {
@Inject(method = "init", at = @At("TAIL")) @Inject(method = "init", at = @At("TAIL"))
public void exampleMod$onInit(CallbackInfo ci) { public void exampleMod$onInit(CallbackInfo ci) {
ExampleMod.Companion.getLOGGER().info("This line is printed by an example mod mixin!"); ExampleMod.INSTANCE.getLOGGER().info("This line is printed by an example mod mixin!");
} }
} }

View file

@ -6,7 +6,7 @@ import org.slf4j.Logger
import org.slf4j.LoggerFactory import org.slf4j.LoggerFactory
object ExampleMod : ModInitializer { object ExampleMod : ModInitializer {
private val LOGGER: Logger = LoggerFactory.getLogger("Example Mod") val LOGGER: Logger = LoggerFactory.getLogger("Example Mod")
override fun onInitialize(mod: ModContainer) { override fun onInitialize(mod: ModContainer) {
LOGGER.info("Hello Quilt world from {}!", mod.metadata()?.name()) LOGGER.info("Hello Quilt world from {}!", mod.metadata()?.name())

View file

@ -19,7 +19,10 @@
}, },
"intermediate_mappings": "net.fabricmc:intermediary", "intermediate_mappings": "net.fabricmc:intermediary",
"entrypoints": { "entrypoints": {
"init": "com.example.example_mod.ExampleMod" "init": {
"adapter": "kotlin",
"value": "com.example.example_mod.ExampleMod"
}
}, },
"depends": [ "depends": [
{ {