Skip to content

Commit

Permalink
Work on adding Mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Apr 17, 2023
1 parent 9faa7b9 commit 6c44dd4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"io.github.gaming32.worldhost.WorldHost"
]
},
"mixins": [
"world-host.mixins.json"
],
"depends": {
"fabricloader": "*",
"minecraft": "${mc_version == '1.19.4' ? '>=1.19.4' : mc_version}"
Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/world-host.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"required": true,
"minVersion": "0.7",
"package": "io.github.gaming32.worldhost.mixin",
"compatibilityLevel": "JAVA_8",
"mixins": [
],
"client": [
],
"injectors": {
"defaultRequire": 1
}
}
26 changes: 26 additions & 0 deletions version.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ repositories {
name = "ParchmentMC"
url = uri("https://maven.parchmentmc.org")
}

maven("https://repo.polyfrost.cc/releases")
}

val bundle: Configuration by configurations.creating {
Expand Down Expand Up @@ -56,6 +58,11 @@ dependencies {
if (mcData.version < 1_10_00) {
includeImplementation("it.unimi.dsi:fastutil-core:8.5.5")
}

if (mcData.isLegacyForge) {
compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT")
shade("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+")
}
}

val generatedResources = "$buildDir/generated-resources/main"
Expand All @@ -71,6 +78,25 @@ java {
withSourcesJar()
}

loom {
if (mcData.isLegacyForge) {
launchConfigs.named("client") {
arg("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker")

property("mixin.debug.export", "true")
}
}

if (mcData.isForge) {
forge {
mixinConfig("world-host.mixins.json")
}
}

@Suppress("UnstableApiUsage")
mixin.defaultRefmapName.set("world-host.mixins.refmap.json")
}

tasks.register("generateLangFiles") {
doLast {
if (mcData.version >= 1_13_00) return@doLast
Expand Down

0 comments on commit 6c44dd4

Please sign in to comment.