Skip to content

Commit f196fc6

Browse files
committed
Update Forge templates
Ability to use official mappings will be implemented in the future I did not bother renaming Fg3* classes to Fg4* to minimize changes MDK changes taken from: MinecraftForge/MinecraftForge@48225e1 MinecraftForge/MinecraftForge@802298d MinecraftForge/MinecraftForge@a95b968 MinecraftForge/MinecraftForge@f4fd1c2 MinecraftForge/MinecraftForge@e80c785
1 parent 729808e commit f196fc6

File tree

4 files changed

+73
-19
lines changed

4 files changed

+73
-19
lines changed

src/main/kotlin/platform/forge/creator/ForgeProjectConfig.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ class ForgeProjectConfig : ProjectConfig(), GradleCreator {
5858
rootDirectory: Path,
5959
buildSystem: GradleBuildSystem
6060
) {
61-
buildSystem.gradleVersion = Fg2ProjectCreator.FG_WRAPPER_VERSION
61+
buildSystem.gradleVersion = if (isFg3(mcVersion, forgeVersion)) {
62+
Fg3ProjectCreator.FG4_WRAPPER_VERSION
63+
} else {
64+
Fg2ProjectCreator.FG_WRAPPER_VERSION
65+
}
6266
}
6367

6468
private fun isFg3(mcVersion: SemanticVersion, forgeVersion: SemanticVersion): Boolean {

src/main/kotlin/platform/forge/creator/ForgeProjectCreator.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ open class Fg3ProjectCreator(
170170

171171
return steps
172172
}
173+
174+
companion object {
175+
val FG4_WRAPPER_VERSION = SemanticVersion.release(6, 8, 1)
176+
}
173177
}
174178

