You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-40Lines changed: 26 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# CleanroomModTemplate
2
2
Mod development template for Cleanroom, uses Unimined
3
3
4
-
## Usage
4
+
## DOs and DON'Ts
5
5
### Choose Branch
6
6
Choose mixin branch if you want to use Mixin.
7
7
8
-
Use scala and kotlin branch if you want to write in non-Java language.
8
+
Use scala and kotlin branch if you want to use those languages.
9
9
10
10
There are 4 branches available:
11
11
- main
@@ -15,61 +15,47 @@ There are 4 branches available:
15
15
16
16
If you want to use non-main branches, after clicked *Create a new repository* under *Use this template*, check the *Include all branches* checkbox.
17
17
18
-
### gradle.properties
19
-
Edit gradle.properties and set your modid, mod version, mod name, package, etc.
20
-
21
-
If you are writing a coremod, remember to set related settings to true.
22
-
23
-
### Reference Class
24
-
Mostly used to store mod version so you can fill it to `@Mod`.
25
18
26
-
You should change its location to fit your new package name.
27
-
28
-
You can find it under `src/main/java-templates`.
29
-
30
-
### Dependencies
31
-
You can find dependency script in `gradle/scripts/dependencies.gradle`.
19
+
### Running Client or Server
20
+
If you are using IntelliJ, **DO NOT** use the `Minecraft Client` configure with a blue icon. Just use the `2. Run Client` Gradle task.
32
21
33
-
No more `rfg.deobf()` or `fg.deobf` for mods, you should use `modImplementation`, `modCompileOnly` and `modRuntimeOnly`.
22
+
### Adding Mod Dependencies
23
+
You can find dependencies block in `gradle/scripts/dependencies.gradle`.
34
24
35
-
### Shadow
36
-
You can use `shadow` in dependency declaration to shadow libraries.
25
+
No more `rfg.deobf()` or `fg.deobf`. You **MUST** add mods by using `modImplementation` or `modRuntimeOnly`, or the game will crash when running.
37
26
38
-
### Contain
39
-
You can use `contain`in dependency declaration to add non-mod libraries to artifact jar.
27
+
### Non-Mod Dependencies
28
+
Two new configuration types `contain`and `shadow` are available, check more details in `dependencies.gradle`.
40
29
41
-
They will be extracted and loaded automatically in production.
30
+
### gradle.properties
31
+
Edit gradle.properties and set your modid, mod version, mod name, package, etc.
42
32
43
-
### Mixin
44
-
MixinBooter API is deprecated in Cleanroom.
33
+
If you are writing a coremod, remember to set related settings to true.
45
34
46
-
Current approach is to set json configs in `MixinConfigs` manifest key, which will be read by Cleanroom.
35
+
### Reference Class
36
+
There will be a `Reference` class under your top package.
47
37
48
-
You don't need to set tons of json too. If you aren't mixining into Forge, all you need is two jsons for `DEFAULT` hase and `MOD` Phase.
38
+
This is used to store mod version so you can fill it to `@Mod` annotation.
49
39
50
-
All you need is to put `IEarlyMixinLoader` mixin to `DEFAULT` json, and, mixins from `ILateMixinLoader` to `MOD` json.
40
+
You should change its location to fit your new package name.
51
41
52
-
As for calling `Loader.isModLoaded()`, just fit an `IMixinConfigPlugin` to your json and call in `shouldApply()`
42
+
You can find its template under `src/main/java-templates`.
53
43
54
-
There are some example mixins and a HEI dependency in mixin fork, remove them before writing yours.
44
+
### Mixin
45
+
1. Rename json config file to include your modid. You will need one json per phase (`PRE_INIT`, `DEFAULT`, `MOD`)
46
+
2. Add your mixin classes there.
47
+
3. Use `IMixinConfigPlugin` to control if certain mixin should be enabled. You can call `Loader.isModLoaded()` for `MOD` phase mixins.
55
48
56
49
### Access Transformer
57
-
You MUST write AT file in MCP name. It will be remapped back to SRG name in artifact jar.
58
-
59
-
Rename AT file name to your modid before using it. There's an example entry in AT file, remove it if you want to use AT.
50
+
You **MUST** write AT file in MCP name. It will be remapped back to SRG name in artifact jar.
60
51
61
-
**WARNING**: ATs from dependency won't be applied to vanilla source.
52
+
Rename AT file name to your modid before using it. There's an example entry in AT file, remove it if you want to use AT.
62
53
63
-
### Source Code with Comments
64
-
Run `genSources` task in gradle.
54
+
### Vanilla Source Code with Comments
55
+
Run `genSources` task in gradle. If it didn't work, run again until a file with `-sources.jar` suffix appeared.
65
56
66
57
If you want to `find usage` from vanilla like RFG, just change the scope in IntelliJ settings.
67
58
68
-
### Running Client or Server
69
-
You **MUST** add mods by using `modImplementation` or `modRuntimeOnly`, or mapping and ATs will break.
70
-
71
-
If you are using IntelliJ, **DO NOT** use the `Minecraft Client` configure with a blue icon. Just use the `runClient` Gradle task.
72
-
73
59
### GitHub Action
74
60
This template comes with three workflows.
75
61
@@ -81,7 +67,7 @@ This template comes with three workflows.
81
67
82
68
You need to fill in your project IDs and configure your tokens in GitHub repository first.
83
69
84
-
By default, you will need to manually trigger the workflow in web page, but you can also enable tag triggering by merging it into `release.yml`.
70
+
By default, you will need to manually trigger the workflow in web page, but you can also enable tag triggering by merging the third yml into `release.yml`.
0 commit comments