forked from MercurialPony/Locks
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
103 lines (88 loc) · 2.78 KB
/
build.gradle
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
plugins {
id "dev.architectury.loom" version "1.7-SNAPSHOT"
id "maven-publish"
}
base.archivesName = "${mod_name}-forge"
version = "${mod_version}"
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
def generatedResources = file("src/generated")
sourceSets {
main {
resources.srcDir generatedResources
}
}
loom {
silentMojangMappingsLicense()
forge {
mixinConfigs("${mod_id}.mixins.json")
accessTransformer(file("src/main/resources/META-INF/accesstransformer.cfg"))
}
runs {
data {
data()
programArgs "--all", "--mod", "${mod_id}"
programArgs "--output", generatedResources.absolutePath
}
}
}
repositories {
maven {
url = "https://www.cursemaven.com"
content {
includeGroup("curse.maven")
}
}
maven {
url = "https://maven.parchmentmc.org"
content {
includeGroup("org.parchmentmc.data")
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_mappings}@zip")
}
forge "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"
modCompileOnly("curse.maven:lootr-361276:5636598")
modCompileOnly("curse.maven:dungeon-crawl-324973:4612224")
// modCompileOnly("curse.maven:beans-backpacks-946775:5368249")
modRuntimeOnly("curse.maven:lootr-361276:5636598")
// modRuntimeOnly("curse.maven:quark-243121:5594847")
// modRuntimeOnly("curse.maven:zeta-968868:5597406")
}
tasks.named('processResources', ProcessResources).configure {
var replaceProperties = [
minecraft_version: minecraft_version, minecraft_version_range: minecraft_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_author: mod_author, mod_description: mod_description, mod_icon: mod_icon, credits: credits
]
inputs.properties replaceProperties
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
expand replaceProperties + [project: project]
}}
tasks.named('jar', Jar).configure {
manifest {
attributes([
"Specification-Title": mod_name,
"Specification-Vendor": mod_author,
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": project.jar.archiveVersion,
"Implementation-Vendor": mod_author,
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
options.release = 17
}