-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.gradle
More file actions
205 lines (175 loc) · 6.29 KB
/
Copy pathbuild.gradle
File metadata and controls
205 lines (175 loc) · 6.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
plugins {
id 'idea'
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev.legacyforge' version '2.0.91'
}
version = "${mc_version}-${mod_version}"
group = mod_group_id
base {
archivesName = mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
legacyForge {
version = project.mc_version + '-' + project.forge_version
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
runs {
client {
client()
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
server {
server()
programArgument '--nogui'
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
//gameTestServer {
// type = "gameTestServer"
// systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
//}
data {
data()
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
// gameDirectory = project.file('run-data')
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
configureEach {
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
}
mods {
"${mod_id}" {
sourceSet(sourceSets.main)
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
configurations {
runtimeClasspath.extendsFrom localRuntime
}
obfuscation {
createRemappingConfiguration(configurations.localRuntime)
}
repositories {
maven { url "https://maven.blamejared.com" }
maven { // location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.k-4u.nl"
}
maven { url 'https://files.minecraftforge.net/maven/' }
maven { url "https://maven.theillusivec4.top/" }
maven { url "https://maven.tterrag.com/" }
maven { url 'https://jitpack.io' }
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
}
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
// content {
// includeGroup "maven.modrinth"
// }
}
mavenCentral()
mavenLocal()
}
dependencies {
modImplementation "com.hollingsworth.ars_nouveau:ars_nouveau-${mc_version}:${ars_version}"
modImplementation "software.bernie.geckolib:geckolib-forge-${mc_version}:${gecko_version}"
modImplementation "curse.maven:blood-magic-224791:7253333" // bloodmagic-1.20.1-3.3.5-47.jar
// Registrate
jarJar(modImplementation "com.tterrag.registrate:Registrate:${registrate_version}")
// jarJar(group: 'com.tterrag.registrate', name: 'Registrate', version: "${registrate_version_range}")
modCompileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
modCompileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
// at runtime, use the full JEI
modLocalRuntime "mezz.jei:jei-${mc_version}-common:${jei_version}"
modLocalRuntime "mezz.jei:jei-${mc_version}-forge:${jei_version}"
modImplementation "top.theillusivec4.curios:curios-forge:${curio_version}"
modImplementation "vazkii.patchouli:Patchouli:${mc_version}-${patchouli_version}"
modCompileOnly "com.github.glitchfiend:TerraBlender-forge:${mc_version}-${terrablender}"
compileOnly 'org.jetbrains:annotations:26.0.1'
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.5.3"))
jarJar(implementation("io.github.llamalad7:mixinextras-forge")) {
version {
strictly "[0.5.3,)"
prefer "0.5.3"
}
}
}
// Uncomment the lines below if you wish to configure mixin. The mixin file should be named modid.mixins.json.
/*
mixin {
add sourceSets.main, "${mod_id}.refmap.json"
config "${mod_id}.mixins.json"
}
dependencies {
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
jar {
manifest.attributes([
"MixinConfigs": "${mod_id}.mixins.json"
])
}
*/
// This block of code expands all declared replace properties in the specified resource targets.
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
var replaceProperties = [
minecraft_version : mc_version,
minecraft_version_range: mc_version_range,
forge_version : forge_version,
forge_version_range : forge_version_range,
loader_version_range : loader_version_range,
mod_id : mod_id,
mod_name : mod_name,
mod_license : mod_license,
mod_version : mod_version,
mod_authors : mod_authors,
mod_description : mod_description
]
inputs.properties replaceProperties
expand replaceProperties
from "src/main/templates"
into "build/generated/sources/modMetadata"
}
// Include the output of "generateModMetadata" as an input directory for the build
// this works with both building through Gradle and the IDE.
sourceSets.main.resources.srcDir generateModMetadata
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
legacyForge.ideSyncTask generateModMetadata
publishing {
publications {
register('mavenJava', MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}