summaryrefslogtreecommitdiff
path: root/archenemyexample
diff options
context:
space:
mode:
Diffstat (limited to 'archenemyexample')
-rw-r--r--archenemyexample/build.gradle.kts47
-rw-r--r--archenemyexample/src/fabricMain/kotlin/doStuff.kt4
2 files changed, 40 insertions, 11 deletions
diff --git a/archenemyexample/build.gradle.kts b/archenemyexample/build.gradle.kts
index 6ed1dbe..946264e 100644
--- a/archenemyexample/build.gradle.kts
+++ b/archenemyexample/build.gradle.kts
@@ -7,8 +7,16 @@ plugins {
repositories {
mavenCentral()
+ maven("https://maven.fabricmc.net")
}
+val minecraft = mojang.minecraft("1.20.2", MCSide.CLIENT) as ModuleDependency
+val officialMappings = mojang.officialMappings(
+ "1.20.2", MCSide.CLIENT
+)
+val yarnMappings = mojang.yarnMappings(dependencies.create("net.fabricmc:yarn:1.20.2+build.4:v2"))
+val intermediaryMappings = mojang.yarnMappings(dependencies.create("net.fabricmc:intermediary:1.20.2:v2"))
+val whateverAttribute = Attribute.of("whatever", String::class.java)
kotlin {
val allJvm by sourceSets.creating {
this.dependencies {
@@ -16,23 +24,42 @@ kotlin {
}
jvm("forge") {
+ attributes.attribute(whateverAttribute, "forge")
compilations.named("main").get().run {
defaultSourceSet.dependsOn(allJvm)
this.dependencies {
- val mappedMinecraft = mojang.mapJar(
- mojang.minecraft("1.20.2", MCSide.CLIENT) as ModuleDependency,
- mojang.officialMappings("1.20.2", MCSide.CLIENT),
+ implementation(
+ mojang.mapJar(
+ minecraft,
+ officialMappings,
+ "official",
+ "named"
+ )
+ )
+ }
+ }
+ }
+ jvm("fabric") {
+ attributes.attribute(whateverAttribute, "fabric")
+ compilations.named("main").get().run {
+ defaultSourceSet.dependsOn(allJvm)
+ this.dependencies {
+ val thingy = mojang.mapJar(
+ minecraft,
+ intermediaryMappings,
"official",
- "named"
+ "intermediary"
+ )
+ implementation(
+ mojang.mapJar(
+ thingy as ModuleDependency,
+ yarnMappings,
+ "intermediary",
+ "named"
+ )
)
- implementation(mappedMinecraft)
}
}
}
-// jvm("fabric") {
-// compilations.named("main").get().run {
-// defaultSourceSet.dependsOn(allJvm)
-// }
-// }
}
diff --git a/archenemyexample/src/fabricMain/kotlin/doStuff.kt b/archenemyexample/src/fabricMain/kotlin/doStuff.kt
index 659bc2b..d88a17e 100644
--- a/archenemyexample/src/fabricMain/kotlin/doStuff.kt
+++ b/archenemyexample/src/fabricMain/kotlin/doStuff.kt
@@ -1,3 +1,5 @@
-actual fun doStuff(args: Int) {
+import net.minecraft.client.MinecraftClient
+actual fun doStuff(args: Int) {
+ val client = MinecraftClient.getInstance()
} \ No newline at end of file