1
1
buildscript {
2
2
repositories {
3
- maven { url = ' https://files.minecraftforge.net/maven ' }
4
- jcenter()
3
+ // These repositories are only for Gradle plugins, put any other repositories in the repository block further below
4
+ maven { url = ' https://maven.minecraftforge.net ' }
5
5
mavenCentral()
6
6
}
7
7
dependencies {
8
- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 3 .+' , changing : true
8
+ classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1 .+' , changing : true
9
9
}
10
10
}
11
11
apply plugin : ' net.minecraftforge.gradle'
12
12
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
13
13
apply plugin : ' eclipse'
14
14
apply plugin : ' maven-publish'
15
15
16
- version = ' 1.16.4-0.5.1-beta '
16
+ version = ' 1.17.1-1.0.0-aplha-0 '
17
17
group = ' me.gleep.oreganized' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
18
18
archivesBaseName = ' oreganized'
19
19
20
- sourceCompatibility = targetCompatibility = compileJava. sourceCompatibility = compileJava. targetCompatibility = ' 1.8' // Need this here so eclipse task generates correctly.
20
+ // Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
21
+ java. toolchain. languageVersion = JavaLanguageVersion . of(16 )
21
22
22
23
println (' Java: ' + System . getProperty(' java.version' ) + ' JVM: ' + System . getProperty(' java.vm.version' ) + ' (' + System . getProperty(' java.vendor' ) + ' ) Arch: ' + System . getProperty(' os.arch' ))
23
24
minecraft {
24
- // The mappings can be changed at any time, and must be in the following format.
25
- // snapshot_YYYYMMDD Snapshot are built nightly.
26
- // stable_# Stables are built at the discretion of the MCP team.
27
- // Use non-default mappings at your own risk. they may not always work.
25
+ // The mappings can be changed at any time and must be in the following format.
26
+ // Channel: Version:
27
+ // snapshot YYYYMMDD Snapshot are built nightly.
28
+ // stable # Stables are built at the discretion of the MCP team.
29
+ // official MCVersion Official field/method names from Mojang mapping files
30
+ //
31
+ // You must be aware of the Mojang license when using the 'official' mappings.
32
+ // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
33
+ //
34
+ // Use non-default mappings at your own risk. They may not always work.
28
35
// Simply re-run your setup task after changing the mappings to update your workspace.
29
- // 20201028-1.16.3
30
- mappings channel : ' snapshot' , version : ' 20201028-1.16.3'
31
- // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
32
-
33
- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
36
+ mappings channel : ' official' , version : ' 1.17.1'
37
+
38
+ // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.
34
39
35
40
// Default run configurations.
36
41
// These can be tweaked, removed, or duplicated as needed.
@@ -39,9 +44,15 @@ minecraft {
39
44
workingDirectory project. file(' run' )
40
45
41
46
// Recommended logging data for a userdev environment
42
- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
47
+ // The markers can be added/remove as needed separated by commas.
48
+ // "SCAN": For mods scan.
49
+ // "REGISTRIES": For firing of registry events.
50
+ // "REGISTRYDUMP": For getting the contents of all registries.
51
+ property ' forge.logging.markers' , ' REGISTRIES'
43
52
44
53
// Recommended logging level for the console
54
+ // You can set various levels here.
55
+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
45
56
property ' forge.logging.console.level' , ' debug'
46
57
47
58
mods {
@@ -55,9 +66,15 @@ minecraft {
55
66
workingDirectory project. file(' run' )
56
67
57
68
// Recommended logging data for a userdev environment
58
- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
69
+ // The markers can be added/remove as needed separated by commas.
70
+ // "SCAN": For mods scan.
71
+ // "REGISTRIES": For firing of registry events.
72
+ // "REGISTRYDUMP": For getting the contents of all registries.
73
+ property ' forge.logging.markers' , ' REGISTRIES'
59
74
60
75
// Recommended logging level for the console
76
+ // You can set various levels here.
77
+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
61
78
property ' forge.logging.console.level' , ' debug'
62
79
63
80
mods {
@@ -71,9 +88,15 @@ minecraft {
71
88
workingDirectory project. file(' run' )
72
89
73
90
// Recommended logging data for a userdev environment
74
- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
91
+ // The markers can be added/remove as needed separated by commas.
92
+ // "SCAN": For mods scan.
93
+ // "REGISTRIES": For firing of registry events.
94
+ // "REGISTRYDUMP": For getting the contents of all registries.
95
+ property ' forge.logging.markers' , ' REGISTRIES'
75
96
76
97
// Recommended logging level for the console
98
+ // You can set various levels here.
99
+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
77
100
property ' forge.logging.console.level' , ' debug'
78
101
79
102
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
@@ -91,54 +114,55 @@ minecraft {
91
114
// Include resources generated by data generators.
92
115
sourceSets. main. resources { srcDir ' src/generated/resources' }
93
116
94
- dependencies {
95
- implementation ' org.jetbrains:annotations:19.0.0'
117
+ repositories {
118
+ // Put repositories for dependencies here
119
+ // ForgeGradle automatically adds the Forge maven and Maven Central for you
96
120
97
- // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
98
- // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
99
- // The userdev artifact is a special name and will get all sorts of transformations applied to it.
100
- minecraft ' net.minecraftforge:forge:1.16.4-35.1.5'
101
-
102
- // You may put jars on which you depend on in ./libs or you may define them like so..
103
- // compile "some.group:artifact:version:classifier"
104
- // compile "some.group:artifact:version"
121
+ // If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
122
+ // flatDir {
123
+ // dir 'libs'
124
+ // }
125
+ }
105
126
106
- // Real examples
107
- // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
108
- // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
127
+ dependencies {
128
+ // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
129
+ // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
130
+ // The userdev artifact is a special name and will get all sorts of transformations applied to it.
131
+ minecraft ' net.minecraftforge:forge:1.17.1-37.0.97'
109
132
110
- // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
111
- // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
133
+ // Real mod deobf dependency examples - these get remapped to your current mappings
134
+ // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
135
+ // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
136
+ // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
112
137
113
- // These dependencies get remapped to your current MCP mappings
114
- // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
138
+ // Examples using mod jars from ./libs
139
+ // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
115
140
116
141
// For more info...
117
142
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
118
143
// http://www.gradle.org/docs/current/userguide/dependency_management.html
119
-
120
144
}
121
145
122
- // Example for how to get properties into the manifest for reading by the runtime. .
146
+ // Example for how to get properties into the manifest for reading at runtime.
123
147
jar {
124
148
manifest {
125
149
attributes([
126
- " Specification-Title" : " oreganizedmod " ,
127
- " Specification-Vendor" : " oreganizedsareus" ,
128
- " Specification-Version" : " ${ version } " , // We are version 1 of ourselves
129
- " Implementation-Title" : " Oreganized Mod " ,
130
- " Implementation-Version" : " ${ version } " ,
131
- " Implementation-Vendor" : " oreganizedsareus" ,
132
- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
150
+ " Specification-Title" : " oreganized " ,
151
+ " Specification-Vendor" : " oreganizedsareus" ,
152
+ " Specification-Version" : " 1 " , // We are version 1 of ourselves
153
+ " Implementation-Title" : project . name ,
154
+ " Implementation-Version" : project . jar . archiveVersion ,
155
+ " Implementation-Vendor" : " oreganizedsareus" ,
156
+ " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
133
157
])
134
158
}
135
159
}
136
160
137
- // Example configuration to allow publishing using the maven-publish task
161
+ // Example configuration to allow publishing using the maven-publish plugin
138
162
// This is the preferred method to reobfuscate your jar file
139
- jar. finalizedBy(' reobfJar' )
163
+ jar. finalizedBy(' reobfJar' )
140
164
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
141
- // publish.dependsOn('reobfJar')
165
+ // publish.dependsOn('reobfJar')
142
166
143
167
publishing {
144
168
publications {
@@ -148,7 +172,7 @@ publishing {
148
172
}
149
173
repositories {
150
174
maven {
151
- url " file:/// ${ project.projectDir} /mcmodsrepo"
175
+ url " file://${ project.projectDir} /mcmodsrepo"
152
176
}
153
177
}
154
- }
178
+ }
0 commit comments