@@ -2,17 +2,23 @@ import cam72cam.universalmodcore.Util;
22
33buildscript {
44 repositories {
5- maven { url = " https://maven.minecraftforge.net/" }
5+ // maven { url = "https://maven.minecraftforge.net/" }
6+ maven {
7+ name " neoforgedReleases"
8+ url " https://maven.neoforged.net/releases"
9+ }
610 maven { url = " https://teamopenindustry.cc/maven" }
711 mavenCentral()
12+ gradlePluginPortal()
813 }
914 dependencies {
10- classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 5.1.+' , changing : true
15+ // classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
16+ classpath group : ' net.neoforged.gradle' , name : ' userdev' , version : ' 7.1.11'
1117 classpath ' cam72cam.universalmodcore:UniversalModCoreGradle:0.1.3'
1218 }
1319}
14- apply plugin : ' net.minecraftforge .gradle'
15- // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
20+ apply plugin : ' net.neoforged .gradle.userdev '
21+ // Only edit below this line, the above code adds and enables the necessary things for NeoForge to be setup.
1622apply plugin : ' eclipse'
1723// apply plugin: 'maven'
1824apply plugin : ' maven-publish'
@@ -23,83 +29,62 @@ String baseVersion = "1.2"
2329if (! " release" . equalsIgnoreCase(System . getProperty(" target" ))) {
2430 baseVersion + = " -" + Util.GitRevision ()
2531}
26- version = " 1.20.1 -forge-" + baseVersion
32+ version = " 1.20.4 -forge-" + baseVersion
2733group = " trackapi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
2834archivesBaseName = " TrackAPI"
2935
30- minecraft {
31- // The mappings can be changed at any time, and must be in the following format.
32- // snapshot_YYYYMMDD Snapshot are built nightly.
33- // stable_# Stables are built at the discretion of the MCP team.
34- // Use non-default mappings at your own risk. they may not always work.
35- // Simply re-run your setup task after changing the mappings to update your workspace.
36- mappings channel : ' official' , version : ' 1.20.1'
37- // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
38-
39- // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
40-
41- // Default run configurations.
42- // These can be tweaked, removed, or duplicated as needed.
43- runs {
44- client {
45- workingDirectory project. file(' run' )
46-
47- // Recommended logging data for a userdev environment
48- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
49-
50- // Recommended logging level for the console
51- property ' forge.logging.console.level' , ' debug'
52-
53- mods {
54- examplemod {
55- source sourceSets. main
56- }
57- }
58- }
59-
60- server {
61- workingDirectory project. file(' run' )
62-
63- // Recommended logging data for a userdev environment
64- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
65-
66- // Recommended logging level for the console
67- property ' forge.logging.console.level' , ' debug'
68-
69- mods {
70- examplemod {
71- source sourceSets. main
72- }
73- }
74- }
36+ runs {
37+ // applies to all the run configs below
38+ configureEach {
39+ // Recommended logging data for a userdev environment
40+ // The markers can be added/remove as needed separated by commas.
41+ // "SCAN": For mods scan.
42+ // "REGISTRIES": For firing of registry events.
43+ // "REGISTRYDUMP": For getting the contents of all registries.
44+ systemProperty ' forge.logging.markers' , ' REGISTRIES'
45+
46+ // Recommended logging level for the console
47+ // You can set various levels here.
48+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
49+ systemProperty ' forge.logging.console.level' , ' debug'
50+
51+ modSource project. sourceSets. main
52+ }
7553
76- data {
77- workingDirectory project. file(' run' )
54+ client {
55+ // Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
56+ systemProperty ' neoforge.enabledGameTestNamespaces' , ' trackapi'
57+ }
7858
79- // Recommended logging data for a userdev environment
80- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
59+ server {
60+ systemProperty ' neoforge.enabledGameTestNamespaces' , ' trackapi'
61+ argument ' --nogui'
62+ }
8163
82- // Recommended logging level for the console
83- property ' forge.logging.console.level' , ' debug'
64+ // This run config launches GameTestServer and runs all registered gametests, then exits.
65+ // By default, the server will crash when no gametests are provided.
66+ // The gametest system is also enabled by default for other run configs under the /test command.
67+ gameTestServer {
68+ systemProperty ' neoforge.enabledGameTestNamespaces' , ' trackapi'
69+ }
8470
85- args ' --mod' , ' examplemod' , ' --all' , ' --output' , file(' src/generated/resources/' )
71+ data {
72+ // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
73+ // workingDirectory project.file('run-data')
8674
87- mods {
88- examplemod {
89- source sourceSets. main
90- }
91- }
92- }
75+ // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
76+ arguments. addAll ' --mod' , ' trackapi' , ' --all' , ' --output' , file(' src/generated/resources/' ). getAbsolutePath(), ' --existing' , file(' src/main/resources/' ). getAbsolutePath()
9377 }
9478}
9579
80+
9681sourceSets. main. resources { srcDir ' src/generated/resources' }
9782
9883dependencies {
9984 // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
10085 // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
10186 // The userdev artifact is a special name and will get all sorts of transformations applied to it.
102- minecraft ' net.minecraftforge:forge:1. 20.1-47.1.0 '
87+ implementation ' net.neoforged:neoforge: 20.4.251 '
10388
10489 // You may put jars on which you depend on in ./libs or you may define them like so..
10590 // compile "some.group:artifact:version:classifier"
@@ -125,19 +110,17 @@ dependencies {
125110jar {
126111 manifest {
127112 attributes([
128- " Specification-Title" : " trackapi" ,
129- " Specification-Vendor" : " trackapi" ,
130- " Specification-Version" : " 1" , // We are version 1 of ourselves
131- " Implementation-Title" : project. name,
132- " Implementation-Version" : " ${ version} " ,
133- " Implementation-Vendor" : " trackapi" ,
134- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
113+ " Specification-Title" : " trackapi" ,
114+ " Specification-Vendor" : " trackapi" ,
115+ " Specification-Version" : " 1" , // We are version 1 of ourselves
116+ " Implementation-Title" : project. name,
117+ " Implementation-Version" : " ${ version} " ,
118+ " Implementation-Vendor" : " trackapi" ,
119+ " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
135120 ])
136121 }
137122}
138123
139- jar. finalizedBy(' reobfJar' )
140-
141124publishing {
142125 publications {
143126 mavenJava(MavenPublication ) {
@@ -156,8 +139,6 @@ publishing {
156139}
157140
158141
159-
160-
161142/*
162143// Example configuration to allow publishing using the maven-publish task
163144// we define a custom artifact that is sourced from the reobfJar output task
0 commit comments