Skip to content

Commit

Permalink
Kotlinify
Browse files Browse the repository at this point in the history
  • Loading branch information
kikugie committed Nov 25, 2023
1 parent 90cc692 commit 7d97690
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 13 deletions.
11 changes: 10 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")}"
Expand All @@ -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")
}
}
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/dev/kikugie/template/TemplateMod.java

This file was deleted.

18 changes: 18 additions & 0 deletions src/main/kotlin/dev/kikugie/template/ModInit.kt
Original file line number Diff line number Diff line change
@@ -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("")*/
}
}
3 changes: 2 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
"environment": "*",
"entrypoints": {
"main": [
"dev.kikugie.template.TemplateMod"
"dev.kikugie.template.ModInit"
]
},
"mixins": [
"template.mixins.json"
],
"depends": {
"minecraft": "${target_minecraft}",
"fabric-language-kotlin": ">=${flk}",
"fabric-api": "*"
},
"custom": {
Expand Down
3 changes: 3 additions & 0 deletions stonecutter.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7d97690

Please sign in to comment.