diff --git a/build.gradle b/build.gradle index 814ed33..93431ad 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id "fabric-loom" version "1.4-SNAPSHOT" id "maven-publish" id "me.modmuss50.mod-publish-plugin" version "0.4.+" + id "org.jetbrains.kotlin.jvm" version "${kotlin_version}" } archivesBaseName = property("mod.name") @@ -46,6 +47,7 @@ dependencies { minecraft "com.mojang:minecraft:${stonecutter.current().version()}" mappings "net.fabricmc:yarn:${property("deps.yarn")}:v2" modImplementation "net.fabricmc:fabric-loader:${property("deps.fabric_loader")}" + modImplementation("net.fabricmc:fabric-language-kotlin:${property("deps.flk")}+kotlin.${kotlin_version}") modImplementation "net.fabricmc.fabric-api:fabric-api:${property("deps.fabric_api")}" modApi "com.terraformersmc:modmenu:${property("deps.modmenu")}" @@ -59,6 +61,7 @@ processResources { "display": project.property("mod.display"), "mod_version": version, "target_minecraft": target, + "flk": project.property("deps.flk"), "modrinth": project.property("publish.modrinth") } } @@ -126,7 +129,13 @@ assemble { } if (stonecutter.current().isActiveVersion()) { - loom.runConfigs.server.ideConfigGenerated = true + loom { + runConfigs.client { + ideConfigGenerated = true + vmArgs "-Dmixin.debug.export=true" + runDir "../../run" + } + } rootProject.tasks.register("buildActive") { setGroup "project" diff --git a/gradle.properties b/gradle.properties index 59394e7..7f7996f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,8 @@ org.gradle.jvmargs=-Xmx3G org.gradle.parallel=true +kotlin_version=1.9.21 + # Mod Information mod.repository=kikugie/template mod.version=0.0.1 @@ -14,6 +16,7 @@ mod.max_target=[VERSIONED] # Dependencies # https://fabricmc.net/develop deps.yarn=[VERSIONED] +deps.flk=1.10.15 deps.fabric_loader=0.14.24 deps.fabric_api=[VERSIONED] deps.modmenu=[VERSIONED] diff --git a/settings.gradle b/settings.gradle index 36d8e6d..3abfeff 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,7 +14,7 @@ pluginManagement { } plugins { - id 'io.shcm.shsupercm.fabric.stonecutter' version '1.5' + id 'io.shcm.shsupercm.fabric.stonecutter' version '1.5-dev.5' } stonecutter { diff --git a/src/main/java/dev/kikugie/template/TemplateMod.java b/src/main/java/dev/kikugie/template/TemplateMod.java deleted file mode 100644 index 43deadd..0000000 --- a/src/main/java/dev/kikugie/template/TemplateMod.java +++ /dev/null @@ -1,10 +0,0 @@ -package dev.kikugie.template; - -import net.fabricmc.api.ModInitializer; - -public class TemplateMod implements ModInitializer { - @Override - public void onInitialize() { - - } -} diff --git a/src/main/kotlin/dev/kikugie/template/ModInit.kt b/src/main/kotlin/dev/kikugie/template/ModInit.kt new file mode 100644 index 0000000..56ea95e --- /dev/null +++ b/src/main/kotlin/dev/kikugie/template/ModInit.kt @@ -0,0 +1,18 @@ +package dev.kikugie.template + +import net.fabricmc.api.ModInitializer +import org.slf4j.LoggerFactory + +object ModInit : ModInitializer { + val LOGGER = LoggerFactory.getLogger("template") + override fun onInitialize() { + /*?>1.20 {*/ + LOGGER.info("1.20!") + /*?} else {*//* + LOGGER.info("1.19!") + *//*?}*/ + + /*? ~1.19 */ + /*LOGGER.info("")*/ + } +} \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 346f7d9..5f609e8 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -14,7 +14,7 @@ "environment": "*", "entrypoints": { "main": [ - "dev.kikugie.template.TemplateMod" + "dev.kikugie.template.ModInit" ] }, "mixins": [ @@ -22,6 +22,7 @@ ], "depends": { "minecraft": "${target_minecraft}", + "fabric-language-kotlin": ">=${flk}", "fabric-api": "*" }, "custom": { diff --git a/stonecutter.gradle b/stonecutter.gradle index 7ef1735..fcb7edf 100644 --- a/stonecutter.gradle +++ b/stonecutter.gradle @@ -13,3 +13,6 @@ stonecutter.registerChiseled tasks.register("chiseledPublishMods", stonecutter.c ofTask "publishMods" } + +// Debug mode adds 'true' and 'false' expressions to conditional blocks +stonecutter.debug false