Skip to content

Commit 5096c49

Browse files
committed
Feature: Quilt
1 parent 6e9bc06 commit 5096c49

File tree

6 files changed

+166
-1
lines changed

6 files changed

+166
-1
lines changed

quilt/build.gradle.kts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
val quiltVersion = property("quilt_version").toString()
2+
val quiltedFabricVersion = property("quilted_fabric_version").toString()
3+
val kotlinQuiltVersion = property("kotlin_quilt_version").toString()
4+
val kotlinxCoroutineVersion = property("kotlinx_coroutines_version").toString()
5+
6+
base.archivesName.set("${base.archivesName.get()}-quilt")
7+
8+
architectury {
9+
platformSetupLoomIde()
10+
loader("quilt")
11+
}
12+
13+
loom {
14+
accessWidenerPath = project(":common").loom.accessWidenerPath
15+
}
16+
17+
repositories {
18+
maven("https://maven.quiltmc.org/repository/release/")
19+
}
20+
21+
val common: Configuration by configurations.creating {
22+
configurations.compileClasspath.get().extendsFrom(this)
23+
configurations.runtimeClasspath.get().extendsFrom(this)
24+
configurations["developmentQuilt"].extendsFrom(this)
25+
}
26+
27+
val includeLib: Configuration by configurations.creating
28+
val includeMod: Configuration by configurations.creating
29+
val shadowBundle: Configuration by configurations.creating {
30+
isCanBeResolved = true
31+
isCanBeConsumed = false
32+
}
33+
34+
fun DependencyHandlerScope.setupConfigurations() {
35+
includeLib.dependencies.forEach {
36+
implementation(it)
37+
include(it)
38+
}
39+
40+
includeMod.dependencies.forEach {
41+
modImplementation(it)
42+
include(it)
43+
}
44+
45+
shadowBundle.dependencies.forEach {
46+
shadowCommon(it)
47+
shadow(it)
48+
}
49+
}
50+
51+
dependencies {
52+
// Quilt Loader
53+
modImplementation("org.quiltmc:quilt-loader:$quiltVersion")
54+
55+
// Quilted Fabric API
56+
modImplementation("org.quiltmc.quilted-fabric-api:quilted-fabric-api:$quiltedFabricVersion")
57+
58+
// Add dependencies on the required Kotlin modules.
59+
includeLib("org.reflections:reflections:0.10.2")
60+
includeLib("org.javassist:javassist:3.28.0-GA")
61+
62+
// Add mods to the mod jar
63+
includeMod("org.quiltmc.quilt-kotlin-libraries:quilt-kotlin-libraries:$kotlinQuiltVersion") {
64+
// Exclude fabric
65+
exclude("net.fabricmc")
66+
exclude("net.fabricmc.fabric-api")
67+
}
68+
69+
70+
// Common (Do not touch)
71+
common(project(path = ":common", configuration = "namedElements")) { isTransitive = false }
72+
shadowBundle(project(path = ":common", configuration = "transformProductionQuilt"))
73+
74+
// Finish the configuration
75+
setupConfigurations()
76+
}
77+
78+
tasks {
79+
remapJar {
80+
injectAccessWidener = true
81+
}
82+
83+
processResources {
84+
filesMatching("quilt.mod.json") {
85+
expand(project(":common").properties)
86+
}
87+
}
88+
}

quilt/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
loom.platform=quilt
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.lambda.quilt
2+
3+
import com.lambda.Lambda
4+
import com.lambda.Lambda.LOG
5+
import com.lambda.Lambda.MOD_NAME
6+
import com.lambda.Lambda.VERSION
7+
import org.quiltmc.loader.api.ModContainer
8+
import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer
9+
10+
class LambdaQuilt : ClientModInitializer {
11+
override fun onInitializeClient(mod: ModContainer) {
12+
Lambda.initialize()
13+
LOG.info("$MOD_NAME Quilt $VERSION initialized.")
14+
}
15+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.lambda.quilt
2+
3+
import org.quiltmc.loader.api.QuiltLoader
4+
5+
6+
object LoaderInfoImpl {
7+
@JvmStatic
8+
fun getVersion(): String =
9+
QuiltLoader
10+
.getModContainer("lambda").orElseThrow()
11+
.metadata().version().raw()
12+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"schema_version": 1,
3+
"mixin": [
4+
"lambda.mixins.common.json"
5+
],
6+
"quilt_loader": {
7+
"group": "${group}",
8+
"id": "${mod_id}",
9+
"version": "${mod_version}",
10+
"metadata": {
11+
"name": "Lambda",
12+
"description": "${mod_description}",
13+
"contributors": {
14+
"Constructor": "Owner"
15+
},
16+
"contact": {
17+
"sources": "https://github.com/lambda-client/lambda"
18+
},
19+
"icon": "assets/lambda/lambda.png"
20+
},
21+
"intermediate_mappings": "net.fabricmc:intermediary",
22+
"entrypoints": {
23+
"client_init": [
24+
"com.lambda.quilt.LambdaQuilt"
25+
]
26+
},
27+
"depends": [
28+
{
29+
"id": "quilt_loader",
30+
"version": "*"
31+
},
32+
{
33+
"id": "quilt_base",
34+
"version": "*"
35+
},
36+
{
37+
"id": "qkl",
38+
"version": ">=4.0.0"
39+
},
40+
{
41+
"id": "minecraft",
42+
"version": ">=1.20.4"
43+
}
44+
]
45+
},
46+
"minecraft": {
47+
"environment": "*"
48+
}
49+
}

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ include("common")
1313
include("fabric")
1414
include("forge")
1515
include("neoforge")
16-
//include("quilt")
16+
include("quilt")

0 commit comments

Comments
 (0)