-
Notifications
You must be signed in to change notification settings - Fork 67
/
build.gradle
201 lines (167 loc) · 7.29 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
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
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://maven.parchmentmc.org' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven {
// 阿里云镜像,方便国内开发
url = uri("https://maven.aliyun.com/repository/public/")
}
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0,6.2)', changing: true
classpath 'org.parchmentmc:librarian:1.+'
classpath 'gradle.plugin.com.github.johnrengelman:shadow:7.1.2'
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
apply plugin: 'eclipse'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'java'
apply plugin: 'idea'
version = mod_version
group = 'com.github.tartaricacid'
archivesBaseName = 'touhoulittlemaid-1.20.1-release'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'parchment', version: '2023.08.20-1.20.1'
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
jvmArgs "-XX:+AllowEnhancedClassRedefinition"
workingDirectory project.file('run/client_a')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'fml.earlyprogresswindow', 'false'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
touhou_little_maid {
source sourceSets.main
}
}
}
client2 {
parent minecraft.runs.client
workingDirectory project.file('run/client_b')
args '--username', 'tartaric_acid'
mods {
touhou_little_maid {
source sourceSets.main
}
}
}
server {
jvmArgs "-XX:+AllowEnhancedClassRedefinition"
workingDirectory project.file('run/server')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'touhou_little_maid'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
touhou_little_maid {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run/data')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
args '--mod', 'touhou_little_maid', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
touhou_little_maid {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
mixin {
add sourceSets.main, "touhou_little_maid.refmap.json"
config "touhou_little_maid.mixins.json"
}
repositories {
// 优先本地 libs 文件夹
flatDir {
dir 'libs'
}
maven {
name = "Curse Maven"
url = "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
url = "https://api.modrinth.com/maven"
}
}
dependencies {
minecraft "net.minecraftforge:forge:${forge_version}"
// compile against the JEI API but do not include it at runtime
compileOnly(fg.deobf("libs:jei-1.20.1-common-api:${jei_version}"))
compileOnly(fg.deobf("libs:jei-1.20.1-forge-api:${jei_version}"))
// at runtime, use the full JEI jar for Forge
runtimeOnly(fg.deobf("libs:jei-1.20.1-forge:${jei_version}"))
// rei
compileOnly fg.deobf("curse.maven:architectury-api-419699:${architectury_api_id}")
compileOnly fg.deobf("libs:RoughlyEnoughItems-forge:${rei_version}")
// emi
// Forge (see below block as well if you use Forge Gradle)
compileOnly fg.deobf("libs:emi-forge:${emi_version}:api")
compileOnly fg.deobf("libs:emi-forge:${emi_version}")
compileOnly fg.deobf("libs:Patchouli:${patchouli_version}")
runtimeOnly fg.deobf("libs:Patchouli:${patchouli_version}")
implementation fg.deobf("curse.maven:jade-324717:${jade_id}")
implementation fg.deobf("curse.maven:the-one-probe-245211:${top_id}")
implementation fg.deobf("libs:cloth-config-forge:${cloth_config_forge}")
runtimeOnly fg.deobf("curse.maven:citadel-331936:${citadel_id}")
implementation fg.deobf("curse.maven:domestication-innovation-591149:${domestication_innovation_id}")
implementation fg.deobf("maven.modrinth:slashblade-resharped:1.1.6-1.20.1")
implementation fg.deobf("curse.maven:iron-chests-228756:${iron_chests_id}")
runtimeOnly fg.deobf("curse.maven:carry-on-274259:${carry_on_id}")
runtimeOnly "curse.maven:kotlin-for-forge-351264:${kotlin_id}"
runtimeOnly fg.deobf("curse.maven:libipn-679177:${libipn_id}")
implementation fg.deobf("curse.maven:inventory-profiles-next-495267:${ipn_id}")
runtimeOnly fg.deobf("curse.maven:catalogue-459701:${catalogue_id}")
runtimeOnly fg.deobf("curse.maven:bookshelf-228525:${bookshelf_id}")
runtimeOnly fg.deobf("curse.maven:enchantment-descriptions-250419:${enchantment_descriptions_id}")
implementation fg.deobf('curse.maven:timeless-and-classics-zero-1028108:5722050-sources-5724527')
implementation fg.deobf("maven.modrinth:simple-hats:1.20.1-0.3.2-forge")
implementation fg.deobf("maven.modrinth:curios:5.9.1+1.20.1-forge")
implementation fg.deobf("maven.modrinth:torohealth-damage-indicators-updated:1.20.1-forge-1")
implementation fg.deobf("curse.maven:aquaculture-60028:5585290")
runtimeOnly fg.deobf("curse.maven:lavafishing-1035887:5432767")
runtimeOnly fg.deobf("maven.modrinth:better-advancements:0.4.2.10-forge")
runtimeOnly fg.deobf("maven.modrinth:embeddium:0.3.31+mc1.20.1")
runtimeOnly fg.deobf('maven.modrinth:oculus:1.20.1-1.7.0')
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
jar {
manifest {
attributes([
"Implementation-Title" : project.name,
"Implementation-Version": "${version}"
])
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
// 让 idea 主动下载前置库的源码和 Javadoc
// 新版本 idea 默认不会下载这两个,这虽然加快了构建速度,但是不方便调试
idea {
module {
downloadSources = true
downloadJavadoc = true
}
}