diff --git a/build.gradle.kts b/build.gradle.kts index 59e17e822..b4e93df19 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,7 @@ val yarnMappings = property("yarn_mappings").toString() val libs = file("libs") plugins { - kotlin("jvm") version "1.9.22" + kotlin("jvm") version "1.9.23" id("org.jetbrains.dokka") version "1.9.20" id("architectury-plugin") version "3.4-SNAPSHOT" id("dev.architectury.loom") version "1.5-SNAPSHOT" apply false @@ -26,14 +26,8 @@ subprojects { apply(plugin = "org.jetbrains.dokka") dependencies { - if (path == ":quilt") { - "minecraft"("com.mojang:minecraft:1.20.2") - "mappings"("net.fabricmc:yarn:1.20.2+build.3:v2") - } - else { - "minecraft"("com.mojang:minecraft:$minecraftVersion") - "mappings"("net.fabricmc:yarn:$yarnMappings:v2") - } + "minecraft"("com.mojang:minecraft:$minecraftVersion") + "mappings"("net.fabricmc:yarn:$yarnMappings:v2") } if (path == ":common") return@subprojects @@ -46,17 +40,20 @@ subprojects { isCanBeConsumed = false isCanBeResolved = true } + val shadow = named("shadowJar") { archiveVersion = versionWithMCVersion archiveClassifier.set("shadow") configurations = listOf(shadowCommon) } + named("remapJar") { dependsOn(shadow) inputFile = shadow.flatMap { it.archiveFile } archiveVersion = versionWithMCVersion archiveClassifier = "" } + jar { enabled = false } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 1b0003e80..256c15a52 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,9 +1,10 @@ val fabricLoaderVersion = property("fabric_loader_version").toString() -val fabricKotlinVersion = property("fabric_kotlin_version").toString() val mixinExtrasVersion = property("mixinextras_version").toString() +val kotlinVersion = property("kotlin_version").toString() +val kotlinxCoroutinesVersion = property("kotlinx_coroutines_version").toString() val architecturyVersion = property("architectury_version").toString() -architectury { common("fabric", "forge", "neoforge", "quilt") } +architectury { common("fabric", "forge", "neoforge") } loom { silentMojangMappingsLicense() @@ -12,10 +13,6 @@ loom { repositories { maven("https://maven.fabricmc.net/") - maven("https://jitpack.io") - - mavenCentral() - mavenLocal() } dependencies { @@ -23,13 +20,11 @@ dependencies { // Do NOT use other classes from fabric loader modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion") - // Remove the following line if you don't want to depend on the API - modApi("dev.architectury:architectury:$architecturyVersion") - // Add dependencies on the required Kotlin modules. - modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion") implementation("org.reflections:reflections:0.10.2") - implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!) + + // Add Kotlin + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") } // Avoid nested jars diff --git a/common/src/main/kotlin/com/lambda/Lambda.kt b/common/src/main/kotlin/com/lambda/Lambda.kt index 1fd7fa2c1..a1b1cb6d6 100644 --- a/common/src/main/kotlin/com/lambda/Lambda.kt +++ b/common/src/main/kotlin/com/lambda/Lambda.kt @@ -2,16 +2,14 @@ package com.lambda import com.google.gson.Gson import com.google.gson.GsonBuilder -import com.lambda.config.serializer.* -import com.lambda.module.tag.ModuleTag -import com.lambda.util.KeyCode -import dev.architectury.platform.Platform +import com.lambda.config.serializer.BlockPosSerializer +import com.lambda.config.serializer.BlockSerializer +import com.lambda.config.serializer.ColorSerializer import net.minecraft.block.Block import net.minecraft.client.MinecraftClient import net.minecraft.util.math.BlockPos -import org.apache.logging.log4j.Level import org.apache.logging.log4j.LogManager -import org.apache.logging.log4j.core.Logger +import org.apache.logging.log4j.Logger import java.awt.Color @@ -20,14 +18,11 @@ object Lambda { const val MOD_ID = "lambda" const val SYMBOL = "λ" val VERSION: String = LoaderInfo.getVersion() - val LOG = (LogManager.getLogger(SYMBOL) as Logger) - .apply { level = if (Platform.isDevelopmentEnvironment()) Level.DEBUG else Level.INFO } - @JvmStatic val mc: MinecraftClient by lazy { MinecraftClient.getInstance() } + val LOG: Logger = LogManager.getLogger(SYMBOL) + val mc: MinecraftClient by lazy { MinecraftClient.getInstance() } val gson: Gson = GsonBuilder() .setPrettyPrinting() - .registerTypeAdapter(ModuleTag::class.java, ModuleTagSerializer) - .registerTypeAdapter(KeyCode::class.java, KeyCodeSerializer) .registerTypeAdapter(Color::class.java, ColorSerializer) .registerTypeAdapter(BlockPos::class.java, BlockPosSerializer) .registerTypeAdapter(Block::class.java, BlockSerializer) diff --git a/common/src/main/kotlin/com/lambda/Loader.kt b/common/src/main/kotlin/com/lambda/Loader.kt index 4784f7428..f454c664b 100644 --- a/common/src/main/kotlin/com/lambda/Loader.kt +++ b/common/src/main/kotlin/com/lambda/Loader.kt @@ -29,4 +29,4 @@ object Loader { LOG.info("${Lambda.MOD_NAME} ${Lambda.VERSION} was successfully initialized (${initTime}ms)") } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/com/lambda/command/CommandManager.kt b/common/src/main/kotlin/com/lambda/command/CommandManager.kt index 75730d610..32d1b1d50 100644 --- a/common/src/main/kotlin/com/lambda/command/CommandManager.kt +++ b/common/src/main/kotlin/com/lambda/command/CommandManager.kt @@ -116,7 +116,17 @@ object CommandManager : Configurable(LambdaConfig), Loadable { override fun load(): String { Reflections( ConfigurationBuilder() - .setUrls(ClasspathHelper.forPackage("com.lambda.command.commands")) + // Let's hope the maintainer of the library releases a new version soon + // because this is horrible, it takes multiple SECONDS to scan the classpath, + // and it's not even that big + // + // The culprit may be due to [ClasspathHelper.forClassLoader()] loading + // the classes from the main thread while we are in a different thread. + // If this is the case I wish the maintainer a very bad day. + .addUrls(ClasspathHelper.forJavaClassPath()) + .addUrls(ClasspathHelper.forClassLoader()) + .filterInputsBy { it.contains("lambda") } + .forPackage("com.lambda.command.commands") .setScanners(Scanners.SubTypes) ).getSubTypesOf(LambdaCommand::class.java).forEach { commandClass -> commandClass.declaredFields.find { @@ -131,4 +141,4 @@ object CommandManager : Configurable(LambdaConfig), Loadable { return "Registered ${commands.size} commands" } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/com/lambda/module/ModuleRegistry.kt b/common/src/main/kotlin/com/lambda/module/ModuleRegistry.kt index 5c8a66331..0b86e6d55 100644 --- a/common/src/main/kotlin/com/lambda/module/ModuleRegistry.kt +++ b/common/src/main/kotlin/com/lambda/module/ModuleRegistry.kt @@ -7,6 +7,8 @@ import org.reflections.scanners.Scanners import org.reflections.util.ClasspathHelper import org.reflections.util.ConfigurationBuilder + + /** * The [ModuleRegistry] object is responsible for managing all [Module] instances in the system. * @@ -21,8 +23,18 @@ object ModuleRegistry : Loadable { override fun load(): String { Reflections( ConfigurationBuilder() - .setUrls(ClasspathHelper.forPackage("com.lambda.module.modules")) - .setScanners(Scanners.SubTypes) + // Let's hope the maintainer of the library releases a new version soon + // because this is horrible, it takes multiple SECONDS to scan the classpath, + // and it's not even that big + // + // The culprit may be due to [ClasspathHelper.forClassLoader()] loading + // the classes from the main thread while we are in a different thread. + // If this is the case I wish the maintainer a very bad day. + .addUrls(ClasspathHelper.forJavaClassPath()) + .addUrls(ClasspathHelper.forClassLoader()) + .filterInputsBy { it.contains("lambda") } + .forPackage("com.lambda.module.modules") + .addScanners(Scanners.SubTypes) ).getSubTypesOf(Module::class.java).forEach { moduleClass -> moduleClass.declaredFields.find { it.name == "INSTANCE" @@ -36,4 +48,4 @@ object ModuleRegistry : Loadable { return "Registered ${modules.size} modules with ${modules.sumOf { it.settings.size }} settings" } -} \ No newline at end of file +} diff --git a/common/src/main/kotlin/com/lambda/util/FolderRegister.kt b/common/src/main/kotlin/com/lambda/util/FolderRegister.kt index 4960a3508..e57267aa4 100644 --- a/common/src/main/kotlin/com/lambda/util/FolderRegister.kt +++ b/common/src/main/kotlin/com/lambda/util/FolderRegister.kt @@ -1,9 +1,9 @@ package com.lambda.util +import com.lambda.Lambda.mc import com.lambda.util.FolderRegister.config import com.lambda.util.FolderRegister.lambda import com.lambda.util.FolderRegister.minecraft -import dev.architectury.platform.Platform import java.io.File /** @@ -14,7 +14,7 @@ import java.io.File * @property config The directory for storing configuration files, located within the Lambda directory. */ object FolderRegister { - val minecraft: File = Platform.getGameFolder().toFile() + val minecraft: File = mc.runDirectory val lambda: File = File(minecraft, "lambda") val config: File = File(lambda, "config") } diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index ea993a545..d5f3e092c 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -1,7 +1,7 @@ val fabricLoaderVersion = property("fabric_loader_version").toString() val fabricApiVersion = property("fabric_api_version").toString() -val fabricKotlinVersion = property("fabric_kotlin_version").toString() val architecturyVersion = property("architectury_version").toString() +val kotlinFabricVersion = property("kotlin_fabric_version").toString() architectury { platformSetupLoomIde() @@ -32,26 +32,21 @@ fun DependencyHandlerScope.setupConfigurations() { includeMod.dependencies.forEach { modImplementation(it) + include(it) } } dependencies { // Fabric API (Do not touch) modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion") - modApi("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion") - - // Remove the following line if you don't want to depend on the API - modApi("dev.architectury:architectury-fabric:$architecturyVersion") - - // Kotlin for Fabric - modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion") // Add dependencies on the required Kotlin modules. includeLib("org.reflections:reflections:0.10.2") - includeLib("org.javassist:javassist:3.27.0-GA") + includeLib("org.javassist:javassist:3.28.0-GA") // Add mods to the mod jar - // includeMod(...) + includeMod("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion") + includeMod("net.fabricmc:fabric-language-kotlin:$kotlinFabricVersion") // Common (Do not touch) common(project(":common", configuration = "namedElements")) { isTransitive = false } @@ -70,7 +65,7 @@ tasks { expand(getProperties()) expand(mutableMapOf( "group" to project.group, - "version" to project.version + "version" to project.version, )) } } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 21b055a12..b3e610ce0 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -26,11 +26,10 @@ "lambda.mixins.common.json" ], "depends": { - "fabricloader": ">=0.14.24", - "fabric-api": ">=0.83.0+1.20", - "architectury": ">=9.0.6", - "minecraft": ">=1.20.0", - "java": ">=17", - "fabric-language-kotlin": ">=${fabric_kotlin_version}" + "fabricloader": ">=0.15.1", + "fabric-api": ">=0.91.3+1.20.4", + "minecraft": "1.20.4", + "fabric-language-kotlin": ">=${kotlin_fabric_version}", + "java": ">=17" } } diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index 38c4b9998..6bfa37c09 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -1,7 +1,7 @@ val forgeVersion = property("forge_version").toString() -val kotlinForgeVersion = property("kotlin_forge_version").toString() val architecturyVersion = property("architectury_version").toString() val mixinExtrasVersion = property("mixinextras_version").toString() +val kotlinForgeVersion = property("kotlin_forge_version").toString() architectury { platformSetupLoomIde() @@ -18,23 +18,11 @@ loom { extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name) mixinConfig("lambda.mixins.common.json") } - - mods { - register("forge") { - sourceSet("main", project(":forge")) - - sourceSets.forEach { - val dir = layout.buildDirectory.dir("sourcesSets/${it.name}") - it.output.setResourcesDir(dir) - it.java.destinationDirectory.set(dir) - } - } - } } repositories { - maven("https://thedarkcolour.github.io/KotlinForForge/") maven("https://cursemaven.com") + maven("https://thedarkcolour.github.io/KotlinForForge/") } val common: Configuration by configurations.creating { @@ -45,18 +33,17 @@ val common: Configuration by configurations.creating { val includeLib: Configuration by configurations.creating val includeMod: Configuration by configurations.creating +val shadowInclude: Configuration by configurations.creating fun DependencyHandlerScope.setupConfigurations() { includeLib.dependencies.forEach { - implementation(it) + forgeRuntimeLibrary(it) include(it) } - // Please look at this before yelling at me - // https://docs.architectury.dev/loom/using_libraries/ includeMod.dependencies.forEach { - implementation(it) forgeRuntimeLibrary(it) + include(it) } } @@ -64,24 +51,22 @@ dependencies { // Forge API forge("net.minecraftforge:forge:$forgeVersion") - // Remove the following line if you don't want to depend on the API - modApi("dev.architectury:architectury-forge:$architecturyVersion") - // Add dependencies on the required Kotlin modules. includeLib("org.reflections:reflections:0.10.2") - includeLib("org.javassist:javassist:3.27.0-GA") - - implementation("io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion") - compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!) + includeLib("org.javassist:javassist:3.28.0-GA") // Add mods to the mod jar includeMod("thedarkcolour:kotlinforforge:$kotlinForgeVersion") - // Bugfixes - compileOnly(kotlin("stdlib")) // Hack https://github.com/thedarkcolour/KotlinForForge/issues/93 + // MixinExtras + implementation("io.github.llamalad7:mixinextras-forge:$mixinExtrasVersion") + compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!) + + // Fix KFF + compileOnly(kotlin("stdlib")) // Common (Do not touch) - common(project(":common", configuration = "namedElements")) { isTransitive = false } // We cannot common here because it is treated as a different mod and forge will panic + common(project(":common", configuration = "namedElements")) { isTransitive = false } shadowCommon(project(path = ":common", configuration = "transformProductionForge")) { isTransitive = false } // Finish the configuration @@ -90,11 +75,21 @@ dependencies { tasks { processResources { + inputs.property("group", project.group) inputs.property("version", project.version) filesMatching("META-INF/mods.toml") { expand(getProperties()) - expand(mutableMapOf("version" to project.version)) + expand(mutableMapOf( + "group" to project.group, + "version" to project.version, + )) } } + + sourceSets.forEach { + val dir = layout.buildDirectory.dir("sourcesSets/${it.name}") + it.output.setResourcesDir(dir) + it.java.destinationDirectory.set(dir) + } } diff --git a/forge/src/main/kotlin/com/lambda/forge/LambdaForge.kt b/forge/src/main/kotlin/com/lambda/forge/LambdaForge.kt index 97f6daaa9..4ba6b9ec0 100644 --- a/forge/src/main/kotlin/com/lambda/forge/LambdaForge.kt +++ b/forge/src/main/kotlin/com/lambda/forge/LambdaForge.kt @@ -1,10 +1,11 @@ package com.lambda.forge -import net.minecraftforge.fml.common.Mod import com.lambda.Lambda import com.lambda.Lambda.LOG import com.lambda.Lambda.MOD_NAME import com.lambda.Lambda.VERSION +import net.minecraftforge.fml.common.Mod + @Mod(Lambda.MOD_ID) object LambdaForge { diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index a38474502..c91f2943b 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,41 +1,34 @@ modLoader = "kotlinforforge" -loaderVersion = "[4,)" +loaderVersion = "[4.10,)" license = "GNU General Public License v3.0" +issueTrackerURL = "https://github.com/lambda-client/lambda/issues" [[mods]] -modId = "lambda" -version = "${version}" -displayName = "Lambda" -authors = "${authors}" -description = ''' -''' -logoFile = "assets/lambda/lambda.png" -displayTest = "IGNORE_ALL_VERSION" + modId = "lambda" + version = "${mod_version}" + displayName = "Lambda" + authors = "${authors}" + description = "${mod_description}" + logoFile = "assets/lambda/lambda.png" + displayTest = "IGNORE_ALL_VERSION" [[dependencies.lambda]] -modId = "forge" -mandatory = true -versionRange = "[44,)" -ordering = "NONE" -side = "CLIENT" + modId = "forge" + mandatory = true + versionRange = "[49,)" + ordering = "NONE" + side = "CLIENT" [[dependencies.lambda]] -modId = "minecraft" -mandatory = true -versionRange = "[1.19.3,1.21)" -ordering = "NONE" -side = "CLIENT" + modId = "minecraft" + mandatory = true + versionRange = "[1.20.4,)" + ordering = "NONE" + side = "CLIENT" [[dependencies.lambda]] -modId = "kotlinforforge" -mandatory = true -versionRange = "[4,)" -ordering = "AFTER" -side = "CLIENT" - -[[dependencies.lambda]] -modId = "architectury" -mandatory = true -versionRange = "[7.1.86,)" -ordering = "AFTER" -side = "CLIENT" + modId = "kotlinforforge" + mandatory = true + versionRange = "[4.10,)" + ordering = "NONE" + side = "CLIENT" diff --git a/gradle.properties b/gradle.properties index 3e6e6b666..cc7adc17a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,7 @@ authors=Constructor # General minecraft_version=1.20.4 mixinextras_version=0.3.5 +kotlin_version=1.9.23 kotlinx_coroutines_version=1.8.0 # Architectury https://docs.architectury.dev/start @@ -18,7 +19,7 @@ architectury_version=11.1.13 fabric_loader_version=0.15.7 yarn_mappings=1.20.4+build.3 fabric_api_version=0.96.4+1.20.4 -fabric_kotlin_version=1.10.18+kotlin.1.9.22 +kotlin_fabric_version=1.10.19+kotlin.1.9.23 # Forge https://files.minecraftforge.net/ forge_version=1.20.4-49.0.31 @@ -30,7 +31,6 @@ neo_version=20.4.196 # Quilt https://quiltmc.org/ quilt_version=0.24.0 quilted_fabric_version=8.0.0-alpha.4+0.91.6-1.20.2 -kotlin_quilt_version=3.0.0+kt.1.9.22+flk.1.10.17 # Kotlin https://kotlinlang.org/ kotlin.code.style=official diff --git a/neoforge/build.gradle.kts b/neoforge/build.gradle.kts index 8761957aa..a6e03804c 100644 --- a/neoforge/build.gradle.kts +++ b/neoforge/build.gradle.kts @@ -1,7 +1,6 @@ val neoVersion = property("neo_version").toString() -val kotlinForgeVersion = property("kotlin_forge_version").toString() val architecturyVersion = property("architectury_version").toString() -val mixinExtrasVersion = property("mixinextras_version").toString() +val kotlinForgeVersion = property("kotlin_forge_version").toString() architectury { platformSetupLoomIde() @@ -12,6 +11,9 @@ base.archivesName.set("${base.archivesName.get()}-neoforge") loom { accessWidenerPath.set(project(":common").loom.accessWidenerPath) + neoForge { + enableTransitiveAccessWideners = true + } } repositories { @@ -31,11 +33,14 @@ val includeMod: Configuration by configurations.creating fun DependencyHandlerScope.setupConfigurations() { includeLib.dependencies.forEach { implementation(it) + forgeRuntimeLibrary(it) include(it) } includeMod.dependencies.forEach { implementation(it) + forgeRuntimeLibrary(it) + include(it) } } @@ -43,11 +48,9 @@ dependencies { // NeoForge API neoForge("net.neoforged:neoforge:$neoVersion") - // Remove the following line if you don't want to depend on the API - modApi("dev.architectury:architectury-neoforge:$architecturyVersion") - // Add dependencies on the required Kotlin modules. - // includeLib(...) + includeLib("org.reflections:reflections:0.10.2") + includeLib("org.javassist:javassist:3.28.0-GA") // Add mods to the mod jar includeMod("thedarkcolour:kotlinforforge-neoforge:$kotlinForgeVersion") @@ -62,11 +65,26 @@ dependencies { tasks { processResources { + inputs.property("group", project.group) inputs.property("version", project.version) filesMatching("META-INF/mods.toml") { expand(getProperties()) - expand(mutableMapOf("version" to project.version)) + expand(mutableMapOf( + "group" to project.group, + "version" to project.version, + )) } } + + remapJar { + atAccessWideners.add("lambda.accesswidener") + injectAccessWidener.set(true) + } + + sourceSets.forEach { + val dir = layout.buildDirectory.dir("sourcesSets/${it.name}") + it.output.setResourcesDir(dir) + it.java.destinationDirectory.set(dir) + } } diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/mods.toml index b0abbeebb..b751bb188 100644 --- a/neoforge/src/main/resources/META-INF/mods.toml +++ b/neoforge/src/main/resources/META-INF/mods.toml @@ -1,44 +1,41 @@ modLoader = "kotlinforforge" -loaderVersion = "[4,)" +loaderVersion = "[4.10,)" license = "GNU General Public License v3.0" +issueTrackerURL = "https://github.com/lambda-client/lambda/issues" +#updateJSONURL = "https://raw.githubusercontent.com/lambda-client/lambda/main/update.json" [[mods]] -modId = "lambda" -version = "${version}" -displayName = "Lambda" -authors = "${authors}" -description = "${description}" -logoFile = "assets/lambda/lambda.png" -displayTest = "IGNORE_ALL_VERSION" + modId = "lambda" + version = "${mod_version}" + displayName = "Lambda" + authors = "${authors}" + description = "${mod_description}" + logoFile = "assets/lambda/lambda.png" + displayTest = "IGNORE_ALL_VERSION" -[[dependencies.lambda]] -modId = "neoforge" -mandatory = true -type = "required" -versionRange = "[20.2,)" -ordering = "NONE" -side = "CLIENT" +[[mixins]] + config = "lambda.mixins.common.json" [[dependencies.lambda]] -modId = "minecraft" -mandatory = true -type = "required" -versionRange = "[1.20.2,1.21)" -ordering = "NONE" -side = "CLIENT" + modId = "neoforge" + mandatory = true + type = "required" + versionRange = "[20.4.0,)" + ordering = "NONE" + side = "CLIENT" [[dependencies.lambda]] -modId = "kotlinforforge" -mandatory = true -type = "required" -versionRange = "[4,)" -ordering = "AFTER" -side = "CLIENT" + modId = "minecraft" + mandatory = true + type = "required" + versionRange = "[1.20.4,)" + ordering = "NONE" + side = "CLIENT" [[dependencies.lambda]] -modId = "architectury" -mandatory = true -type = "required" -versionRange = "[10.1.19,)" -ordering = "AFTER" -side = "CLIENT" + modId = "kotlinforforge" + mandatory = true + type = "required" + versionRange = "[4.10,)" + ordering = "NONE" + side = "CLIENT" diff --git a/quilt/build.gradle.kts b/quilt/build.gradle.kts deleted file mode 100644 index b1d3e7e5e..000000000 --- a/quilt/build.gradle.kts +++ /dev/null @@ -1,99 +0,0 @@ -val quiltVersion = property("quilt_version").toString() -val quiltedFabricVersion = property("quilted_fabric_version").toString() -val kotlinQuiltVersion = property("kotlin_quilt_version").toString() -val architecturyVersion = /*property("architectury_version").toString()*/ "10.1.19" -val kotlinxCoroutineVersion = property("kotlinx_coroutines_version").toString() - -architectury { - platformSetupLoomIde() - loader("quilt") -} - -base.archivesName.set("${base.archivesName.get()}-quilt") - -loom { - accessWidenerPath.set(project(":common").loom.accessWidenerPath) - enableTransitiveAccessWideners.set(true) - - mods { - register("quilt") { - sourceSet("main", project(":quilt")) - } - } -} - -repositories { - maven("https://maven.quiltmc.org/repository/release/") -} - -val common: Configuration by configurations.creating { - configurations.compileClasspath.get().extendsFrom(this) - configurations.runtimeClasspath.get().extendsFrom(this) - configurations["developmentQuilt"].extendsFrom(this) -} - -val includeLib: Configuration by configurations.creating -val includeMod: Configuration by configurations.creating - -fun DependencyHandlerScope.setupConfigurations() { - includeLib.dependencies.forEach { - implementation(it) - include(it) - } - - includeMod.dependencies.forEach { - modImplementation(it) - include(it) - } -} - -dependencies { - // Quilt Loader - modImplementation("org.quiltmc:quilt-loader:$quiltVersion") - - // Quilted Fabric API - modApi("org.quiltmc.quilted-fabric-api:quilted-fabric-api:$quiltedFabricVersion") - - // Remove the following line if you don't want to depend on the API - modApi("dev.architectury:architectury-fabric:$architecturyVersion") { - exclude("net.fabricmc") - exclude("net.fabricmc.fabric-api") - } - - // Kotlin for Quilt - modImplementation("org.quiltmc.quilt-kotlin-libraries:quilt-kotlin-libraries:$kotlinQuiltVersion") - - // Add dependencies on the required Kotlin modules. - includeLib("org.reflections:reflections:0.10.2") - includeLib("org.javassist:javassist:3.27.0-GA") - - // Add mods to the mod jar - // includeMod(...) - - - // Common (Do not touch) - common(project(":common", configuration = "namedElements")) { isTransitive = false } - shadowCommon(project(":common", configuration = "transformProductionQuilt")) { isTransitive = false } - - // Finish the configuration - setupConfigurations() -} - -tasks { - processResources { - inputs.property("group", project.group) - inputs.property("version", project.version) - - filesMatching("quilt.mod.json") { - expand(getProperties()) - expand(mutableMapOf( - "group" to project.group, - "version" to project.version - )) - } - } - - remapJar { - injectAccessWidener.set(true) - } -} diff --git a/quilt/gradle.properties b/quilt/gradle.properties deleted file mode 100644 index 4fb20b837..000000000 --- a/quilt/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -loom.platform=quilt diff --git a/quilt/src/main/kotlin/com/lambda/fabric/LoaderInfoImpl.kt b/quilt/src/main/kotlin/com/lambda/fabric/LoaderInfoImpl.kt deleted file mode 100644 index 74b99c0be..000000000 --- a/quilt/src/main/kotlin/com/lambda/fabric/LoaderInfoImpl.kt +++ /dev/null @@ -1,13 +0,0 @@ -@file:Suppress("deprecation") - -package com.lambda.fabric - -import net.fabricmc.loader.api.FabricLoader - -object LoaderInfoImpl { - @JvmStatic - fun getVersion(): String = - FabricLoader.getInstance() - .getModContainer("lambda").orElseThrow() - .metadata.version.friendlyString -} diff --git a/quilt/src/main/kotlin/com/lambda/quilt/LambdaQuilt.kt b/quilt/src/main/kotlin/com/lambda/quilt/LambdaQuilt.kt deleted file mode 100644 index 7c4beaf68..000000000 --- a/quilt/src/main/kotlin/com/lambda/quilt/LambdaQuilt.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.lambda.quilt - -import com.lambda.Lambda -import com.lambda.Lambda.LOG -import com.lambda.Lambda.MOD_NAME -import com.lambda.Lambda.VERSION -import org.quiltmc.loader.api.ModContainer -import org.quiltmc.qsl.base.api.entrypoint.ModInitializer - -// Cannot use `object` because Quilt has a class fetish (object is a class in Kotlin with a private constructor) -class LambdaQuilt : ModInitializer { - // If the mod is marked as non nullable, Quilt will panic because it can't find the instrisic library - override fun onInitialize(mod: ModContainer?) { - Lambda.initialize() - LOG.info("$MOD_NAME Quilt $VERSION initialized.") - } -} diff --git a/quilt/src/main/kotlin/com/lambda/quilt/LoaderInfoImpl.kt b/quilt/src/main/kotlin/com/lambda/quilt/LoaderInfoImpl.kt deleted file mode 100644 index 82e10a526..000000000 --- a/quilt/src/main/kotlin/com/lambda/quilt/LoaderInfoImpl.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.lambda.quilt - -import org.quiltmc.loader.api.QuiltLoader - - -object LoaderInfoImpl { - @JvmStatic - fun getVersion(): String = - QuiltLoader - .getModContainer("lambda").orElseThrow() - .metadata().version().raw() -} diff --git a/quilt/src/main/resources/quilt.mod.json b/quilt/src/main/resources/quilt.mod.json deleted file mode 100644 index c274eb0ec..000000000 --- a/quilt/src/main/resources/quilt.mod.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "schema_version": 1, - "mixin": [ - "lambda.mixins.common.json" - ], - "quilt_loader": { - "group": "${group}", - "id": "${mod_id}", - "version": "${mod_version}", - "metadata": { - "name": "Lambda", - "description": "${mod_description}", - "contributors": { - "Constructor": "Owner" - }, - "contact": { - "sources": "https://github.com/lambda-client/lambda" - }, - "icon": "assets/lambda/lambda.png" - }, - "intermediate_mappings": "net.fabricmc:intermediary", - "entrypoints": { - "init": [ - "com.lambda.quilt.LambdaQuilt" - ] - }, - "depends": [ - { - "id": "quilt_loader", - "version": "*" - }, - { - "id": "quilt_base", - "version": "*" - }, - { - "id": "qkl", - "version": ">=3.0.0" - }, - { - "id": "minecraft", - "version": ">=1.20.1" - }, - { - "id": "architectury", - "version": ">=9.1.12" - } - ] - }, - "minecraft": { - "environment": "*" - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts index b3e612ff9..dd52d83ef 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,4 +13,4 @@ include("common") include("fabric") include("forge") include("neoforge") -include("quilt") +//include("quilt")