|
1 | 1 | plugins {
|
2 |
| - id 'fabric-loom' version '1.9-SNAPSHOT' |
3 |
| - id 'maven-publish' |
| 2 | + id 'dev.architectury.loom' version '1.9-SNAPSHOT' apply false |
| 3 | + id 'architectury-plugin' version '3.4-SNAPSHOT' |
| 4 | + id 'com.github.johnrengelman.shadow' version '8.1.1' apply false |
| 5 | + id "io.github.pacifistmc.forgix" version "1.2.9" |
4 | 6 | }
|
5 | 7 |
|
6 |
| -version = project.mod_version |
7 |
| -group = project.maven_group |
8 |
| - |
9 |
| -base { |
10 |
| - archivesName = project.archives_base_name |
| 8 | +architectury { |
| 9 | + minecraft = project.minecraft_version |
11 | 10 | }
|
12 | 11 |
|
13 |
| -loom { |
14 |
| - accessWidenerPath = file("src/main/resources/asyncparticles.accesswidener") |
15 |
| -} |
| 12 | +allprojects { |
| 13 | + group = rootProject.maven_group |
| 14 | + version = rootProject.mod_version |
16 | 15 |
|
17 |
| -repositories { |
18 |
| - // Add repositories to retrieve artifacts from in here. |
19 |
| - // You should only use this when depending on other mods because |
20 |
| - // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. |
21 |
| - // See https://docs.gradle.org/current/userguide/declaring_repositories.html |
22 |
| - // for more information about repositories. |
23 |
| - maven { |
24 |
| - url = "https://api.modrinth.com/maven" |
25 |
| - name = "Modrinth" |
26 |
| - } |
27 |
| - maven { |
28 |
| - url "https://cursemaven.com" |
29 |
| - content { |
30 |
| - includeGroup "curse.maven" |
31 |
| - } |
32 |
| - } |
33 |
| - maven { url = "https://maven.bawnorton.com/releases" } // mixin squared |
34 |
| - maven { url "https://maven.shedaniel.me/" } |
35 |
| - maven { |
36 |
| - name = 'MinecraftForge' |
37 |
| - url = 'https://maven.minecraftforge.net/' |
38 |
| - } |
39 |
| - maven { url = "https://maven.parchmentmc.org" } // Parchment mappings |
40 |
| - |
41 |
| - maven { url = "https://mvn.devos.one/releases" } // Porting Lib releases |
42 |
| - maven { url = "https://mvn.devos.one/snapshots" } // Create and several dependencies |
43 |
| - maven { url = "https://maven.tterrag.com/" } // Flywheel |
44 |
| - maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes |
45 |
| - maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // Forge Config API Port |
46 |
| - |
47 |
| - maven { // Fabric ASM for Porting Lib |
48 |
| - url = "https://jitpack.io/" |
49 |
| - content { includeGroupAndSubgroups("com.github") } |
50 |
| - } |
51 |
| - maven { |
52 |
| - name 'IzzelAliz Maven' |
53 |
| - url 'https://maven.izzel.io/releases/' |
54 |
| - } |
55 |
| - maven { |
56 |
| - name = "Sinytra" |
57 |
| - url = "https://maven.su5ed.dev/releases" |
| 16 | + forgix { |
| 17 | + group = rootProject.group |
| 18 | + mergedJarName = rootProject.archives_name + '-' + rootProject.mod_version + '.jar' |
58 | 19 | }
|
59 | 20 | }
|
60 | 21 |
|
61 |
| -dependencies { |
62 |
| - include(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.2.0"))) |
63 |
| - include(implementation("com.github.bawnorton.mixinsquared:mixinsquared-forge:0.2.0")) |
64 |
| -// include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.4.1"))) |
65 |
| - include(implementation("io.github.llamalad7:mixinextras-forge:0.4.1")) |
66 |
| - |
67 |
| - // To change the versions see the gradle.properties file |
68 |
| - minecraft "com.mojang:minecraft:${project.minecraft_version}" |
69 |
| -// mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" |
70 |
| -// mappings loom.officialMojangMappings() |
71 |
| - mappings(loom.layered { |
72 |
| - it.officialMojangMappings { nameSyntheticMembers = false } |
73 |
| - it.parchment("org.parchmentmc.data:parchment-$minecraft_version:2023.09.03@zip") |
74 |
| - }) |
75 |
| - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" |
76 |
| - compileOnly "org.sinytra:Connector:1.0.0-beta.46+1.20.1" |
77 |
| - |
78 |
| - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" |
79 |
| - |
80 |
| - modLocalRuntime "net.fabricmc:fabric-language-kotlin:1.13.1+kotlin.2.1.10" |
81 |
| - modCompileOnly "net.fabricmc:fabric-language-kotlin:1.13.1+kotlin.2.1.10" |
82 |
| - |
83 |
| - modLocalRuntime "maven.modrinth:valkyrien-skies:1.20.1-fabric-2.3.0-beta.5" |
84 |
| - modCompileOnly "maven.modrinth:valkyrien-skies:1.20.1-fabric-2.3.0-beta.5" |
85 |
| -// modRuntimeOnly "maven.modrinth:vmod:0.1.2" |
86 |
| - |
87 |
| - modLocalRuntime 'maven.modrinth:eureka:1.20.1-fabric-1.5.1-beta.3' |
88 |
| -// modCompileOnly "maven.modrinth:cosmic-horizons-cosmos:0.0.7.3" |
89 |
| - |
90 |
| - modImplementation "maven.modrinth:particle-rain:3.0.6-1.20" |
91 |
| - modCompileOnly "maven.modrinth:pretty-rain:96kQ9rp3" |
92 |
| - |
93 |
| - modLocalRuntime "maven.modrinth:spark:1.10.53-fabric" |
94 |
| - modImplementation "maven.modrinth:sodium:mc1.20.1-0.5.11" |
95 |
| - modLocalRuntime "me.shedaniel.cloth:cloth-config-fabric:11.1.136" |
96 |
| - modLocalRuntime 'maven.modrinth:architectury-api:9.2.14+fabric' |
97 |
| - modLocalRuntime 'maven.modrinth:starlight:1.1.2+1.20' |
98 |
| - modCompileOnly 'maven.modrinth:starlight:1.1.2+1.20' |
99 |
| - modLocalRuntime 'maven.modrinth:modernfix:5.20.2+mc1.20.1' |
100 |
| - modCompileOnly 'maven.modrinth:iris:1.7.5+1.20.1' |
101 |
| - modLocalRuntime 'maven.modrinth:iris:1.7.5+1.20.1' |
102 |
| - |
103 |
| - modImplementation 'maven.modrinth:effectual:0.5.0-1.20.1' |
104 |
| - modLocalRuntime 'maven.modrinth:owo-lib:0.11.2+1.20' |
105 |
| - |
106 |
| - modImplementation 'maven.modrinth:mmmmmmmmmmmm:1.20-2.0.5' |
107 |
| - modLocalRuntime "maven.modrinth:moonlight:fabric_1.20-2.13.62" |
108 |
| - |
109 |
| - modCompileOnly "curse.maven:flerovium-1142875:6171369" |
110 |
| - localRuntime("org.antlr:antlr4-runtime:4.13.1") |
111 |
| - localRuntime("io.github.douira:glsl-transformer:2.0.1") |
112 |
| - localRuntime("org.anarres:jcpp:1.4.14") |
113 |
| - |
114 |
| -// modLocalRuntime("maven.modrinth:brute-force-rendering-culling:F6dedvxg") |
115 |
| - modLocalRuntime("maven.modrinth:indium:1.0.34+mc1.20.1") |
| 22 | +subprojects { |
| 23 | + apply plugin: 'dev.architectury.loom' |
| 24 | + apply plugin: 'architectury-plugin' |
| 25 | + apply plugin: 'maven-publish' |
116 | 26 |
|
117 |
| - compileOnly "net.minecraftforge:forge:1.20.1-47.3.0:universal" |
118 |
| - |
119 |
| - modCompileOnly('maven.modrinth:create:1.20.1-0.5.1.j') // create forge |
120 |
| - |
121 |
| - modCompileOnly("com.simibubi.create:create-fabric-$minecraft_version:0.5.1-j-build.1631+mc1.20.1") |
122 |
| - modLocalRuntime("com.simibubi.create:create-fabric-$minecraft_version:0.5.1-j-build.1631+mc1.20.1") |
123 |
| - |
124 |
| - modCompileOnly("curse.maven:lodestone-616457:6070172") |
125 |
| - modCompileOnly("maven.modrinth:effective:2.3.2-1.20.1") |
126 |
| - modCompileOnly("maven.modrinth:hex-casting:0.11.2") |
127 |
| - |
128 |
| -// modImplementation("maven.modrinth:effective:2.3.2-1.20.1") // put into /libs and unzip all jarinjars |
129 |
| -// modImplementation 'maven.modrinth:c2me-fabric:0.2.0+alpha.11.16+1.20.1' // put into /libs and unzip all jarinjars |
130 |
| - modLocalRuntime(fileTree(dir: 'libs', include: '*.jar', exclude: 'effective-1.0.2-all.jar')) |
131 |
| - modCompileOnly fileTree(dir: 'libs', include: ['effective-1.0.2-all.jar', 'tombstone-1.20.1-8.9.0.jar']) |
132 |
| -} |
| 27 | + base { |
| 28 | + // Set up a suffixed format for the mod jar names, e.g. `example-fabric`. |
| 29 | + archivesName = "$rootProject.archives_name-$project.name" |
| 30 | + } |
133 | 31 |
|
134 |
| -processResources { |
135 |
| - inputs.property "version", project.version |
136 |
| - inputs.property "minecraft_version", project.minecraft_version |
137 |
| - inputs.property "loader_version", project.loader_version |
138 |
| - filteringCharset "UTF-8" |
| 32 | + repositories { |
| 33 | + // Add repositories to retrieve artifacts from in here. |
| 34 | + // You should only use this when depending on other mods because |
| 35 | + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. |
| 36 | + // See https://docs.gradle.org/current/userguide/declaring_repositories.html |
| 37 | + // for more information about repositories. |
| 38 | + maven { url = "https://maven.parchmentmc.org" } // Parchment mappings |
| 39 | + maven { |
| 40 | + url = "https://api.modrinth.com/maven" |
| 41 | + name = "Modrinth" |
| 42 | + } |
| 43 | + maven { |
| 44 | + url "https://cursemaven.com" |
| 45 | + content { |
| 46 | + includeGroup "curse.maven" |
| 47 | + } |
| 48 | + } |
| 49 | + maven { // Fabric ASM for Porting Lib |
| 50 | + url = "https://jitpack.io/" |
| 51 | + content { includeGroupAndSubgroups("com.github") } |
| 52 | + } |
| 53 | + maven { url = "https://maven.bawnorton.com/releases" } // Mixin Squared |
| 54 | + maven { url "https://maven.shedaniel.me/" } |
| 55 | + maven { url = "https://maven.blamejared.com/" } // Hex Casting |
| 56 | + maven { url = "https://mvn.devos.one/releases" } // Porting Lib releases |
| 57 | + maven { url = "https://mvn.devos.one/snapshots" } // Create and several dependencies |
| 58 | + maven { url = "https://maven.tterrag.com/" } // Flywheel |
| 59 | + maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes |
| 60 | + maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // Forge Config API Port |
| 61 | + maven { |
| 62 | + name = "Sinytra" |
| 63 | + url = "https://maven.su5ed.dev/releases" |
| 64 | + } |
| 65 | + maven { // Cardinal-Components-API |
| 66 | + name = "Ladysnake Mods" |
| 67 | + url = 'https://maven.ladysnake.org/releases' |
| 68 | + } |
139 | 69 |
|
140 |
| - filesMatching("fabric.mod.json") { |
141 |
| - expand "version": project.version, |
142 |
| - "minecraft_version": project.minecraft_version, |
143 |
| - "loader_version": project.loader_version |
144 | 70 | }
|
145 |
| -} |
146 | 71 |
|
147 |
| -def targetJavaVersion = 17 |
148 |
| -tasks.withType(JavaCompile).configureEach { |
149 |
| - // ensure that the encoding is set to UTF-8, no matter what the system default is |
150 |
| - // this fixes some edge cases with special characters not displaying correctly |
151 |
| - // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html |
152 |
| - // If Javadoc is generated, this must be specified in that task too. |
153 |
| - it.options.encoding = "UTF-8" |
154 |
| - if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { |
155 |
| - it.options.release.set(targetJavaVersion) |
| 72 | + dependencies { |
| 73 | + minecraft "net.minecraft:minecraft:$rootProject.minecraft_version" |
| 74 | + mappings(loom.layered { |
| 75 | + it.officialMojangMappings { nameSyntheticMembers = false } |
| 76 | + it.parchment("org.parchmentmc.data:parchment-$minecraft_version:2023.09.03@zip") |
| 77 | + }) |
156 | 78 | }
|
157 |
| -} |
158 | 79 |
|
159 |
| -java { |
160 |
| - def javaVersion = JavaVersion.toVersion(targetJavaVersion) |
161 |
| - if (JavaVersion.current() < javaVersion) { |
162 |
| - toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) |
| 80 | + java { |
| 81 | + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
| 82 | + // if it is present. |
| 83 | + // If you remove this line, sources will not be generated. |
| 84 | + withSourcesJar() |
| 85 | + |
| 86 | + sourceCompatibility = JavaVersion.VERSION_17 |
| 87 | + targetCompatibility = JavaVersion.VERSION_17 |
163 | 88 | }
|
164 |
| - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
165 |
| - // if it is present. |
166 |
| - // If you remove this line, sources will not be generated. |
167 |
| - withSourcesJar() |
168 |
| -} |
169 | 89 |
|
170 |
| -jar { |
171 |
| - from("LICENSE") { |
172 |
| - rename { "${it}_${project.archivesBaseName}" } |
| 90 | + tasks.withType(JavaCompile).configureEach { |
| 91 | + it.options.release = 17 |
173 | 92 | }
|
174 |
| -} |
175 | 93 |
|
176 |
| -// configure the maven publication |
177 |
| -publishing { |
178 |
| - publications { |
179 |
| - create("mavenJava", MavenPublication) { |
180 |
| - artifactId = project.archives_base_name |
181 |
| - from components.java |
| 94 | + // Configure Maven publishing. |
| 95 | + publishing { |
| 96 | + publications { |
| 97 | + mavenJava(MavenPublication) { |
| 98 | + artifactId = base.archivesName.get() |
| 99 | + from components.java |
| 100 | + } |
182 | 101 | }
|
183 |
| - } |
184 | 102 |
|
185 |
| - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
186 |
| - repositories { |
187 |
| - // Add repositories to publish to here. |
188 |
| - // Notice: This block does NOT have the same function as the block in the top level. |
189 |
| - // The repositories here will be used for publishing your artifact, not for |
190 |
| - // retrieving dependencies. |
| 103 | + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. |
| 104 | + repositories { |
| 105 | + // Add repositories to publish to here. |
| 106 | + // Notice: This block does NOT have the same function as the block in the top level. |
| 107 | + // The repositories here will be used for publishing your artifact, not for |
| 108 | + // retrieving dependencies. |
| 109 | + } |
191 | 110 | }
|
| 111 | + |
| 112 | + build.finalizedBy(mergeJars) |
| 113 | + assemble.finalizedBy(mergeJars) |
192 | 114 | }
|
0 commit comments