/
build.gradle
131 lines (105 loc) 路 3.91 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
plugins {
id 'idea'
id 'net.minecraftforge.gradle' version '6.0.24'
id 'org.spongepowered.mixin' version "0.7-SNAPSHOT" // mixin
}
base {
archivesName = "${mod_name}-forge-${minecraft_version}"
}
mixin { // mixin
config 'overworldpiglins.mixins.json' // mixin
debug.verbose = true // mixin
debug.export = true // mixin
} // mixin
minecraft {
mappings channel: 'official', version: minecraft_version
//mappings channel: "parchment", version: "1.20.3-2023.12.31-${minecraft_version}"
copyIdeResources = true //Calls processResources when in dev
// Automatically enable forge AccessTransformers if the file exists
// This location is hardcoded in Forge and can not be changed.
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
/*if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
}*/
runs {
client {
workingDirectory project.file('run')
arg "-mixin.config=overworldpiglins.mixins.json" // mixin
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Client'
mods {
modClientRun {
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
arg "-mixin.config=overworldpiglins.mixins.json" // mixin
ideaModule "${rootProject.name}.${project.name}.main"
taskName 'Server'
mods {
modServerRun {
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
arg "-mixin.config=overworldpiglins.mixins.json" // mixin
ideaModule "${rootProject.name}.${project.name}.main"
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
taskName 'Data'
mods {
modDataRun {
source sourceSets.main
source project(":Common").sourceSets.main
}
}
}
}
}
sourceSets.main.resources.srcDir 'src/generated/resources'
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly project(":Common")
implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }
runtimeOnly "com.natamus.collective-ml:collective-forge:${minecraft_version}-${collective_version}"
compileOnly "com.natamus.collective-ml:collective-forge:${minecraft_version}-${collective_version}"
compileOnly "com.natamus.collective-ml:collective:${minecraft_version}-${collective_version}"
}
tasks.withType(Jar).configureEach {
duplicatesStrategy('include')
}
tasks.named('compileJava', JavaCompile).configure {
source(project(":Common").sourceSets.main.allSource)
}
sourceSets.each {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}
//tasks.withType(Javadoc).configureEach {
// source(project(":Common").sourceSets.main.allJava)
//}
//tasks.named("sourcesJar", Jar) {
// from(project(":Common").sourceSets.main.allSource)
//}
processResources {
from project(":Common").sourceSets.main.resources
}
repositories {
maven {
url = "https://github.com/Serilum/.maven/raw/maven/"
}
}
jar {
manifest {
attributes([
"MixinConfigs" : "overworldpiglins.mixins.json" // mixin
])
}
}
minecraft.reobf = false