@@ -5,20 +5,21 @@ buildscript {
55 mavenCentral()
66 }
77 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
99 }
1010}
1111apply plugin : ' net.minecraftforge.gradle'
1212// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1313apply plugin : ' eclipse'
1414apply plugin : ' maven-publish'
1515
16- version = ' 1.16.4 -1.3.0'
16+ version = ' 1.18.2 -1.3.0'
1717
1818group = ' com.quizer9o8.strata' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1919archivesBaseName = ' strata'
2020
21- sourceCompatibility = targetCompatibility = compileJava. sourceCompatibility = compileJava. targetCompatibility = ' 1.8' // Need this here so eclipse task generates correctly.
21+ // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
22+ java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
2223
2324println (' Java: ' + System . getProperty(' java.version' ) + ' JVM: ' + System . getProperty(' java.vm.version' ) + ' (' + System . getProperty(' java.vendor' ) + ' ) Arch: ' + System . getProperty(' os.arch' ))
2425minecraft {
@@ -27,7 +28,7 @@ minecraft {
2728 // stable_# Stables are built at the discretion of the MCP team.
2829 // Use non-default mappings at your own risk. they may not always work.
2930 // Simply re-run your setup task after changing the mappings to update your workspace.
30- mappings channel : ' snapshot ' , version : ' 20201028-1.16.3 '
31+ mappings channel : ' official ' , version : ' 1.18.2 '
3132 // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
3233
3334 // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
@@ -39,11 +40,20 @@ minecraft {
3940 workingDirectory project. file(' run' )
4041
4142 // Recommended logging data for a userdev environment
42- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
43+ // The markers can be added/remove as needed separated by commas.
44+ // "SCAN": For mods scan.
45+ // "REGISTRIES": For firing of registry events.
46+ // "REGISTRYDUMP": For getting the contents of all registries.
47+ property ' forge.logging.markers' , ' REGISTRIES'
4348
4449 // Recommended logging level for the console
50+ // You can set various levels here.
51+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
4552 property ' forge.logging.console.level' , ' debug'
4653
54+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
55+ property ' forge.enabledGameTestNamespaces' , ' examplemod'
56+
4757 mods {
4858 examplemod {
4959 source sourceSets. main
@@ -54,12 +64,41 @@ minecraft {
5464 server {
5565 workingDirectory project. file(' run' )
5666
67+ property ' forge.logging.markers' , ' REGISTRIES'
68+
69+ property ' forge.logging.console.level' , ' debug'
70+
71+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
72+ property ' forge.enabledGameTestNamespaces' , ' examplemod'
73+
74+ mods {
75+ examplemod {
76+ source sourceSets. main
77+ }
78+ }
79+ }
80+
81+ // This run config launches GameTestServer and runs all registered gametests, then exits.
82+ // By default, the server will crash when no gametests are provided.
83+ // The gametest system is also enabled by default for other run configs under the /test command.
84+ gameTestServer {
85+ workingDirectory project. file(' run' )
86+
5787 // Recommended logging data for a userdev environment
58- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
88+ // The markers can be added/remove as needed separated by commas.
89+ // "SCAN": For mods scan.
90+ // "REGISTRIES": For firing of registry events.
91+ // "REGISTRYDUMP": For getting the contents of all registries.
92+ property ' forge.logging.markers' , ' REGISTRIES'
5993
6094 // Recommended logging level for the console
95+ // You can set various levels here.
96+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
6197 property ' forge.logging.console.level' , ' debug'
6298
99+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
100+ property ' forge.enabledGameTestNamespaces' , ' examplemod'
101+
63102 mods {
64103 examplemod {
65104 source sourceSets. main
@@ -70,13 +109,11 @@ minecraft {
70109 data {
71110 workingDirectory project. file(' run' )
72111
73- // Recommended logging data for a userdev environment
74- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
112+ property ' forge.logging.markers' , ' REGISTRIES'
75113
76- // Recommended logging level for the console
77114 property ' forge.logging.console.level' , ' debug'
78115
79- // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
116+ // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
80117 args ' --mod' , ' examplemod' , ' --all' , ' --output' , file(' src/generated/resources/' ), ' --existing' , file(' src/main/resources/' )
81118
82119 mods {
@@ -88,43 +125,39 @@ minecraft {
88125 }
89126}
90127
128+ // Include resources generated by data generators.
129+ sourceSets. main. resources { srcDir ' src/generated/resources' }
130+
91131dependencies {
92- // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
93- // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
132+ // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
133+ // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
94134 // The userdev artifact is a special name and will get all sorts of transformations applied to it.
95- minecraft ' net.minecraftforge:forge:1.16.4-35.1.37 '
135+ minecraft ' net.minecraftforge:forge:1.18.2-40.2.0 '
96136
97- // You may put jars on which you depend on in ./libs or you may define them like so..
98- // compile "some.group:artifact:version:classifier"
99- // compile "some.group:artifact:version"
137+ // Real mod deobf dependency examples - these get remapped to your current mappings
138+ // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
139+ // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
140+ // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
100141
101- // Real examples
102- // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
103- // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
104-
105- // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
106- // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
107-
108- // These dependencies get remapped to your current MCP mappings
109- // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
142+ // Examples using mod jars from ./libs
143+ // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
110144
111145 // For more info...
112146 // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
113147 // http://www.gradle.org/docs/current/userguide/dependency_management.html
114-
115148}
116149
117150// Example for how to get properties into the manifest for reading by the runtime..
118151jar {
119152 manifest {
120153 attributes([
121- " Specification-Title" : " examplemod" ,
122- " Specification-Vendor" : " examplemodsareus" ,
123- " Specification-Version" : " 1" , // We are version 1 of ourselves
124- " Implementation-Title" : project. name,
125- " Implementation-Version" : " ${ version } " ,
126- " Implementation-Vendor" : " examplemodsareus" ,
127- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
154+ " Specification-Title" : " examplemod" ,
155+ " Specification-Vendor" : " examplemodsareus" ,
156+ " Specification-Version" : " 1" , // We are version 1 of ourselves
157+ " Implementation-Title" : project. name,
158+ " Implementation-Version" : project . jar . archiveVersion ,
159+ " Implementation-Vendor" : " examplemodsareus" ,
160+ " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
128161 ])
129162 }
130163}
@@ -143,7 +176,11 @@ publishing {
143176 }
144177 repositories {
145178 maven {
146- url " file:/// ${ project.projectDir} /mcmodsrepo"
179+ url " file://${ project.projectDir} /mcmodsrepo"
147180 }
148181 }
182+ }
183+
184+ tasks. withType(JavaCompile ). configureEach {
185+ options. encoding = ' UTF-8' // Use the UTF-8 charset for Java compilation
149186}
0 commit comments