Skip to content

Commit a442ac0

Browse files
Merge branch 'main' into mixin
2 parents 4ce3d8b + 9355588 commit a442ac0

3 files changed

Lines changed: 11 additions & 17 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ You can find dependencies block in `gradle/scripts/dependencies.gradle`.
2626

2727
No more `rfg.deobf()` or `fg.deobf`. You **MUST** add mods by using `modImplementation` or `modRuntimeOnly`, or the game will crash when running.
2828

29+
Use `modLibrary` for libs/mods that you don't want to remap.
30+
2931
### Non-Mod Dependencies
3032
Two new configuration types `contain` and `shadow` are available, check more details in `dependencies.gradle`.
3133

@@ -44,10 +46,11 @@ You should change its location to fit your new package name.
4446
You can find its template under `src/main/java-templates`.
4547

4648
### Mixin
47-
1. Rename json config file to include your modid. You will need one json per phase (`PRE_INIT`, `DEFAULT`, `MOD`)
48-
2. Add your mixin classes there.
49-
3. Use `IMixinConfigPlugin` to control if certain mixin should be enabled. You can call `Loader.isModLoaded()` for `MOD` phase mixins.
50-
4. Don't worry about refmap, Unimined will handle it automatically. You can still `disableRefmap()` manually though
49+
1. Rename json config file to use your modid.
50+
2. Add **all** your mixin classes there.
51+
3. Use `IMixinConfigPlugin` to control if certain mixin should be enabled.
52+
4. mixin classes will be passed to the plugin only when target class is loading, so you don't need to call `Loader.isModLoaded()`
53+
5. Don't worry about refmap, Unimined will handle it automatically. You can still `disableRefmap()` manually though
5154

5255
### Access Transformer
5356
You **MUST** write AT file in MCP name. It will be remapped back to SRG name in artifact jar.

build.gradle

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'maven-publish'
55
id 'com.gradleup.shadow' version '9.5.1'
66
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.4.1'
7-
id 'xyz.wagyourtail.unimined' version '1.4.35-kappa'
7+
id 'xyz.wagyourtail.unimined' version '1.4.36-kappa'
88
id 'net.kyori.blossom' version '2.2.0'
99
}
1010

@@ -213,16 +213,6 @@ shadowJar {
213213
archiveClassifier = "shadow"
214214
}
215215

216-
217-
tasks.named(remapTaskName).configure {
218-
doFirst {
219-
logging.captureStandardOutput LogLevel.INFO
220-
}
221-
doLast {
222-
logging.captureStandardOutput LogLevel.QUIET
223-
}
224-
}
225-
226216
compileTestJava {
227217
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_25
228218
}

gradle/scripts/dependencies.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ dependencies {
2121
if (enable_lwjglx.toBoolean()) {
2222
compileOnly "com.cleanroommc:lwjglx:1.0.0"
2323
}
24-
25-
modImplementation 'mezz:jei:4.33.0:dev' // Use for mod Mixin example
24+
25+
modLibrary 'mezz:jei:4.33.0:dev' // Use for mod Mixin example
2626

2727
// Example - Dependency descriptor:
2828
// 'com.google.code.gson:gson:2.8.6' << group: com.google.code.gson, name:gson, version:2.8.6
@@ -45,6 +45,7 @@ dependencies {
4545
// shadow = bundle dependencies into shadow output artifact (relocation configurable in shadowJar task)
4646
// modImplementation = mod dependency available at both compile time and runtime
4747
// modCompileOnly = mod dependency available only at compile time
48+
// modLibrary = won't be remap but will be forced injected into classpath later
4849

4950
// Transitive dependencies:
5051
// (Dependencies that your dependency depends on)

0 commit comments

Comments
 (0)