1
- buildscript {
2
- repositories {
3
- mavenCentral()
4
- maven {
5
- name = ' forge'
6
- url = getProperty(' minecraftforge.repository.url' )
7
- }
8
- }
9
- dependencies {
10
- classpath ' net.minecraftforge.gradle:ForgeGradle:3.+'
11
- }
1
+ plugins {
2
+ id ' java-library'
3
+ id ' net.minecraftforge.gradle' version ' 6.0.+'
4
+ id ' idea'
5
+ id ' maven-publish'
12
6
}
13
7
14
- apply plugin : ' net.minecraftforge.gradle'
15
- apply plugin : ' idea'
16
-
17
8
idea {
18
9
module {
19
10
inheritOutputDirs = true
20
11
excludeDirs + = file(' ./minecraft' )
21
12
}
22
13
}
23
14
24
- minecraft {
25
- // The mappings can be changed at any time, and must be in the following format.
26
- // snapshot_YYYYMMDD Snapshot are built nightly.
27
- // stable_# Stables are built at the discretion of the MCP team.
28
- mappings channel : ' snapshot' , version : ' 20171003-1.12'
29
- // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
15
+ java {
16
+ toolchain. languageVersion = JavaLanguageVersion . of(8 )
17
+ sourceCompatibility = targetCompatibility = JavaVersion . VERSION_1_8
18
+ }
30
19
31
- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
20
+ legacy {
21
+ fixClasspath = true
22
+ extractMappings = true
23
+ attachMappings = true
24
+ }
25
+
26
+ repositories {
27
+ mavenCentral()
28
+ maven {
29
+ // Su5ed LegacyDev Fork
30
+ url = " https://maven.su5ed.dev/releases"
31
+ }
32
+ }
33
+
34
+ minecraft {
35
+ mappings channel : ' stable' , version : ' 39-1.12'
36
+ // accessTransformer = file('src/main/resources/META-INF/modid_at.cfg')
32
37
33
- // Default run configurations.
34
- // These can be tweaked, removed, or duplicated as needed.
35
38
runs {
36
- client {
37
- workingDirectory project . file(' minecraft' )
39
+ configureEach {
40
+ workingDirectory file(' minecraft' )
38
41
39
- // Recommended logging data for a userdev environment
40
42
property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
41
-
42
- // Recommended logging level for the console
43
43
property ' forge.logging.console.level' , ' debug'
44
+ environment ' MC_VERSION' , ' 1.12.2'
45
+
46
+ mods {
47
+ " ${ mod_id} " {
48
+ source sourceSets. main
49
+ }
50
+ }
44
51
}
52
+
53
+ client {}
45
54
}
46
55
}
47
56
48
57
dependencies {
49
- // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
50
- // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
51
- // The userdev artifact is a special name and will get all sorts of transformations applied to it.
52
58
minecraft ' net.minecraftforge:forge:1.12.2-14.23.5.2860'
53
- }
54
59
55
- // Project settings
56
- sourceCompatibility = targetCompatibility = JavaVersion . VERSION_1_8
60
+ constraints {
61
+ implementation(' net.minecraftforge:legacydev:0.3.0.0-legacyExt' ) {
62
+ because ' needed to have all ATs work properly'
63
+ }
64
+
65
+ implementation(' org.ow2.asm:asm-debug-all:5.2' ) {
66
+ because ' newer ASM versions include module info that causes errors in Java 8'
67
+ }
68
+ }
69
+
70
+ configurations. forEach {
71
+ // MergeTool pollutes the classpath with conflicting classes
72
+ it. exclude(group : ' net.minecraftforge' , module : ' mergetool' )
73
+
74
+ // LegacyDev forge dep wants fatjar as the classifier, but 3.0 lacks it
75
+ it. resolutionStrategy. eachDependency {
76
+ if (it. requested. module. toString() == " net.minecraftforge:legacydev" ) {
77
+ it. artifactSelection {
78
+ it. selectArtifact(DependencyArtifact . DEFAULT_TYPE , null , null )
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
57
84
58
85
tasks. withType(JavaCompile ). configureEach {
59
86
options. encoding = ' UTF-8'
@@ -66,15 +93,12 @@ jar {
66
93
}
67
94
}
68
95
69
- // This is the preferred method to reobfuscate your jar file
70
- jar. finalizedBy(' reobfJar' )
71
-
72
96
tasks. register(' devJar' , Jar ) {
73
97
archiveClassifier. set(' dev' )
74
98
manifest = jar. manifest
75
99
from sourceSets. main. output
76
100
}
77
101
78
102
artifacts {
79
- archives devJar
103
+ archives tasks . named( ' devJar' )
80
104
}
0 commit comments