Skip to content

Commit

Permalink
Add 1.18, and fix tokens in .mcmeta, .cfg, .toml
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Dec 1, 2021
1 parent 62646f3 commit ad13825
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 6 deletions.
66 changes: 64 additions & 2 deletions generator.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
"global_tokens": {
"COMPILE_JAVA_8": "\n // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too\n // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.\n // We'll use that if it's available, but otherwise we'll use the older option.\n def targetVersion = 8\n if (JavaVersion.current().isJava9Compatible()) {\n options.release = targetVersion\n }",
"COMPILE_JAVA_16": " options.release = 16",
"COMPILE_JAVA_17": " options.release = 17",
"COMPILE_JAVA_8_ARCH": "\n // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too\n // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.\n // We'll use that if it's available, but otherwise we'll use the older option.\n def targetVersion = 8\n if (JavaVersion.current().isJava9Compatible()) {\n options.release = targetVersion\n }",
"COMPILE_JAVA_16_ARCH": " options.release = 16",
"COMPILE_JAVA_17_ARCH": " options.release = 17",
"JAVA_8": "VERSION_8",
"JAVA_16": "VERSION_16",
"JAVA_17": "VERSION_17",
"FABRIC_LOADER": {
"filter": ".*",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml"
Expand All @@ -31,7 +34,8 @@
"filter": "1\\.16\\.5-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "36"
"FORGE_LOADER_MAJOR": "36",
"MIXIN_COMPAT_LEVEL": "JAVA_8"
}
},
"1.16-architectury": {
Expand Down Expand Up @@ -100,7 +104,8 @@
"filter": "1\\.17\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "37"
"FORGE_LOADER_MAJOR": "37",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.17-architectury": {
Expand Down Expand Up @@ -149,6 +154,63 @@
"MIXIN_COMPAT_LEVEL": "JAVA_16",
"LOOM_FORGE_EXT": "loom {\n forge {\n mixinConfig \"examplemod-common.mixins.json\"\n mixinConfig \"examplemod.mixins.json\"\n }\n}\n"
}
},
"1.18-forge": {
"description": "1.18 Forge-Only Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.18",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17",
"MCMETA_FORMAT": "8",
"JEI_MAJOR": "9s",
"YARN_MAPPINGS": {
"filter": "1\\.18\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "38",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.18-architectury": {
"description": "1.18 Multi-Loader Template",
"templates": [
"templates/architectury",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.18",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17_ARCH",
"FABRIC_LOADER": "#FABRIC_LOADER",
"LOOM_FORGE_EXT": "",
"MCMETA_FORMAT": "8",
"ARCHITECTURY_GROUP": "dev.architectury",
"ARCHITECTURY_PACKAGE": "dev.architectury",
"ARCHITECTURY_API": {
"filter": "3\\..*",
"pom": "https://maven.architectury.dev/dev/architectury/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.18\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FABRIC_API": {
"filter": ".*\\+1\\.18",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "38"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fun transformTokens(config: TemplateConfig, entry: TemplateEntry, cache: Mutable
}

private val String.isTextFile: Boolean
get() = listOf(".txt", ".gradle", ".java", ".kt", ".kts", ".gradle", ".groovy", ".properties", ".json").any { ext ->
get() = listOf(".txt", ".gradle", ".java", ".kt", ".kts", ".gradle", ".groovy", ".properties", ".json", ".mcmeta", ".cfg", ".toml", ".yaml").any { ext ->
endsWith(ext)
}

Expand Down
2 changes: 1 addition & 1 deletion templates/architectury/fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.github.johnrengelman.shadow" version "7.1.0"
}

architectury {
Expand Down
2 changes: 1 addition & 1 deletion templates/architectury/forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.github.johnrengelman.shadow" version "7.1.0"
}
@LOOM_FORGE_EXT@
architectury {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit ad13825

Please sign in to comment.