1
- buildscript {
2
- repositories {
3
- maven { url ' https://maven.minecraftforge.net' }
4
- maven { url ' https://maven.parchmentmc.org' }
5
- // maven { url 'https://repo.spongepowered.org/repository/maven-public/' }
6
- mavenCentral()
7
- maven {
8
- name = " sonatype"
9
- url = " https://oss.sonatype.org/content/repositories/snapshots/"
10
- }
11
- maven {
12
- url " https://plugins.gradle.org/m2/"
13
- }
14
- }
15
- dependencies {
16
- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.+' , changing : true
17
- classpath ' org.parchmentmc:librarian:1.+'
18
- classpath ' io.freefair.gradle:lombok-plugin:6.3.0'
19
- // classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
20
- }
21
- }
22
1
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
23
2
plugins {
3
+ id " fabric-loom" version " 1.0-SNAPSHOT"
24
4
id ' eclipse'
25
5
id ' maven-publish'
26
6
}
27
- apply plugin : ' net.minecraftforge.gradle'
28
- apply plugin : ' org.parchmentmc.librarian.forgegradle'
29
7
apply plugin : ' eclipse'
30
8
apply plugin : ' maven-publish'
31
- apply plugin : " io.freefair.lombok"
9
+ // apply plugin: "io.freefair.lombok"
32
10
// apply plugin: 'org.spongepowered.mixin'
33
11
34
12
/* mixin {
@@ -43,118 +21,27 @@ archivesBaseName = 'materialis'
43
21
java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
44
22
45
23
println " Java: ${ System.getProperty 'java.version'} , JVM: ${ System.getProperty 'java.vm.version'} (${ System.getProperty 'java.vendor'} ), Arch: ${ System.getProperty 'os.arch'} "
46
- minecraft {
47
- // The mappings can be changed at any time, and must be in the following format.
48
- // Channel: Version:
49
- // snapshot YYYYMMDD Snapshot are built nightly.
50
- // stable # Stables are built at the discretion of the MCP team.
51
- // official MCVersion Official field/method names from Mojang mapping files
52
- //
53
- // You must be aware of the Mojang license when using the 'official' mappings.
54
- // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
55
- //
56
- // Use non-default mappings at your own risk. they may not always work.
57
- // Simply re-run your setup task after changing the mappings to update your workspace.
58
- mappings channel : ' parchment' , version : " ${ mappings_version} -${ minecraft_version} "
59
- // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
60
-
61
- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
62
-
63
- // Default run configurations.
64
- // These can be tweaked, removed, or duplicated as needed.
65
- runs {
66
- client {
67
- workingDirectory project. file(' run' )
68
-
69
- // Recommended logging data for a userdev environment
70
- // The markers can be added/remove as needed separated by commas.
71
- // "SCAN": For mods scan.
72
- // "REGISTRIES": For firing of registry events.
73
- // "REGISTRYDUMP": For getting the contents of all registries.
74
- property ' forge.logging.markers' , ' REGISTRIES'
75
-
76
- // Recommended logging level for the console
77
- // You can set various levels here.
78
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
79
- property ' forge.logging.console.level' , ' debug'
80
-
81
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
82
- property ' forge.enabledGameTestNamespaces' , ' materialis'
83
-
84
- mods {
85
- materialis {
86
- source sourceSets. main
87
- }
88
- }
89
- }
90
-
91
- server {
92
- workingDirectory project. file(' run' )
93
-
94
- property ' forge.logging.markers' , ' REGISTRIES'
95
-
96
- property ' forge.logging.console.level' , ' debug'
97
-
98
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
99
- property ' forge.enabledGameTestNamespaces' , ' materialis'
100
-
101
- mods {
102
- materialis {
103
- source sourceSets. main
104
- }
105
- }
106
- }
107
-
108
- // This run config launches GameTestServer and runs all registered gametests, then exits.
109
- // By default, the server will crash when no gametests are provided.
110
- // The gametest system is also enabled by default for other run configs under the /test command.
111
- gameTestServer {
112
- workingDirectory project. file(' run' )
113
-
114
- // Recommended logging data for a userdev environment
115
- // The markers can be added/remove as needed separated by commas.
116
- // "SCAN": For mods scan.
117
- // "REGISTRIES": For firing of registry events.
118
- // "REGISTRYDUMP": For getting the contents of all registries.
119
- property ' forge.logging.markers' , ' REGISTRIES'
120
-
121
- // Recommended logging level for the console
122
- // You can set various levels here.
123
- // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
124
- property ' forge.logging.console.level' , ' debug'
125
-
126
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
127
- property ' forge.enabledGameTestNamespaces' , ' materialis'
128
-
129
- mods {
130
- materialis {
131
- source sourceSets. main
132
- }
133
- }
134
- }
135
24
136
- data {
137
- workingDirectory project. file(' run' )
138
-
139
- property ' forge.logging.markers' , ' REGISTRIES'
25
+ // Include resources generated by data generators.
26
+ sourceSets. main. resources { srcDir ' src/generated/resources' }
140
27
141
- property ' forge.logging.console.level' , ' debug'
28
+ loom {
29
+ runs {
30
+ datagen {
31
+ client()
142
32
143
- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
144
- args ' --mod' , ' materialis' , ' --all' , ' --output' , file(' src/generated/resources/' ), ' --existing' , file(' src/main/resources/' ), ' --existing-mod' , ' tconstruct'
33
+ name " Data Generation"
34
+ vmArg " -Dfabric-api.datagen"
35
+ vmArg " -Dfabric-api.datagen.output-dir=${ file("src/generated/resources")} "
36
+ vmArg " -Dfabric-api.datagen.modid=materialis"
37
+ // from ae2
38
+ property " com.rcx.materialis.existingData" , file(" src/main/resources" ). absolutePath
145
39
146
- mods {
147
- materialis {
148
- source sourceSets. main
149
- }
150
- }
40
+ runDir " build/datagen"
151
41
}
152
42
}
153
43
}
154
44
155
- // Include resources generated by data generators.
156
- sourceSets. main. resources { srcDir ' src/generated/resources' }
157
-
158
45
repositories {
159
46
mavenLocal()
160
47
maven { // SlimeKnights and JEI
@@ -176,34 +63,62 @@ repositories {
176
63
name = " jared maven"
177
64
url = " https://maven.blamejared.com/"
178
65
}
66
+ maven { url = " https://maven.jamieswhiteshirt.com/libs-release" }
67
+ maven { url = " https://ladysnake.jfrog.io/artifactory/mods" }
68
+ maven { url = " https://maven.terraformersmc.com/releases/" }
69
+ maven { url = " https://mvn.devos.one/snapshots/" }
70
+ maven { url = " https://api.modrinth.com/maven" }
71
+ maven { url = " https://maven.shedaniel.me/" }
72
+ maven { url = " https://maven.wispforest.io" }
73
+ maven { url = " https://maven.cafeteria.dev" }
74
+ maven { url = " https://www.cursemaven.com" }
75
+ maven { url = " https://jitpack.io" }
179
76
}
180
77
181
78
dependencies {
182
- // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
183
- // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
184
- // The userdev artifact is a special name and will get all sorts of transformations applied to it.
185
- minecraft " net.minecraftforge:forge:${ minecraft_version} -${ forge_version} "
79
+ implementation ' org.projectlombok:lombok:1.18.22'
80
+ minecraft " com.mojang:minecraft:${ minecraft_version} "
81
+
82
+ mappings loom. officialMojangMappings()
83
+
84
+ // dev environment
85
+ modImplementation(" net.fabricmc:fabric-loader:${ project.loader_version} " )
86
+ include(modImplementation(fabricApi. module(" fabric-data-generation-api-v1" , project. fabric_version)))
87
+
88
+ modImplementation(" net.fabricmc.fabric-api:fabric-api:${ project.fabric_version} " )
89
+ modImplementation(include(" io.github.fabricators_of_create:Porting-Lib:${ project.port_lib_version} +${ project.minecraft_version} -stable" ))
90
+ modImplementation(include(" curse.maven:forge-config-api-port-fabric-547434:${ forge_config_version} " ))
91
+ modImplementation(" com.github.AlphaMode:fakeconfig:master-SNAPSHOT" ) { exclude(group : " net.fabricmc.fabric-api" ) }
92
+ modImplementation(" com.github.AlphaMode:fakeconfigtoml:master-SNAPSHOT" ) { exclude(group : " net.fabricmc.fabric-api" ) }
93
+ include(" io.github.tropheusj:serialization-hooks:0.3.23" )
94
+
95
+ // lombok
96
+ compileOnly(" org.projectlombok:lombok:1.18.22" )
97
+ annotationProcessor(" org.projectlombok:lombok:1.18.22" )
98
+
99
+ testCompileOnly(" org.projectlombok:lombok:1.18.22" )
100
+ testAnnotationProcessor(" org.projectlombok:lombok:1.18.22" )
186
101
187
102
// Copypasted from tinkers energistics. No shame whatsoever.
188
- implementation fg . deobf (" slimeknights.tconstruct:TConstruct :1.18.2-${ tcon_version} " )
189
- implementation fg . deobf (" slimeknights.mantle:Mantle:1.18.2-${ mantle_version} " )
103
+ modImplementation (" slimeknights.tconstruct:Hephaestus :1.18.2-${ tcon_version} " )
104
+ modImplementation (" slimeknights.mantle:Mantle:1.18.2-${ mantle_version} " )
190
105
191
106
// compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
192
- implementation fg . deobf( " mezz.jei:jei-${ minecraft_version} :${ jei_version} " )
107
+ modImplementation " mezz.jei:jei-${ minecraft_version} -fabric :${ jei_version} "
193
108
194
109
// compileOnly fg.deobf("curse.maven:eidolon-429625:3157832")
195
110
// compileOnly fg.deobf("curse.maven:curios-309927:3748873")
196
111
// compileOnly fg.deobf("vazkii.psi:Psi:${psi_version}")
197
112
// compileOnly fg.deobf("curse.maven:magipsi-396405:3388248")
198
- compileOnly fg . deobf (" vazkii.botania:Botania:${ botania_version} " )
199
- compileOnly fg . deobf (" curse.maven:quark-243121:3740897" )
200
- compileOnly fg . deobf (" curse.maven:arl-250363:3642382" )
201
- compileOnly fg . deobf (" curse.maven:thermal-222880:3790416" )
202
- compileOnly fg . deobf (" curse.maven:cofhcore-69162:3793095" )
203
- compileOnly fg . deobf( " curse.maven :create-328085:3737418 " )
204
- compileOnly fg . deobf (" curse.maven:immersiveengineering-231951:3755665" )
205
- compileOnly fg . deobf (" curse.maven:prettypipes-376737:3724800" )
206
- compileOnly fg . deobf (" curse.maven:arsnouveau-401955:3800858" )
113
+ modImplementation (" vazkii.botania:Botania:${ botania_version} " )
114
+ // modCompileOnly ("curse.maven:quark-243121:3740897")
115
+ // modCompileOnly ("curse.maven:arl-250363:3642382")
116
+ // modCompileOnly ("curse.maven:thermal-222880:3790416")
117
+ // modCompileOnly ("curse.maven:cofhcore-69162:3793095")
118
+ modImplementation( " com.simibubi.create :create-fabric- ${ minecraft_version } : ${ create_version } " )
119
+ // modCompileOnly ("curse.maven:immersiveengineering-231951:3755665")
120
+ // modCompileOnly ("curse.maven:prettypipes-376737:3724800")
121
+ // modCompileOnly ("curse.maven:arsnouveau-401955:3800858")
207
122
208
123
// annotationProcessor 'org.spongepowered:mixin:0.1.2-SNAPSHOT:processor'
209
124
@@ -242,9 +157,20 @@ jar {
242
157
}
243
158
}
244
159
160
+ processResources {
161
+ inputs. property " version" , project. version
162
+
163
+ filesMatching(" fabric.mod.json" ) {
164
+ expand " version" : project. version
165
+ }
166
+
167
+ exclude ' META-INF/mods.toml'
168
+ exclude ' pack.mcmeta'
169
+ }
170
+
245
171
// Example configuration to allow publishing using the maven-publish plugin
246
172
// This is the preferred method to reobfuscate your jar file
247
- jar. finalizedBy(' reobfJar ' )
173
+ jar. finalizedBy(' remapJar ' )
248
174
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
249
175
// publish.dependsOn('reobfJar')
250
176
0 commit comments