1
1
plugins {
2
- id ' net.minecraftforge.gradle' version ' [6.0,6.2)'
3
- id ' org.parchmentmc.librarian.forgegradle' version ' 1.+'
4
- id ' org.spongepowered.mixin' version ' 0.7.+'
2
+ id " net.neoforged.moddev.legacyforge" version " 2.0.55-beta"
5
3
}
6
- archivesBaseName = " ${ rootProject.tesseract_archive_base_name} -forge"
7
-
8
- minecraft {
9
- // Change to your preferred mappings
10
- mappings channel : " parchment" , version : " ${ rootProject.mappings_version} -${ rootProject.minecraft_version} "
4
+ archivesBaseName = " ${ project.tesseract_archive_base_name} -forge"
11
5
6
+ neoForge {
7
+ version = " ${ project.minecraft_version} -${ project.forge_version} "
8
+ def at = project(' :tesseract-common' ). file(' src/main/resources/META-INF/accesstransformer.cfg' )
9
+ if (at. exists()) {
10
+ accessTransformers. add(at. absolutePath)
11
+ }
12
+ parchment {
13
+ minecraftVersion = rootProject. minecraft_version
14
+ mappingsVersion = rootProject. mappings_version
15
+ }
12
16
runs {
13
- // applies to all the run configs below
14
- configureEach {
15
- workingDirectory project. file(' run' )
16
- property ' forge.logging.markers' , ' REGISTRIES'
17
- property ' forge.logging.console.level' , ' debug'
18
- property ' mixin.env.remapRefMap' , ' true'
19
- property ' mixin.env.refMapRemappingFile' , " ${ projectDir} /build/createSrgToMcp/output.srg"
20
-
21
- // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
22
- property ' forge.enabledGameTestNamespaces' , mod_id
23
-
24
- mods {
25
- " ${ mod_id} " {
26
- source sourceSets. main
27
- }
28
- }
29
- }
30
-
31
17
client {
32
- property ' forge.enabledGameTestNamespaces ' , mod_id
18
+ client()
33
19
}
34
-
35
- server {
36
- workingDirectory project. file(' run/server' )
37
- property ' forge.enabledGameTestNamespaces' , mod_id
38
- args ' --nogui'
20
+ data {
21
+ data()
39
22
}
40
-
41
- // This run config launches GameTestServer and runs all registered gametests, then exits.
42
- // By default, the server will crash when no gametests are provided.
43
- // The gametest system is also enabled by default for other run configs under the /test command.
44
- gameTestServer {
45
- property ' forge.enabledGameTestNamespaces' , mod_id
23
+ server {
24
+ server()
46
25
}
47
-
48
- data {
49
- // example of overriding the workingDirectory set in configureEach above
50
- workingDirectory project. file(' run-data' )
51
-
52
- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
53
- args ' --mod' , mod_id, ' --all' , ' --output' , file(' src/generated/resources/' ), ' --existing' , file(' src/main/resources/' )
26
+ }
27
+ mods {
28
+ " ${ project.mod_id} " {
29
+ sourceSet sourceSets. main
54
30
}
55
31
}
56
32
}
57
33
58
34
mixin {
59
35
add sourceSets. main, " tesseract-forge.refmap.json"
60
36
config " tesseract-forge.mixins.json"
61
- debug. verbose = true
62
- debug. export = true
63
37
}
64
38
65
- jarJar. enable()
66
-
67
39
dependencies {
68
- minecraft " net.minecraftforge:forge:${ rootProject.minecraft_version} -${ rootProject.forge_version} "
69
40
implementation(fg. deobf(" earth.terrarium:botarium-forge-${ project.minecraft_version} :${ project.botarium_version} " )){
70
41
exclude(group : " curse.maven" )
71
42
}
43
+ compileOnly(project(" :tesseract-common" ))
72
44
testImplementation(' junit:junit:4.11' )
73
45
implementation(fg. deobf(" maven.modrinth:carbon-config:${ project.carbon_config_forge_version} " ))
74
46
jarJar(" earth.terrarium:botarium-forge-${ project.minecraft_version} :${ project.botarium_version} " ){
75
- jarJar. ranged(it, " [2.0.5,)" )
47
+ version {
48
+ strictly " [${ project.botarium_version} ,)"
49
+ prefer " ${ project.botarium_version} "
50
+ }
76
51
}
77
52
jarJar(" maven.modrinth:carbon-config:${ project.carbon_config_forge_version} " ){
78
- jarJar. ranged(it, " [1.18.2-1.2.6,)" )
53
+ version {
54
+ strictly(" [1.18.2-1.2.6,)" )
55
+ prefer(" [1.18.2-1.2.6,)" )
56
+ }
79
57
}
80
58
}
81
59
82
- tasks. withType( JavaCompile ) {
60
+ tasks. named( ' compileJava ' , JavaCompile ) {
83
61
source(project(" :tesseract-common" ). sourceSets. main. allSource)
84
62
}
85
63
@@ -96,10 +74,6 @@ sourcesJar {
96
74
from(project(' :tesseract-common' ). sourceSets. main. allSource)
97
75
}
98
76
99
- tasks. named(' jarJar' , Jar ). configure {
100
- archiveClassifier. set(" " )
101
- }
102
-
103
77
tasks. named(' jar' , Jar ). configure {
104
78
manifest {
105
79
attributes([
@@ -112,33 +86,23 @@ tasks.named('jar', Jar).configure {
112
86
' Implementation-Timestamp' : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
113
87
])
114
88
}
115
-
116
- // This is the preferred method to reobfuscate your jar file
117
- finalizedBy ' reobfJar'
118
- archiveClassifier. set " thin"
119
89
}
120
90
121
91
publishing {
122
92
publications {
123
93
mavenJava(org.gradle.api.publish.maven.MavenPublication ) {
124
94
from components. java
125
- jarJar. component(it)
126
95
}
127
96
}
128
97
129
98
repositories {
130
- def isCI = System . getenv(" GITHUB_ACTION" )
131
- def isRELEASE = System . getenv(" GITHUB_RELEASE" )
132
- if (isCI && isRELEASE) {
99
+ def isCI = System . getenv(" CI" )
100
+ if (isCI) {
133
101
maven {
134
- url = " https://repo.repsy.io/mvn/trinsdar/gregtech-intergalactical/"
135
- credentials {
136
- username = System . getenv(" MAVEN_USERNAME" )
137
- password = System . getenv(" MAVEN_PASSWORD" )
138
- }
102
+ url System . getenv(" local_maven_url" )
139
103
}
140
104
} else {
141
- maven { url " file:/// ${ project.projectDir } /mcmodsrepo " }
105
+ mavenLocal()
142
106
}
143
107
}
144
108
}
0 commit comments