|
1 | 1 | plugins { |
2 | | - id 'net.neoforged.gradle.userdev' |
| 2 | + id 'net.neoforged.moddev' |
3 | 3 | id 'maven-publish' |
4 | 4 | id 'com.diffplug.spotless' |
5 | 5 | id 'com.matthewprenger.cursegradle' |
@@ -52,9 +52,6 @@ repositories { |
52 | 52 | } |
53 | 53 |
|
54 | 54 | dependencies { |
55 | | - // To change the versions see the gradle.properties file |
56 | | - implementation "net.neoforged:neoforge:${project.neoforge_version}" |
57 | | - |
58 | 55 | if (project.runtime_itemlist_mod == "jei") { |
59 | 56 | implementation("mezz.jei:jei-${project.jei_minecraft_version}-neoforge:${project.jei_version}") { |
60 | 57 | exclude group: "mezz.jei" |
@@ -104,45 +101,48 @@ sourceSets { |
104 | 101 | } |
105 | 102 | } |
106 | 103 |
|
107 | | -minecraft { |
108 | | - accessTransformers { |
109 | | - file('src/main/resources/META-INF/accesstransformer.cfg') |
110 | | - } |
111 | | -} |
| 104 | +neoForge { |
| 105 | + version = project.neoforge_version |
112 | 106 |
|
113 | | -runs { |
114 | | - configureEach { |
115 | | - workingDirectory = project.file('run') |
116 | | - modSources = [sourceSets.main] |
117 | | - } |
118 | | - client { |
119 | | - } |
120 | | - gametestWorld { |
121 | | - configure("client") |
122 | | - programArguments("--username", "MDDev", "--quickPlaySingleplayer", "GametestWorld") |
123 | | - } |
124 | | - server { |
125 | | - } |
126 | | - data { |
127 | | - programArguments = [ |
128 | | - '--mod', 'moderndynamics', |
129 | | - '--all', |
130 | | - '--output', file('src/generated/resources/').absolutePath, |
131 | | - '--existing', file('src/main/resources').absolutePath |
132 | | - ] |
| 107 | + mods { |
| 108 | + moderndynamics { |
| 109 | + sourceSet sourceSets.main |
| 110 | + } |
133 | 111 | } |
134 | | - // Use to run the tests |
135 | | - gametest { |
136 | | - configure("gameTestServer") |
137 | | - workingDirectory = project.file("build/gametest") |
| 112 | + |
| 113 | + runs { |
| 114 | + client { |
| 115 | + client() |
| 116 | + } |
| 117 | + gametestWorld { |
| 118 | + client() |
| 119 | + programArguments.addAll("--username", "MDDev", "--quickPlaySingleplayer", "GametestWorld") |
| 120 | + } |
| 121 | + server { |
| 122 | + server() |
| 123 | + } |
| 124 | + data { |
| 125 | + data() |
| 126 | + programArguments = [ |
| 127 | + '--mod', 'moderndynamics', |
| 128 | + '--all', |
| 129 | + '--output', file('src/generated/resources/').absolutePath, |
| 130 | + '--existing', file('src/main/resources').absolutePath |
| 131 | + ] |
| 132 | + } |
| 133 | + // Use to run the tests |
| 134 | + gametest { |
| 135 | + type = "gameTestServer" |
| 136 | + gameDirectory = project.file("build/gametest") |
| 137 | + } |
138 | 138 | } |
139 | 139 | } |
140 | 140 |
|
141 | 141 | test.dependsOn runGametest |
142 | 142 |
|
143 | 143 | java { |
144 | 144 | toolchain { |
145 | | - languageVersion = JavaLanguageVersion.of(17) |
| 145 | + languageVersion = JavaLanguageVersion.of(21) |
146 | 146 | } |
147 | 147 | // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task |
148 | 148 | // if it is present. |
|
0 commit comments