175179
class Fg3Mc112ProjectCreator(

src/main/resources/fileTemplates/j2ee/forge/Forge (1.13+) Submodule build.gradle.ft

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
buildscript {
22
repositories {
3-
maven { url = 'https://files.minecraftforge.net/maven' }
3+
maven { url = 'https://maven.minecraftforge.net' }
44
#if (${MIXINS})
55
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
66
#end
7-
jcenter()
87
mavenCentral()
98
}
109
dependencies {
11-
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
10+
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
1211
#if (${MIXINS})
1312
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
1413
#end
@@ -22,12 +21,18 @@ apply plugin: 'org.spongepowered.mixin'
2221

2322
archivesBaseName = '${ARTIFACT_ID}'
2423

25-
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
24+
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
2625

2726
minecraft {
2827
// The mappings can be changed at any time, and must be in the following format.
29-
// snapshot_YYYYMMDD Snapshot are built nightly.
30-
// stable_# Stables are built at the discretion of the MCP team.
28+
// Channel: Version:
29+
// snapshot YYYYMMDD Snapshot are built nightly.
30+
// stable # Stables are built at the discretion of the MCP team.
31+
// official MCVersion Official field/method names from Mojang mapping files
32+
//
33+
// You must be aware of the Mojang license when using the 'official' mappings.
34+
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
35+
//
3136
// Use non-default mappings at your own risk. they may not always work.
3237
// Simply re-run your setup task after changing the mappings to update your workspace.
3338
mappings channel: '${MCP_CHANNEL}', version: '${MCP_VERSION}-${MCP_MC_VERSION}'
@@ -42,9 +47,15 @@ minecraft {
4247
workingDirectory project.file('run')
4348

4449
// Recommended logging data for a userdev environment
45-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
50+
// The markers can be changed as needed.
51+
// "SCAN": For mods scan.
52+
// "REGISTRIES": For firing of registry events.
53+
// "REGISTRYDUMP": For getting the contents of all registries.
54+
property 'forge.logging.markers', 'REGISTRIES'
4655

4756
// Recommended logging level for the console
57+
// You can set various levels here.
58+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
4859
property 'forge.logging.console.level', 'debug'
4960
#if (${MIXINS})
5061

@@ -62,9 +73,15 @@ minecraft {
6273
workingDirectory project.file('run')
6374

6475
// Recommended logging data for a userdev environment
65-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
76+
// The markers can be changed as needed.
77+
// "SCAN": For mods scan.
78+
// "REGISTRIES": For firing of registry events.
79+
// "REGISTRYDUMP": For getting the contents of all registries.
80+
property 'forge.logging.markers', 'REGISTRIES'
6681

6782
// Recommended logging level for the console
83+
// You can set various levels here.
84+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
6885
property 'forge.logging.console.level', 'debug'
6986
#if (${MIXINS})
7087

@@ -82,9 +99,15 @@ minecraft {
8299
workingDirectory project.file('run')
83100

84101
// Recommended logging data for a userdev environment
85-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
102+
// The markers can be changed as needed.
103+
// "SCAN": For mods scan.
104+
// "REGISTRIES": For firing of registry events.
105+
// "REGISTRYDUMP": For getting the contents of all registries.
106+
property 'forge.logging.markers', 'REGISTRIES'
86107

87108
// Recommended logging level for the console
109+
// You can set various levels here.
110+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
88111
property 'forge.logging.console.level', 'debug'
89112

90113
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.

src/main/resources/fileTemplates/j2ee/forge/Forge (1.13+) build.gradle.ft

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
buildscript {
22
repositories {
3-
maven { url = 'https://files.minecraftforge.net/maven' }
3+
maven { url = 'https://maven.minecraftforge.net' }
44
#if (${MIXINS})
55
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
66
#end
7-
jcenter()
87
mavenCentral()
98
}
109
dependencies {
11-
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
10+
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
1211
#if (${MIXINS})
1312
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
1413
#end
@@ -24,12 +23,18 @@ group = '${GROUP_ID}'
2423
version = '${MOD_VERSION}'
2524
archivesBaseName = '${ARTIFACT_ID}'
2625

27-
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
26+
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
2827

2928
minecraft {
3029
// The mappings can be changed at any time, and must be in the following format.
31-
// snapshot_YYYYMMDD Snapshot are built nightly.
32-
// stable_# Stables are built at the discretion of the MCP team.
30+
// Channel: Version:
31+
// snapshot YYYYMMDD Snapshot are built nightly.
32+
// stable # Stables are built at the discretion of the MCP team.
33+
// official MCVersion Official field/method names from Mojang mapping files
34+
//
35+
// You must be aware of the Mojang license when using the 'official' mappings.
36+
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
37+
//
3338
// Use non-default mappings at your own risk. they may not always work.
3439
// Simply re-run your setup task after changing the mappings to update your workspace.
3540
mappings channel: '${MCP_CHANNEL}', version: '${MCP_VERSION}-${MCP_MC_VERSION}'
@@ -44,9 +49,15 @@ minecraft {
4449
workingDirectory project.file('run')
4550

4651
// Recommended logging data for a userdev environment
47-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
52+
// The markers can be changed as needed.
53+
// "SCAN": For mods scan.
54+
// "REGISTRIES": For firing of registry events.
55+
// "REGISTRYDUMP": For getting the contents of all registries.
56+
property 'forge.logging.markers', 'REGISTRIES'
4857

4958
// Recommended logging level for the console
59+
// You can set various levels here.
60+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
5061
property 'forge.logging.console.level', 'debug'
5162
#if (${MIXINS})
5263

@@ -64,9 +75,15 @@ minecraft {
6475
workingDirectory project.file('run')
6576

6677
// Recommended logging data for a userdev environment
67-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
78+
// The markers can be changed as needed.
79+
// "SCAN": For mods scan.
80+
// "REGISTRIES": For firing of registry events.
81+
// "REGISTRYDUMP": For getting the contents of all registries.
82+
property 'forge.logging.markers', 'REGISTRIES'
6883

6984
// Recommended logging level for the console
85+
// You can set various levels here.
86+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
7087
property 'forge.logging.console.level', 'debug'
7188
#if (${MIXINS})
7289

@@ -85,9 +102,15 @@ minecraft {
85102
workingDirectory project.file('run')
86103

87104
// Recommended logging data for a userdev environment
88-
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
105+
// The markers can be changed as needed.
106+
// "SCAN": For mods scan.
107+
// "REGISTRIES": For firing of registry events.
108+
// "REGISTRYDUMP": For getting the contents of all registries.
109+
property 'forge.logging.markers', 'REGISTRIES'
89110

90111
// Recommended logging level for the console
112+
// You can set various levels here.
113+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
91114
property 'forge.logging.console.level', 'debug'
92115

93116
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.

0 commit comments

Comments
 (0)