Add double underscore ignore, list inheritance, quilt support

This commit is contained in:
shedaniel
2022-04-21 16:11:49 +08:00
parent c8cf426f11
commit 28b0bc8ac6
22 changed files with 768 additions and 340 deletions

44
body.md Normal file
View File

@@ -0,0 +1,44 @@
Architectury Templates can be used for setting your own architectury projects, for converting your existing projects to architectury projects, please refer to [Architectury Example Mod](https://github.com/architectury/architectury-example-mod) instead.
The following templates are offered in [Creative Commons Zero v1.0 Universal](https://github.com/architectury/architectury-example-mod/blob/1.17.1/LICENSE).
Architectury API is added to the templates by default, there are instructions on how to remove them within the buildscripts, depending on the API is **not required** to use the Architectury toolchain.
## How to choose a template
#### Mixin or Not?
Mixins is a base game modification system available on both Forge and Fabric, Forge modders may be less familiar with this as Forge itself usually provides everything you need. This is not the case with Fabric. A lot of the events and hooks are not available on Fabric (Architectury API does reimplement some), and most of the times you will need to hook it up yourselves.
The Fabric Wiki's [Introduction to Mixins](https://fabricmc.net/wiki/tutorial:mixin_introduction) is a great resource to start out. However, you might not need Mixins if your mod is something simple like adding a few blocks and items, Fabric API provides the essentials for that.
#### I want to mod for Quilt?
There are currently three variants of the Architectury Templates:
| Targets | Description |
| ------------------------ | ------------------------------------------------------------ |
| Forge | The Forge sub-project used to call Forge-specific code, and handles Forge mod init.<br />You will also run Forge on this sub-project. |
| Fabric-Like Intermediary | The Fabric-like binding project used to call Fabric APIs, this can be used to call code that is unspecific to both Fabric and Quilt, such as hooks that will apply to both Fabric and Quilt.<br />This sub-project is **not executable**. |
| Fabric | The Fabric sub-project used to call Fabric-specific code, and handles Fabric mod init.<br />You will also run Fabric on this sub-project. |
| Quilt | The Quilt sub-project used to call Quilt-specific code, and handled Quilt mod init.<br />You will also run Quilt on this sub-project. |
| Variants | Forge | Fabric-Like Intermediary | Fabric | Quilt |
| :---------------------------------------- | :---: | :----------------------: | :----: | :---: |
| Forge | ✔ | N/A | ✖ | ✖ |
| Forge-Fabric | ✔ | N/A | ✔ | ✖ |
| Forge-Quilt | ✔ | N/A | ✖ | ✔ |
| Forge-Fabric-Quilt<br />(Not Recommended) | ✔ | ✖ | ✔ | ✔ |
| Forge-Fabric-Likes | ✔ | ✔ | ✔ | ✔ |
## How to setup the template
Please read this documentation: [https://docs.architectury.dev/docs/architectury_api/getting_started.html](https://docs.architectury.dev/docs/architectury_api/getting_started.html).
**Discord:** [https://discord.gg/C2RdJDpRBP](https://discord.gg/C2RdJDpRBP)

View File

@@ -1,10 +0,0 @@
Architectury Templates can be used for setting your own architectury projects, for converting your existing projects to architectury projects, please refer to [Architectury Example Mod](https://github.com/architectury/architectury-example-mod) instead.
The following templates are offered in [Creative Commons Zero v1.0 Universal](https://github.com/architectury/architectury-example-mod/blob/1.17.1/LICENSE), TL;DR: You can do anything (except somethings) with these templates.
Architectury API is added to the templates by default, there are instructions on how to remove them within the buildscripts, depending on the API is **not required** to use the Architectury toolchain.
**Make sure** to do a find everywhere on `examplemod` and replace it with your own mod id.
**Documentation:** [https://docs.architectury.dev/](https://docs.architectury.dev/)
**Discord:** [https://discord.gg/C2RdJDpRBP](https://discord.gg/C2RdJDpRBP)

View File

@@ -18,7 +18,7 @@ task run(type: JavaExec, dependsOn: jar) {
mainClass = "dev.architectury.templates.GenerateTemplatesKt"
environment "CONFIG_PATH", file("generator.config.json").absolutePath
environment "OUTPUT_PATH", file("build/templates").absolutePath
environment "BODY_PATH", file("body.txt").absolutePath
environment "BODY_PATH", file("body.md").absolutePath
environment "PUBLISH", "true"
environment "GITHUB_TOKEN", System.getenv("GITHUB_TOKEN")
environment "GITHUB_REPOSITORY", System.getenv("GITHUB_REPOSITORY")

View File

@@ -1,307 +1,449 @@
{
"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_1_8",
"JAVA_16": "VERSION_16",
"JAVA_17": "VERSION_17",
"FABRIC_LOADER": {
"filter": ".*",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml"
"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_1_8",
"JAVA_16": "VERSION_16",
"JAVA_17": "VERSION_17",
"FABRIC_LOADER_PROP": "fabric_loader_version=",
"FABRIC_LOADER": {
"filter": ".*",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-loader/maven-metadata.xml"
},
"FABRIC_API_PROP": "fabric_api_version=",
"QUILT_LOADER_PROP": "quilt_loader_version=",
"QUILT_LOADER": {
"filter": ".*",
"pom": "https://maven.quiltmc.org/repository/release/org/quiltmc/quilt-loader/maven-metadata.xml"
},
"QUILT_QSL_PROP": "quilt_qsl_version=",
"QUILT_FABRIC_API_PROP": "quilt_fabric_api_version=",
"FABRIC_ADD_FABRICLIKE": "\n common(project(path: \":fabric-like\", configuration: \"namedElements\")) { transitive false }\n shadowCommon(project(path: \":fabric-like\", configuration: \"transformProductionFabric\")) { transitive false }",
"QUILT_ADD_FABRICLIKE": "\n common(project(path: \":fabric-like\", configuration: \"namedElements\")) { transitive false }\n shadowCommon(project(path: \":fabric-like\", configuration: \"transformProductionQuilt\")) { transitive false }"
},
"versions": {
"1.16.5-forge": {
"description": "1.16.5 Forge Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.16.5",
"JAVA_VERSION": "#JAVA_8",
"COMPILE_JAVA": "#COMPILE_JAVA_8",
"MCMETA_FORMAT": "6",
"JEI_MAJOR": "7",
"YARN_MAPPINGS": {
"filter": "1\\.16\\.5\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.16\\.5-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "36",
"MIXIN_COMPAT_LEVEL": "JAVA_8"
}
},
"1.16.5-forge-fabric": {
"description": "1.16.5 Forge-Fabric Template",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/api_old"
],
"tokens": {
"MINECRAFT": "1.16.5",
"COMMON_MOD_LOADERS": "fabric,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"fabric\")",
"JAVA_VERSION": "#JAVA_8",
"COMPILE_JAVA": "#COMPILE_JAVA_8_ARCH",
"__FABRIC_LOADER": "#FABRIC_LOADER",
"__FABRIC_LOADER_PROP": "#FABRIC_LOADER_PROP",
"MCMETA_FORMAT": "6",
"ARCHITECTURY_GROUP": "me.shedaniel",
"ARCHITECTURY_PACKAGE": "me.shedaniel.architectury",
"ARCHITECTURY_API": {
"filter": "1\\..*",
"pom": "https://maven.architectury.dev/me/shedaniel/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.16\\.5\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"__FABRIC_API": {
"filter": ".*\\+1\\.16",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"__FABRIC_API_PROP": "#FABRIC_API_PROP",
"FORGE": {
"filter": "1\\.16\\.5-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "36"
}
},
"1.16.5-forge-fabric-mixin": {
"description": "1.16.5 Forge-Fabric Template with Mixins",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/api_old",
"templates/mixin"
],
"inherit_tokens": ["1.16.5-forge-fabric"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"MIXIN_COMPAT_LEVEL": "JAVA_8",
"LOOM_FORGE_EXT": "loom {\n forge {\n mixinConfig \"examplemod-common.mixins.json\"\n mixinConfig \"examplemod.mixins.json\"\n }\n}\n"
}
},
"1.17.1-forge": {
"description": "1.17.1 Forge-Only Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.17.1",
"JAVA_VERSION": "#JAVA_16",
"COMPILE_JAVA": "#COMPILE_JAVA_16",
"MCMETA_FORMAT": "7",
"JEI_MAJOR": "8",
"YARN_MAPPINGS": {
"filter": "1\\.17\\.1\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.17\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "37",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.17.1-forge-fabric": {
"description": "1.17.1 Forge-Fabric Template",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.17.1",
"COMMON_MOD_LOADERS": "fabric,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"fabric\")",
"JAVA_VERSION": "#JAVA_16",
"COMPILE_JAVA": "#COMPILE_JAVA_16_ARCH",
"__FABRIC_LOADER": "#FABRIC_LOADER",
"__FABRIC_LOADER_PROP": "#FABRIC_LOADER_PROP",
"MCMETA_FORMAT": "7",
"ARCHITECTURY_GROUP": "dev.architectury",
"ARCHITECTURY_PACKAGE": "dev.architectury",
"ARCHITECTURY_API": {
"filter": "2\\..*",
"pom": "https://maven.architectury.dev/dev/architectury/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.17\\.1\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"__FABRIC_API": {
"filter": ".*\\+1\\.17",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"__FABRIC_API_PROP": "#FABRIC_API_PROP",
"FORGE": {
"filter": "1\\.17\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "37"
}
},
"1.17.1-forge-fabric-mixin": {
"description": "1.17.1 Forge-Fabric Template with Mixins",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": ["1.17.1-forge-fabric"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.1-forge": {
"description": "1.18.1 Forge Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.18.1",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17",
"MCMETA_FORMAT": "8",
"JEI_MAJOR": "9",
"YARN_MAPPINGS": {
"filter": "1\\.18\\.1\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "39",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.18.1-forge-fabric": {
"description": "1.18.1 Forge-Fabric Template",
"templates": [
"templates/architectury",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.18.1",
"COMMON_MOD_LOADERS": "fabric,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"fabric\")",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17_ARCH",
"__FABRIC_LOADER": "#FABRIC_LOADER",
"__FABRIC_LOADER_PROP": "#FABRIC_LOADER_PROP",
"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\\.1\\+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"
},
"__FABRIC_API_PROP": "#FABRIC_API_PROP",
"FORGE": {
"filter": "1\\.18\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "39"
}
},
"1.18.1-forge-fabric-mixin": {
"description": "1.18.1 Forge-Fabric Template with Mixins",
"templates": [
"templates/architectury",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": ["1.18.1-forge-fabric"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.2-forge": {
"description": "1.18.2 Forge Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.18.2",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17",
"MCMETA_FORMAT": "8",
"JEI_MAJOR": "9",
"YARN_MAPPINGS": {
"filter": "1\\.18\\.2\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18\\.2-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "40",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.18.2-forge-fabric": {
"description": "1.18.2 Forge-Fabric Template",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.18.2",
"COMMON_MOD_LOADERS": "fabric,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"fabric\")",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17_ARCH",
"__FABRIC_LOADER": "#FABRIC_LOADER",
"__FABRIC_LOADER_PROP": "#FABRIC_LOADER_PROP",
"MCMETA_FORMAT": "8",
"ARCHITECTURY_GROUP": "dev.architectury",
"ARCHITECTURY_PACKAGE": "dev.architectury",
"ARCHITECTURY_API": {
"filter": "4\\..*",
"pom": "https://maven.architectury.dev/dev/architectury/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.18\\.2\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"__FABRIC_API": {
"filter": ".*\\+1\\.18\\.2",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"__FABRIC_API_PROP": "#FABRIC_API_PROP",
"FORGE": {
"filter": "1\\.18\\.2-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "40"
}
},
"1.18.2-forge-fabric-mixin": {
"description": "1.18.2 Forge-Fabric Template with Mixins",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": ["1.18.2-forge-fabric"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.2-forge-quilt": {
"description": "1.18.2 Forge-Quilt Template",
"templates": [
"templates/architectury",
"templates/architectury_quilt",
"templates/api_new"
],
"inherit_tokens": ["1.18.2-forge-fabric"],
"tokens": {
"COMMON_MOD_LOADERS": "quilt,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"quilt\")",
"__FABRIC_LOADER_PROP": "",
"__FABRIC_LOADER": "",
"__FABRIC_API_PROP": "",
"__FABRIC_API": "",
"__QUILT_LOADER_PROP": "#QUILT_LOADER_PROP",
"__QUILT_LOADER": "#QUILT_LOADER",
"__QUILT_FABRIC_API_PROP": "#QUILT_FABRIC_API_PROP",
"__QUILT_FABRIC_API": {
"filter": ".*\\-1\\.18\\.2",
"pom": "https://maven.quiltmc.org/repository/release/org/quiltmc/quilted-fabric-api/quilted-fabric-api/maven-metadata.xml"
}
}
},
"1.18.2-forge-quilt-mixin": {
"description": "1.18.2 Forge-Quilt Template with Mixins",
"templates": [
"templates/architectury",
"templates/architectury_quilt",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": ["1.18.2-forge-quilt"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.2-forge-fabric-quilt": {
"description": "1.18.2 Forge-Fabric-Quilt Template",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/architectury_quilt",
"templates/api_new"
],
"inherit_tokens": ["1.18.2-forge-fabric"],
"tokens": {
"COMMON_MOD_LOADERS": "quilt,fabric,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"fabric\")\ninclude(\"quilt\")",
"__QUILT_LOADER_PROP": "#QUILT_LOADER_PROP",
"__QUILT_LOADER": "#QUILT_LOADER",
"__QUILT_FABRIC_API_PROP": "#QUILT_FABRIC_API_PROP",
"__QUILT_FABRIC_API": {
"filter": ".*\\-1\\.18\\.2",
"pom": "https://maven.quiltmc.org/repository/release/org/quiltmc/quilted-fabric-api/quilted-fabric-api/maven-metadata.xml"
}
}
},
"1.18.2-forge-fabric-quilt-mixin": {
"description": "1.18.2 Forge-Fabric-Quilt Template with Mixins",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/architectury_quilt",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": ["1.18.2-forge-fabric-quilt"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.2-forge-fabric-like": {
"description": "1.18.2 Forge-Fabric-Like Template",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/architectury_quilt",
"templates/architectury_fabric_like",
"templates/api_new"
],
"inherit_tokens": ["1.18.2-forge-fabric"],
"tokens": {
"COMMON_MOD_LOADERS": "quilt,fabric,forge",
"INCLUDE_FABRIC_OR_QUILT": "include(\"fabric-like\")\ninclude(\"fabric\")\ninclude(\"quilt\")",
"__FABRIC_ADD_FABRICLIKE": "#FABRIC_ADD_FABRICLIKE",
"__QUILT_ADD_FABRICLIKE": "#QUILT_ADD_FABRICLIKE",
"__QUILT_LOADER_PROP": "#QUILT_LOADER_PROP",
"__QUILT_LOADER": "#QUILT_LOADER",
"__QUILT_FABRIC_API_PROP": "#QUILT_FABRIC_API_PROP",
"__QUILT_FABRIC_API": {
"filter": ".*\\-1\\.18\\.2",
"pom": "https://maven.quiltmc.org/repository/release/org/quiltmc/quilted-fabric-api/quilted-fabric-api/maven-metadata.xml"
}
}
},
"1.18.2-forge-fabric-like-mixin": {
"description": "1.18.2 Forge-Fabric-Like Template with Mixins",
"templates": [
"templates/architectury",
"templates/architectury_fabric",
"templates/architectury_quilt",
"templates/architectury_fabric_like",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": ["1.18.2-forge-fabric-like"],
"tokens": {
"__MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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"
}
}
}
},
"versions": {
"1.16-forge": {
"description": "1.16.5 Forge-Only Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.16.5",
"JAVA_VERSION": "#JAVA_8",
"COMPILE_JAVA": "#COMPILE_JAVA_8",
"MCMETA_FORMAT": "6",
"JEI_MAJOR": "7",
"YARN_MAPPINGS": {
"filter": "1\\.16\\.5\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.16\\.5-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "36",
"MIXIN_COMPAT_LEVEL": "JAVA_8"
}
},
"1.16-architectury": {
"description": "1.16.5 Multi-Loader Template",
"templates": [
"templates/architectury",
"templates/api_old"
],
"tokens": {
"MINECRAFT": "1.16.5",
"JAVA_VERSION": "#JAVA_8",
"COMPILE_JAVA": "#COMPILE_JAVA_8_ARCH",
"FABRIC_LOADER": "#FABRIC_LOADER",
"LOOM_FORGE_EXT": "",
"MCMETA_FORMAT": "6",
"ARCHITECTURY_GROUP": "me.shedaniel",
"ARCHITECTURY_PACKAGE": "me.shedaniel.architectury",
"ARCHITECTURY_API": {
"filter": "1\\..*",
"pom": "https://maven.architectury.dev/me/shedaniel/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.16\\.5\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FABRIC_API": {
"filter": ".*\\+1\\.16",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.16\\.5-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "36",
"MIXIN_FABRIC_BLOCK": ""
}
},
"1.16-architectury-mixin": {
"description": "1.16.5 Multi-Loader Template with Mixins",
"templates": [
"templates/architectury",
"templates/api_old",
"templates/mixin"
],
"inherit_tokens": "1.16-architectury",
"tokens": {
"MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"MIXIN_COMPAT_LEVEL": "JAVA_8",
"LOOM_FORGE_EXT": "loom {\n forge {\n mixinConfig \"examplemod-common.mixins.json\"\n mixinConfig \"examplemod.mixins.json\"\n }\n}\n"
}
},
"1.17-forge": {
"description": "1.17.1 Forge-Only Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.17.1",
"JAVA_VERSION": "#JAVA_16",
"COMPILE_JAVA": "#COMPILE_JAVA_16",
"MCMETA_FORMAT": "7",
"JEI_MAJOR": "8",
"YARN_MAPPINGS": {
"filter": "1\\.17\\.1\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.17\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "37",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.17-architectury": {
"description": "1.17.1 Multi-Loader Template",
"templates": [
"templates/architectury",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.17.1",
"JAVA_VERSION": "#JAVA_16",
"COMPILE_JAVA": "#COMPILE_JAVA_16_ARCH",
"FABRIC_LOADER": "#FABRIC_LOADER",
"LOOM_FORGE_EXT": "",
"MCMETA_FORMAT": "7",
"ARCHITECTURY_GROUP": "dev.architectury",
"ARCHITECTURY_PACKAGE": "dev.architectury",
"ARCHITECTURY_API": {
"filter": "2\\..*",
"pom": "https://maven.architectury.dev/dev/architectury/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.17\\.1\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FABRIC_API": {
"filter": ".*\\+1\\.17",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.17\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "37",
"MIXIN_FABRIC_BLOCK": ""
}
},
"1.17-architectury-mixin": {
"description": "1.17.1 Multi-Loader Template with Mixins",
"templates": [
"templates/architectury",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": "1.17-architectury",
"tokens": {
"MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.1 Forge-Only Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.18.1",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17",
"MCMETA_FORMAT": "8",
"JEI_MAJOR": "9",
"YARN_MAPPINGS": {
"filter": "1\\.18\\.1\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "39",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.18-architectury": {
"description": "1.18.1 Multi-Loader Template",
"templates": [
"templates/architectury",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.18.1",
"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\\.1\\+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\\.1-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "39",
"MIXIN_FABRIC_BLOCK": ""
}
},
"1.18-architectury-mixin": {
"description": "1.18.1 Multi-Loader Template with Mixins",
"templates": [
"templates/architectury",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": "1.18-architectury",
"tokens": {
"MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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.2-forge": {
"description": "1.18.2 Forge-Only Template",
"templates": [
"templates/forge"
],
"tokens": {
"MINECRAFT": "1.18.2",
"JAVA_VERSION": "#JAVA_17",
"COMPILE_JAVA": "#COMPILE_JAVA_17",
"MCMETA_FORMAT": "8",
"JEI_MAJOR": "9",
"YARN_MAPPINGS": {
"filter": "1\\.18\\.2\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18\\.2-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "40",
"MIXIN_COMPAT_LEVEL": "JAVA_16"
}
},
"1.18.2-architectury": {
"description": "1.18.2 Multi-Loader Template",
"templates": [
"templates/architectury",
"templates/api_new"
],
"tokens": {
"MINECRAFT": "1.18.2",
"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": "4\\..*",
"pom": "https://maven.architectury.dev/dev/architectury/architectury/maven-metadata.xml"
},
"YARN_MAPPINGS": {
"filter": "1\\.18\\.2\\+build\\..*",
"pom": "https://maven.fabricmc.net/net/fabricmc/yarn/maven-metadata.xml"
},
"FABRIC_API": {
"filter": ".*\\+1\\.18\\.2",
"pom": "https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/maven-metadata.xml"
},
"FORGE": {
"filter": "1\\.18\\.2-.*",
"pom": "https://maven.minecraftforge.net/net/minecraftforge/forge/maven-metadata.xml"
},
"FORGE_LOADER_MAJOR": "40",
"MIXIN_FABRIC_BLOCK": ""
}
},
"1.18.2-architectury-mixin": {
"description": "1.18.2 Multi-Loader Template with Mixins",
"templates": [
"templates/architectury",
"templates/api_new",
"templates/mixin"
],
"inherit_tokens": "1.18.2-architectury",
"tokens": {
"MIXIN_FABRIC_BLOCK": "\n \"mixins\": [\n \"examplemod.mixins.json\",\n \"examplemod-common.mixins.json\"\n ],",
"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"
}
}
}
}

View File

@@ -44,6 +44,11 @@ fun main() {
}
config.versions.forEach { (id, entry) ->
val outputZip = outputPath.resolve("$id.zip")
val outputFolder = outputPath.resolve(id)
outputFolder.toFile().deleteRecursively()
println()
println()
println("Handling $id")
val toTransform = transformTokens(config, entry, cache)
ZipOutputStream(Files.newOutputStream(outputZip)).use { zipOutputStream ->
val entries = mutableMapOf<String, ByteArray>()
@@ -51,11 +56,28 @@ fun main() {
Files.walk(templateDirPath).filter { Files.isRegularFile(it) }.forEach { path ->
val pathName = templateDirPath.relativize(path).toString()
if (pathName.isTextFile) {
entries[pathName] = Files.readString(path).let {
var out = it
entries[pathName] = Files.readString(path).let { originalText ->
var out = originalText
toTransform.forEach { (from, to) ->
out = out.replace(from, to)
}
val matchedNotReplaced = "@([A-Z_]+)@".toRegex().findAll(out).toMutableList()
matchedNotReplaced.removeIf { result ->
val (token) = result.destructured
if (token.startsWith("__")) {
println("Replacing ${result.value} with ")
out = out.replace(result.value, "")
true
} else {
false
}
}
if (matchedNotReplaced.isNotEmpty()) {
System.err.println("Not replaced: $pathName")
matchedNotReplaced.forEach {
System.err.println("\t${it.value}")
}
}
out
}.encodeToByteArray()
} else {
@@ -66,6 +88,13 @@ fun main() {
entries.forEach { (path, bytes) ->
zipOutputStream.putNextEntry(ZipEntry(path))
zipOutputStream.write(bytes)
val outsidePath = outputFolder.resolve(path)
if (outsidePath.parent != null) {
Files.createDirectories(outsidePath.parent)
}
Files.write(outsidePath, bytes)
}
}
githubRelease?.uploadAsset(outputZip.toFile(), "application/zip")
@@ -74,16 +103,26 @@ fun main() {
fun transformTokens(config: TemplateConfig, entry: TemplateEntry, cache: MutableMap<String, String>): Map<String, String> {
val map = mutableMapOf<String, String>()
entry.inherit_tokens?.let { config.versions[it]!!.tokens }?.forEach { (token, element) ->
val replacement = element.findReplacement(config, cache)
println("Replacing @$token@ with $replacement")
map["@$token@"] = replacement
val inherited = mutableSetOf<String>()
fun inherit(inheritToken: String) {
if (inherited.add(inheritToken)) {
val inheritConfig = config.versions[inheritToken]!!
inheritConfig.tokens.forEach { (token, element) ->
val replacement = element.findReplacement(config, cache)
map.putIfAbsent("@$token@", replacement)
}
inheritConfig.inherit_tokens.forEach { inherit(it) }
}
}
entry.inherit_tokens.forEach { inherit(it) }
entry.tokens.forEach { (token, element) ->
val replacement = element.findReplacement(config, cache)
println("Replacing @$token@ with $replacement")
map["@$token@"] = replacement
}
map.forEach { (from, to) ->
println("Replacing $from with $to")
}
return map
}
@@ -125,7 +164,7 @@ data class TemplateConfig(
data class TemplateEntry(
val templates: List<String>,
val description: String,
val inherit_tokens: String? = null,
val inherit_tokens: List<String> = emptyList(),
val tokens: Map<String, JsonElement>,
)
@@ -144,7 +183,7 @@ val String.versionNonNull: Version
@JvmInline
value class Version(val version: String) : Comparable<Version> {
init {
require(version.matches("(\\d+(?:\\.\\d+)*)-?((?:.*)?)\\+?((?:.*)?)".toRegex())) { "Invalid version format" }
require(version.matches("(\\d+(?:\\.\\d+)*)-?((?:[^+]*)?)(?:\\+(.*))?".toRegex())) { "Invalid version format" }
}
data class VersionParts(
@@ -155,7 +194,7 @@ value class Version(val version: String) : Comparable<Version> {
val parts: VersionParts
get() {
return "(\\d+(?:\\.\\d+)*)-?((?:.*)?)\\+?((?:.*)?)".toRegex().matchEntire(version)!!.let {
return "(\\d+(?:\\.\\d+)*)-?((?:[^+]*)?)(?:\\+(.*))?".toRegex().matchEntire(version)!!.let {
val (version, snapshot, metadata) = it.destructured
VersionParts(version, snapshot, metadata)
}

View File

@@ -1,3 +1,11 @@
architectury {
common(rootProject.enabled_platforms.split(","))
}
loom {
accessWidenerPath = file("src/main/resources/examplemod.accesswidener")
}
dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
@@ -6,14 +14,6 @@ dependencies {
modApi "@ARCHITECTURY_GROUP@:architectury:${rootProject.architectury_version}"
}
architectury {
common()
}
loom {
accessWidenerPath = file("src/main/resources/examplemod.accesswidener")
}
publishing {
publications {
mavenCommon(MavenPublication) {

View File

@@ -1,7 +1,7 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}
@LOOM_FORGE_EXT@
@__LOOM_FORGE_EXT@
architectury {
platformSetupLoomIde()
forge()

View File

@@ -1,6 +1,7 @@
org.gradle.jvmargs=-Xmx2048M
@__KOTLIN_DISABLE_STDLIB@
minecraft_version=@MINECRAFT@
enabled_platforms=@COMMON_MOD_LOADERS@
archives_base_name=examplemod
mod_version=1.0.0
@@ -8,7 +9,10 @@ maven_group=net.examplemod
architectury_version=@ARCHITECTURY_API@
fabric_loader_version=@FABRIC_LOADER@
fabric_api_version=@FABRIC_API@
@__FABRIC_LOADER_PROP@@__FABRIC_LOADER@
@__FABRIC_API_PROP@@__FABRIC_API@
forge_version=@FORGE@
@__QUILT_LOADER_PROP@@__QUILT_LOADER@
@__QUILT_FABRIC_API_PROP@@__QUILT_FABRIC_API@

View File

@@ -8,7 +8,7 @@ pluginManagement {
}
include("common")
include("fabric")
@INCLUDE_FABRIC_OR_QUILT@
include("forge")
rootProject.name = "architectury-example-mod"

View File

@@ -26,7 +26,7 @@ dependencies {
modApi "@ARCHITECTURY_GROUP@:architectury-fabric:${rootProject.architectury_version}"
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }@__FABRIC_ADD_FABRICLIKE@
}
processResources {

View File

@@ -18,7 +18,7 @@
"main": [
"net.examplemod.fabric.ExampleModFabric"
]
},@MIXIN_FABRIC_BLOCK@
},@__MIXIN_FABRIC_BLOCK@
"depends": {
"fabric": "*",
"minecraft": ">=@MINECRAFT@",

View File

@@ -0,0 +1,16 @@
architectury {
common(rootProject.enabled_platforms.split(","))
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}
dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
// Remove the next line if you don't want to depend on the API
modApi "@ARCHITECTURY_GROUP@:architectury-fabric:${rootProject.architectury_version}"
compileClasspath(project(path: ":common", configuration: "namedElements")) { transitive false }
}

View File

@@ -0,0 +1,9 @@
package net.examplemod.fabriclike;
import net.examplemod.ExampleMod;
public class ExampleModFabricLike {
public static void init() {
ExampleMod.init();
}
}

View File

@@ -0,0 +1,11 @@
package net.examplemod.fabric;
import net.examplemod.fabriclike.ExampleModFabricLike;
import net.fabricmc.api.ModInitializer;
public class ExampleModFabric implements ModInitializer {
@Override
public void onInitialize() {
ExampleModFabricLike.init();
}
}

View File

@@ -0,0 +1,12 @@
package net.examplemod.quilt;
import net.examplemod.fabriclike.ExampleModFabricLike;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
public class ExampleModQuilt implements ModInitializer {
@Override
public void onInitialize(ModContainer mod) {
ExampleModFabricLike.init();
}
}

View File

@@ -0,0 +1,92 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
}
repositories {
maven { url "https://maven.quiltmc.org/repository/release/" }
}
architectury {
platformSetupLoomIde()
loader("quilt")
}
loom {
accessWidenerPath = project(":common").loom.accessWidenerPath
}
configurations {
common
shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this.
compileClasspath.extendsFrom common
runtimeClasspath.extendsFrom common
developmentQuilt.extendsFrom common
}
dependencies {
modImplementation "org.quiltmc:quilt-loader:${rootProject.quilt_loader_version}"
modApi "org.quiltmc.quilted-fabric-api:quilted-fabric-api:${rootProject.quilt_fabric_api_version}"
// Remove the next few lines if you don't want to depend on the API
modApi("@ARCHITECTURY_GROUP@:architectury-fabric:${rootProject.architectury_version}") {
// We must not pull Fabric Loader from Architectury Fabric
exclude group: "net.fabricmc"
exclude group: "net.fabricmc.fabric-api"
}
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionQuilt")) { transitive false }@__QUILT_ADD_FABRICLIKE@
}
processResources {
inputs.property "group", rootProject.maven_group
inputs.property "version", project.version
filesMatching("quilt.mod.json") {
expand "group": rootProject.maven_group,
"version": project.version
}
}
shadowJar {
exclude "architectury.common.json"
configurations = [project.configurations.shadowCommon]
classifier "dev-shadow"
}
remapJar {
injectAccessWidener = true
input.set shadowJar.archiveFile
dependsOn shadowJar
classifier null
}
jar {
classifier "dev"
}
sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
}
components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}
publishing {
publications {
mavenQuilt(MavenPublication) {
artifactId = rootProject.archives_base_name + "-" + project.name
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
}
}

View File

@@ -0,0 +1 @@
loom.platform=quilt

View File

@@ -0,0 +1,15 @@
package net.examplemod.fabric;
import net.examplemod.ExampleExpectPlatform;
import org.quiltmc.loader.api.QuiltLoader;
import java.nio.file.Path;
public class ExampleExpectPlatformImpl {
/**
* This is our actual method to {@link ExampleExpectPlatform#getConfigDirectory()}.
*/
public static Path getConfigDirectory() {
return QuiltLoader.getConfigDir();
}
}

View File

@@ -0,0 +1,12 @@
package net.examplemod.quilt;
import net.examplemod.ExampleMod;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
public class ExampleModQuilt implements ModInitializer {
@Override
public void onInitialize(ModContainer mod) {
ExampleMod.init();
}
}

View File

@@ -0,0 +1,41 @@
{
"schema_version": 1,@__MIXIN_FABRIC_BLOCK@
"quilt_loader": {
"group": "${group}",
"id": "examplemod",
"version": "${version}",
"name": "Example Mod",
"description": "This is an example description! Tell everyone what your mod is about!",
"authors": ["Me!"],
"contact": {
"sources": "https://github.com/architectury/architectury-templates"
},
"license": "Insert License Here",
"icon": "assets/examplemod/icon.png",
"intermediate_mappings": "net.fabricmc:intermediary",
"environment": "*",
"entrypoints": {
"init": [
"net.examplemod.quilt.ExampleModQuilt"
]
},
"depends": [
{
"id": "quilt_loader",
"version": "*"
},
{
"id": "quilt_base",
"version": "*"
},
{
"id": "minecraft",
"version": ">=@MINECRAFT@"
},
{
"id": "architectury",
"version": ">=@ARCHITECTURY_API@"
}
]
}
}