├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── common ├── build.gradle └── src │ └── main │ ├── java │ └── net │ │ └── examplemod │ │ ├── ExampleBlocks.java │ │ ├── ExampleExpectPlatform.java │ │ ├── ExampleMod.java │ │ └── mixin │ │ └── MixinTitleScreen.java │ └── resources │ ├── architectury.common.json │ ├── examplemod-common.mixins.json │ └── examplemod.accesswidener ├── fabric ├── build.gradle ├── run │ └── config │ │ └── fabric_loader_dependencies.json └── src │ └── main │ ├── java │ └── net │ │ └── examplemod │ │ └── fabric │ │ ├── ExampleExpectPlatformImpl.java │ │ └── ExampleModFabric.java │ └── resources │ ├── assets │ └── examplemod │ │ └── icon.png │ ├── examplemod.mixins.json │ └── fabric.mod.json ├── forge ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── java │ └── net │ │ └── examplemod │ │ └── forge │ │ ├── ExampleExpectPlatformImpl.java │ │ └── ExampleModForge.java │ └── resources │ ├── META-INF │ └── mods.toml │ ├── examplemod.mixins.json │ ├── icon.png │ └── pack.mcmeta ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | on: [ pull_request, push ] 3 | 4 | jobs: 5 | build: 6 | strategy: 7 | matrix: 8 | java: [ 17 ] 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout Repository 12 | uses: actions/checkout@v4 13 | 14 | - name: Setup Java 15 | run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> "$GITHUB_ENV" 16 | 17 | - name: Loom Cache 18 | uses: actions/cache@v4 19 | with: 20 | path: "**/.gradle/loom-cache" 21 | key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}" 22 | restore-keys: "${{ runner.os }}-gradle-" 23 | 24 | - name: Setup Gradle 25 | uses: gradle/actions/setup-gradle@v4 26 | with: 27 | gradle-home-cache-cleanup: true 28 | 29 | - name: Validate Gradle Wrapper Integrity 30 | uses: gradle/wrapper-validation-action@v2 31 | 32 | - name: build 33 | run: ./gradlew build 34 | 35 | - name: capture build artifacts 36 | uses: actions/upload-artifact@v4 37 | with: 38 | name: Artifacts 39 | path: | 40 | fabric/build/libs/ 41 | forge/build/libs/ 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.ipr 3 | run/ 4 | *.iws 5 | out/ 6 | *.iml 7 | .gradle/ 8 | output/ 9 | bin/ 10 | libs/ 11 | 12 | .classpath 13 | .project 14 | .idea/ 15 | classes/ 16 | .metadata 17 | .vscode 18 | .settings 19 | *.launch -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Create Multi-Loader Addon Template 2 | A template based on Architectury for creating addons for Create on Forge and Fabric simultaneously. 3 | 4 | ## How does it work? 5 | This template is powered by the [Architectury](https://github.com/architectury) toolchain. 6 | Architectury allows developers to create the majority of their mod in common, loader-agnostic code that 7 | only touches Minecraft itself. This can be found in the [common](common) subproject. Each loader target 8 | also has its own subproject: those being [forge](forge) and [fabric](fabric). (Quilt support: you 9 | shouldn't need anything special and the Fabric version should work fine, but it is possible to add a 10 | `quilt` subproject if needed.) These loader-specific projects bridge between their respective loaders 11 | and the common code. 12 | 13 | This system can be extended to work with Create as well as plain Minecraft. The common project gives 14 | access to most of Create, Registrate, and Flywheel. 15 | 16 | ## Limitations 17 | Minecraft has a lot of differences across loaders. You'll need to manage these differences using 18 | abstractions. Architectury does provide an [API](https://github.com/architectury/architectury-api) 19 | which you may use if desired, but it means you have another dependency to worry about. 20 | 21 | This also applies to Create, which underwent significant changes in porting to Fabric. This means a lot 22 | of it will be different between loaders. The `common` project is only capable of referencing the code 23 | on one loader (Fabric in this template), so you should be careful to not reference things that don't 24 | exist on the other one. Test often, and check the code on both loaders. When you do need to use these 25 | changed things, that leads us to... 26 | 27 | ## Solutions 28 | There's a bunch of ways to work around the differences. 29 | 30 | First is Architectury API. It provides cross-loader abstractions that can be used in common code for 31 | a decent amount of Minecraft. However, it means you need to worry about another dependency. It also 32 | doesn't really help with Create. 33 | 34 | Next is the `@ExpectPlatform` annotation. It allows the implementation of a method to be replaced 35 | at compile time per-loader, letting you make your own abstractions. It is part of the Architectury 36 | plugin and does not cause an extra dependency. However, it can only be placed on static methods. See 37 | [ExampleExpectPlatform](common/src/main/java/net/examplemod/ExampleExpectPlatform.java) in common 38 | for an example. 39 | 40 | Finally, simply have a common interface with implementation based on the loader. You might have a 41 | `PlatformHelper` common interface, with a static instance somewhere. On Fabric, set it to a 42 | `FabricPlatformHelper`, and a `ForgePlatformHelper` on Forge. The implementation is kept as a detail 43 | so you can use your helper from common code. 44 | 45 | ## Features 46 | - Access to Create and all of its dependencies on both loaders 47 | - Automatic build workflow with GitHub Actions 48 | - Developer QOL: Mod Menu, recipe viewers 49 | 50 | ## Use 51 | Ready to get started? First you'll want to create a new repository using this template. You can do it 52 | through GitHub with the big green button near the top that says `Use this template`. 53 | 54 | Once you've got your repository set up, you'll want to change all the branding to your mod instead 55 | of the template. Every `examplemod`, every placeholder. 56 | 57 | You're free to change your license: CC0 lets you do whatever you want. Base Create is MIT, for reference. 58 | 59 | Replace this README with information about your addon. Give it an icon and change the metadata in the 60 | [fabric.mod.json](fabric/src/main/resources/fabric.mod.json) and the 61 | [mods.toml](forge/src/main/resources/META-INF/mods.toml). 62 | 63 | Configure your dependencies. Each subproject `build.gradle` has optional dependencies commented. 64 | Either remove them or uncomment them. For Fabric, set your preferred recipe viewer with 65 | `fabric_recipe_viewer` in the root [gradle.properties](gradle.properties). 66 | 67 | Remember to remove any example code you don't need anymore. 68 | 69 | Get modding! 70 | 71 | ## Notes 72 | - Architectury does not merge jars; When you build, you get separate jars for each loader. 73 | There is an independent project that can merge these into one if desired called 74 | [Forgix](https://github.com/PacifistMC/Forgix). 75 | - The file names and versions of jars are configured in the root [build.gradle](build.gradle). Feel 76 | free to change the format if desired, but make sure it follows SemVer to work well on Fabric. 77 | - When publishing, you should always let GitHub Actions build your release jars. These jars are built in predictable 78 | environments and have build metadata. 79 | 80 | ## Other Templates 81 | - [Fabric-only template](https://github.com/Fabricators-of-Create/create-fabric-addon-template) 82 | - [Forge-only template](https://github.com/kotakotik22/CreateAddonTemplate) 83 | 84 | ## Help 85 | Questions? Join us in the #devchat channel of the [Create Discord](https://discord.com/invite/hmaD7Se). 86 | 87 | ## License 88 | 89 | This template is available under the CC0 license. Feel free to do as you wish with it. 90 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "architectury-plugin" version "3.4.+" 3 | id "dev.architectury.loom" version "1.7.+" apply false 4 | } 5 | 6 | architectury { 7 | minecraft = minecraft_version 8 | } 9 | 10 | subprojects { 11 | apply plugin: "dev.architectury.loom" 12 | 13 | loom { 14 | silentMojangMappingsLicense() 15 | } 16 | 17 | repositories { 18 | maven { url = "https://maven.parchmentmc.org" } // Parchment mappings 19 | 20 | // mavens used on both forge and fabric 21 | maven { url = "https://maven.blamejared.com/" } // JEI 22 | maven { url = "https://maven.tterrag.com/" } // Flywheel on both, Create and Registrate on forge 23 | } 24 | 25 | dependencies { 26 | minecraft "com.mojang:minecraft:$minecraft_version" 27 | // Can't use parchment for some reason, game ends up completely unmapped 28 | mappings loom.officialMojangMappings() 29 | 30 | // see each subproject for more dependencies. 31 | } 32 | } 33 | 34 | allprojects { 35 | apply plugin: "java" 36 | apply plugin: "architectury-plugin" 37 | apply plugin: "maven-publish" 38 | 39 | base.archivesName = archives_base_name 40 | group = maven_group 41 | 42 | // Formats the mod version to include the loader, Minecraft version, and build number (if present) 43 | // example: 1.0.0+fabric-1.18.2-build.100 44 | String buildNumber = System.getenv("GITHUB_RUN_NUMBER") 45 | version = "$mod_version+$project.name-$minecraft_version" + (buildNumber != null ? "-build.$buildNumber" : "") 46 | 47 | tasks.withType(JavaCompile).configureEach { 48 | options.encoding = "UTF-8" 49 | } 50 | 51 | java { 52 | withSourcesJar() 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /common/build.gradle: -------------------------------------------------------------------------------- 1 | architectury { 2 | common(enabled_platforms.split(",")) 3 | } 4 | 5 | loom { 6 | accessWidenerPath = file("src/main/resources/examplemod.accesswidener") 7 | } 8 | 9 | repositories { 10 | // mavens for Create Fabric and dependencies 11 | maven { url = "https://mvn.devos.one/releases" } // Porting Lib releases 12 | maven { url = "https://mvn.devos.one/snapshots" } // Create and several dependencies 13 | maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes 14 | maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // Forge Config API Port 15 | 16 | maven { // Fabric ASM for Porting Lib 17 | url = "https://jitpack.io/" 18 | content { includeGroupAndSubgroups("com.github") } 19 | } 20 | 21 | maven { url = "https://maven.shedaniel.me" } // Cloth Config, REI 22 | maven { url = "https://maven.blamejared.com" } // JEI 23 | 24 | maven { url = "https://api.modrinth.com/maven" } // LazyDFU 25 | maven { url = "https://maven.terraformersmc.com/releases" } // Mod Menu, EMI 26 | } 27 | 28 | dependencies { 29 | // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies 30 | // Do NOT use other classes from fabric loader 31 | modImplementation("net.fabricmc:fabric-loader:$fabric_loader_version") 32 | // Compile against Create Fabric in common 33 | // beware of differences across platforms! 34 | // dependencies must also be pulled in (transitively) for all classes to be remapped properly. 35 | // All dependencies except Flywheel and Registrate are NOT safe to use! 36 | // Flywheel and Registrate must also be used carefully due to differences across loaders. 37 | modCompileOnly("com.simibubi.create:create-fabric-$minecraft_version:$create_fabric_version") 38 | } 39 | -------------------------------------------------------------------------------- /common/src/main/java/net/examplemod/ExampleBlocks.java: -------------------------------------------------------------------------------- 1 | package net.examplemod; 2 | 3 | import com.simibubi.create.foundation.data.CreateRegistrate; 4 | import com.tterrag.registrate.util.entry.BlockEntry; 5 | import net.minecraft.world.level.block.Block; 6 | 7 | public class ExampleBlocks { 8 | public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(ExampleMod.MOD_ID); 9 | 10 | public static final BlockEntry EXAMPLE_BLOCK = REGISTRATE.block("example_block", Block::new).register(); 11 | 12 | public static void init() { 13 | // load the class and register everything 14 | ExampleMod.LOGGER.info("Registering blocks for " + ExampleMod.NAME); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/net/examplemod/ExampleExpectPlatform.java: -------------------------------------------------------------------------------- 1 | package net.examplemod; 2 | 3 | import dev.architectury.injectables.annotations.ExpectPlatform; 4 | 5 | public class ExampleExpectPlatform { 6 | /** 7 | * an example of {@link ExpectPlatform}. 8 | *

9 | * This must be a public static method. The platform-implemented solution must be placed under a 10 | * platform sub-package, with its class suffixed with {@code Impl}. 11 | *

12 | * Example: 13 | * Expect: net.examplemod.ExampleExpectPlatform#platformName() 14 | * Actual Fabric: net.examplemod.fabric.ExampleExpectPlatformImpl#platformName() 15 | * Actual Forge: net.examplemod.forge.ExampleExpectPlatformImpl#platformName() 16 | *

17 | * You should also get the IntelliJ plugin to help with @ExpectPlatform. 18 | */ 19 | @ExpectPlatform 20 | public static String platformName() { 21 | // Just throw an error, the content should get replaced at runtime. 22 | throw new AssertionError(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/net/examplemod/ExampleMod.java: -------------------------------------------------------------------------------- 1 | package net.examplemod; 2 | 3 | import com.simibubi.create.Create; 4 | import net.minecraft.resources.ResourceLocation; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | public class ExampleMod { 9 | public static final String MOD_ID = "examplemod"; 10 | public static final String NAME = "Example Mod"; 11 | public static final Logger LOGGER = LoggerFactory.getLogger(NAME); 12 | 13 | 14 | public static void init() { 15 | LOGGER.info("{} initializing! Create version: {} on platform: {}", NAME, Create.VERSION, ExampleExpectPlatform.platformName()); 16 | ExampleBlocks.init(); // hold registrate in a separate class to avoid loading early on forge 17 | } 18 | 19 | public static ResourceLocation id(String path) { 20 | return new ResourceLocation(MOD_ID, path); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/net/examplemod/mixin/MixinTitleScreen.java: -------------------------------------------------------------------------------- 1 | package net.examplemod.mixin; 2 | 3 | import net.examplemod.ExampleMod; 4 | import net.minecraft.client.gui.screens.TitleScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TitleScreen.class) 11 | public class MixinTitleScreen { 12 | @Inject(at = @At("HEAD"), method = "init()V") 13 | private void init(CallbackInfo info) { 14 | ExampleMod.LOGGER.info("Hello from {}!", ExampleMod.class.getName()); 15 | } 16 | } -------------------------------------------------------------------------------- /common/src/main/resources/architectury.common.json: -------------------------------------------------------------------------------- 1 | { 2 | "accessWidener": "examplemod.accesswidener" 3 | } 4 | -------------------------------------------------------------------------------- /common/src/main/resources/examplemod-common.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "net.examplemod.mixin", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "MixinTitleScreen" 8 | ], 9 | "mixins": [ 10 | ], 11 | "injectors": { 12 | "defaultRequire": 1 13 | } 14 | } -------------------------------------------------------------------------------- /common/src/main/resources/examplemod.accesswidener: -------------------------------------------------------------------------------- 1 | accessWidener v2 named -------------------------------------------------------------------------------- /fabric/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.github.johnrengelman.shadow" version "7.1.2" 3 | } 4 | 5 | architectury { 6 | platformSetupLoomIde() 7 | fabric() 8 | } 9 | 10 | loom { 11 | accessWidenerPath = project(":common").loom.accessWidenerPath 12 | } 13 | 14 | configurations { 15 | common 16 | shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. 17 | compileClasspath.extendsFrom common 18 | runtimeClasspath.extendsFrom common 19 | developmentFabric.extendsFrom common 20 | } 21 | 22 | repositories { 23 | // mavens for Create Fabric and dependencies 24 | maven { url = "https://mvn.devos.one/releases" } // Porting Lib releases 25 | maven { url = "https://mvn.devos.one/snapshots" } // Create and several dependencies 26 | maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes 27 | maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven" } // Forge Config API Port 28 | 29 | maven { // Fabric ASM for Porting Lib 30 | url = "https://jitpack.io/" 31 | content { includeGroupAndSubgroups("com.github") } 32 | } 33 | 34 | maven { url = "https://maven.shedaniel.me" } // Cloth Config, REI 35 | maven { url = "https://maven.blamejared.com" } // JEI 36 | maven { url = "https://maven.terraformersmc.com/releases" } // Mod Menu, EMI 37 | } 38 | 39 | configurations.configureEach { 40 | resolutionStrategy { 41 | // make sure the desired version of loader is used. Sometimes old versions are pulled in transitively. 42 | force("net.fabricmc:fabric-loader:$fabric_loader_version") 43 | } 44 | } 45 | 46 | dependencies { 47 | modImplementation("net.fabricmc:fabric-loader:$fabric_loader_version") 48 | common(project(path: ":common", configuration: "namedElements")) { transitive = false } 49 | shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive = false } 50 | 51 | // dependencies 52 | modImplementation("net.fabricmc.fabric-api:fabric-api:$fabric_api_version") 53 | 54 | // Create - dependencies are added transitively 55 | modImplementation("com.simibubi.create:create-fabric-$minecraft_version:$create_fabric_version") 56 | 57 | // Development QOL 58 | modLocalRuntime("com.terraformersmc:modmenu:$modmenu_version") 59 | 60 | // Recipe Viewers - Create Fabric supports JEI, REI, and EMI. 61 | // See root gradle.properties to choose which to use at runtime. 62 | switch (fabric_recipe_viewer.toLowerCase(Locale.ROOT)) { 63 | case "jei": modLocalRuntime("mezz.jei:jei-$minecraft_version-fabric:$jei_version"); break 64 | case "rei": modLocalRuntime("me.shedaniel:RoughlyEnoughItems-fabric:$rei_version"); break 65 | case "emi": modLocalRuntime("dev.emi:emi-fabric:$emi_version"); break 66 | case "disabled": break 67 | default: println("Unknown recipe viewer specified: $fabric_recipe_viewer. Must be JEI, REI, EMI, or disabled.") 68 | } 69 | // if you would like to add integration with them, uncomment them here. 70 | // modCompileOnly("mezz.jei:jei-$minecraft_version-fabric:$jei_version") 71 | // modCompileOnly("mezz.jei:jei-$minecraft_version-common:$jei_version") 72 | // modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:$rei_version") 73 | // modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:$rei_version") 74 | // modCompileOnly("dev.emi:emi:$emi_version") 75 | } 76 | 77 | processResources { 78 | // set up properties for filling into metadata 79 | Map properties = [ 80 | "version": version, 81 | "fabric_loader_version": fabric_loader_version, 82 | "fabric_api_version": fabric_api_version, 83 | "minecraft_version": minecraft_version, 84 | "create_version": create_fabric_version // on fabric, use the entire version, unlike forge 85 | ] 86 | inputs.properties(properties) 87 | 88 | filesMatching("fabric.mod.json") { 89 | expand properties 90 | } 91 | } 92 | 93 | shadowJar { 94 | exclude "architectury.common.json" 95 | 96 | configurations = [project.configurations.shadowCommon] 97 | archiveClassifier = "dev-shadow" 98 | } 99 | 100 | remapJar { 101 | injectAccessWidener = true 102 | input.set shadowJar.archiveFile 103 | dependsOn shadowJar 104 | archiveClassifier = null 105 | } 106 | 107 | jar { 108 | archiveClassifier = "dev" 109 | } 110 | 111 | sourcesJar { 112 | def commonSources = project(":common").sourcesJar 113 | dependsOn commonSources 114 | from commonSources.archiveFile.map { zipTree(it) } 115 | } 116 | 117 | components.java { 118 | withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { 119 | skip() 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /fabric/run/config/fabric_loader_dependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "overrides": { 4 | "forgeconfigapiport": { 5 | "-depends": { 6 | "com_electronwill_night-config_core": "", 7 | "com_electronwill_night-config_toml": "" 8 | } 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /fabric/src/main/java/net/examplemod/fabric/ExampleExpectPlatformImpl.java: -------------------------------------------------------------------------------- 1 | package net.examplemod.fabric; 2 | 3 | import net.fabricmc.loader.api.FabricLoader; 4 | 5 | public class ExampleExpectPlatformImpl { 6 | public static String platformName() { 7 | return FabricLoader.getInstance().isModLoaded("quilt_loader") ? "Quilt" : "Fabric"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /fabric/src/main/java/net/examplemod/fabric/ExampleModFabric.java: -------------------------------------------------------------------------------- 1 | package net.examplemod.fabric; 2 | 3 | import io.github.fabricators_of_create.porting_lib.util.EnvExecutor; 4 | import net.examplemod.ExampleBlocks; 5 | import net.examplemod.ExampleMod; 6 | import net.fabricmc.api.ModInitializer; 7 | 8 | public class ExampleModFabric implements ModInitializer { 9 | @Override 10 | public void onInitialize() { 11 | ExampleMod.init(); 12 | ExampleMod.LOGGER.info(EnvExecutor.unsafeRunForDist( 13 | () -> () -> "{} is accessing Porting Lib on a Fabric client!", 14 | () -> () -> "{} is accessing Porting Lib on a Fabric server!" 15 | ), ExampleMod.NAME); 16 | // on fabric, Registrates must be explicitly finalized and registered. 17 | ExampleBlocks.REGISTRATE.register(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fabric/src/main/resources/assets/examplemod/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fabricators-of-Create/create-multiloader-addon-template/0424e4f2e5c3f83a9a1f3b63caa5219f6bbda793/fabric/src/main/resources/assets/examplemod/icon.png -------------------------------------------------------------------------------- /fabric/src/main/resources/examplemod.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "net.examplemod.mixin.fabric", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | ], 8 | "mixins": [ 9 | ], 10 | "injectors": { 11 | "defaultRequire": 1 12 | } 13 | } -------------------------------------------------------------------------------- /fabric/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "examplemod", 4 | "version": "${version}", 5 | "name": "Example Mod", 6 | "description": "This is an example description! Tell everyone what your mod is about!", 7 | "authors": [ 8 | "Me!" 9 | ], 10 | "contact": { 11 | "homepage": "https://fabricmc.net/", 12 | "sources": "https://github.com/FabricMC/fabric-example-mod" 13 | }, 14 | "license": "Insert License Here", 15 | "icon": "assets/examplemod/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "net.examplemod.fabric.ExampleModFabric" 20 | ] 21 | }, 22 | "mixins": [ 23 | "examplemod.mixins.json", 24 | "examplemod-common.mixins.json" 25 | ], 26 | "depends": { 27 | "minecraft": "${minecraft_version}", 28 | "fabricloader": ">=${fabric_loader_version}", 29 | "fabric-api": ">=${fabric_api_version}", 30 | "create": "${create_version}" 31 | } 32 | } -------------------------------------------------------------------------------- /forge/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.github.johnrengelman.shadow" version "7.1.2" 3 | } 4 | 5 | architectury { 6 | platformSetupLoomIde() 7 | forge() 8 | } 9 | 10 | loom { 11 | accessWidenerPath = project(":common").loom.accessWidenerPath 12 | 13 | forge { 14 | convertAccessWideners = true 15 | extraAccessWideners.add loom.accessWidenerPath.get().asFile.name 16 | } 17 | } 18 | 19 | configurations { 20 | common 21 | shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. 22 | compileClasspath.extendsFrom common 23 | runtimeClasspath.extendsFrom common 24 | developmentForge.extendsFrom common 25 | } 26 | 27 | repositories { 28 | // No additional repositories are needed on forge, Tterrag's has it all. 29 | } 30 | 31 | dependencies { 32 | forge("net.minecraftforge:forge:$minecraft_version-$forge_version") 33 | common(project(path: ":common", configuration: "namedElements")) { transitive = false } 34 | shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } 35 | 36 | // Create and its dependencies 37 | modImplementation("com.simibubi.create:create-$minecraft_version:$create_forge_version:slim") { transitive = false } 38 | modImplementation("com.tterrag.registrate:Registrate:$registrate_forge_version") 39 | modImplementation("com.jozufozu.flywheel:flywheel-forge-$flywheel_forge_minecraft_version:$flywheel_forge_version") 40 | 41 | // Development QOL 42 | modLocalRuntime("mezz.jei:jei-$minecraft_version-forge:$jei_version") { transitive = false } 43 | 44 | // if you would like to add integration with JEI, uncomment this line. 45 | // modCompileOnly("mezz.jei:jei-$minecraft_version:$jei_version:api") 46 | } 47 | 48 | processResources { 49 | // set up properties for filling into metadata 50 | Map properties = [ 51 | "version": version, 52 | "forge_version": forge_version.split("\\.")[0], // only specify major version of forge 53 | "minecraft_version": minecraft_version, 54 | "create_version": create_forge_version.split("-")[0] // cut off build number 55 | ] 56 | inputs.properties(properties) 57 | 58 | filesMatching("META-INF/mods.toml") { 59 | expand properties 60 | } 61 | } 62 | 63 | loom { 64 | forge { 65 | mixinConfig( 66 | "examplemod-common.mixins.json", 67 | "examplemod.mixins.json" 68 | ) 69 | } 70 | } 71 | 72 | shadowJar { 73 | exclude "fabric.mod.json" 74 | exclude "architectury.common.json" 75 | 76 | configurations = [project.configurations.shadowCommon] 77 | archiveClassifier = "dev-shadow" 78 | } 79 | 80 | remapJar { 81 | input.set shadowJar.archiveFile 82 | dependsOn shadowJar 83 | archiveClassifier = null 84 | } 85 | 86 | jar { 87 | archiveClassifier = "dev" 88 | } 89 | 90 | sourcesJar { 91 | def commonSources = project(":common").sourcesJar 92 | dependsOn commonSources 93 | from commonSources.archiveFile.map { zipTree(it) } 94 | } 95 | 96 | components.java { 97 | withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { 98 | skip() 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /forge/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=forge -------------------------------------------------------------------------------- /forge/src/main/java/net/examplemod/forge/ExampleExpectPlatformImpl.java: -------------------------------------------------------------------------------- 1 | package net.examplemod.forge; 2 | 3 | public class ExampleExpectPlatformImpl { 4 | public static String platformName() { 5 | return "Forge"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /forge/src/main/java/net/examplemod/forge/ExampleModForge.java: -------------------------------------------------------------------------------- 1 | package net.examplemod.forge; 2 | 3 | import net.examplemod.ExampleBlocks; 4 | import net.examplemod.ExampleMod; 5 | import net.minecraftforge.eventbus.api.IEventBus; 6 | import net.minecraftforge.fml.common.Mod; 7 | import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; 8 | 9 | @Mod(ExampleMod.MOD_ID) 10 | public class ExampleModForge { 11 | public ExampleModForge() { 12 | // registrate must be given the mod event bus on forge before registration 13 | IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); 14 | ExampleBlocks.REGISTRATE.registerEventListeners(eventBus); 15 | ExampleMod.init(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /forge/src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "[${forge_version},)" 3 | #issueTrackerURL = "" 4 | license = "Insert License Here" 5 | 6 | [[mods]] 7 | modId = "examplemod" 8 | version = "${version}" 9 | displayName = "Example Mod" 10 | authors = "Me!" 11 | description = ''' 12 | This is an example description! Tell everyone what your mod is about! 13 | ''' 14 | logoFile = "icon.png" 15 | 16 | [[dependencies.examplemod]] 17 | modId = "forge" 18 | mandatory = true 19 | versionRange = "[${forge_version},)" 20 | ordering = "NONE" 21 | side = "BOTH" 22 | 23 | [[dependencies.examplemod]] 24 | modId = "minecraft" 25 | mandatory = true 26 | versionRange = "${minecraft_version}" 27 | ordering = "NONE" 28 | side = "BOTH" 29 | 30 | [[dependencies.examplemod]] 31 | modId="create" 32 | mandatory=true 33 | versionRange="${create_version}" 34 | ordering="NONE" 35 | side="BOTH" -------------------------------------------------------------------------------- /forge/src/main/resources/examplemod.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "net.examplemod.mixin.forge", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | ], 8 | "mixins": [ 9 | ], 10 | "injectors": { 11 | "defaultRequire": 1 12 | } 13 | } -------------------------------------------------------------------------------- /forge/src/main/resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fabricators-of-Create/create-multiloader-addon-template/0424e4f2e5c3f83a9a1f3b63caa5219f6bbda793/forge/src/main/resources/icon.png -------------------------------------------------------------------------------- /forge/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "Example Mod", 4 | "pack_format": 8 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs = -Xmx2G 2 | 3 | # Mod Info 4 | archives_base_name = examplemod 5 | mod_version = 0.1.0 6 | maven_group = net.examplemod 7 | 8 | minecraft_version = 1.20.1 9 | enabled_platforms = fabric,forge 10 | 11 | # Mappings 12 | # https://parchmentmc.org/docs/getting-started 13 | parchment_version = 2023.09.03 14 | 15 | # Fabric 16 | # https://fabricmc.net/develop/ 17 | fabric_loader_version = 0.16.9 18 | fabric_api_version = 0.92.0+1.20.1 19 | 20 | # Forge 21 | # https://files.minecraftforge.net/net/minecraftforge/forge/ 22 | forge_version = 47.1.43 23 | 24 | # Create - Fabric 25 | # https://modrinth.com/mod/create-fabric/versions 26 | create_fabric_version = 0.5.1-j-build.1631+mc1.20.1 27 | 28 | # Create - Forge 29 | # https://github.com/Creators-of-Create/Create/wiki/Depending-on-Create 30 | create_forge_version = 0.5.1.j-55 31 | registrate_forge_version = MC1.20-1.3.3 32 | flywheel_forge_minecraft_version = 1.20.1 33 | flywheel_forge_version = 0.6.11-13 34 | 35 | # Development QOL 36 | # Create Fabric supports all 3 recipe viewers: JEI, REI, and EMI. This decides which is enabled at runtime. 37 | # set to disabled to have none of them. 38 | fabric_recipe_viewer = unspecified 39 | # JEI - https://www.curseforge.com/minecraft/mc-mods/jei/files/all 40 | jei_version = 15.2.0.22 41 | # REI - https://modrinth.com/mod/rei/versions 42 | rei_version = 12.0.626 43 | # EMI - https://modrinth.com/mod/emi/versions 44 | emi_version = 1.1.18+1.20.1 45 | 46 | # Mod Menu - https://modrinth.com/mod/modmenu/versions 47 | modmenu_version = 7.1.0 48 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Fabricators-of-Create/create-multiloader-addon-template/0424e4f2e5c3f83a9a1f3b63caa5219f6bbda793/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url = "https://maven.fabricmc.net/" } 4 | maven { url = "https://maven.architectury.dev/" } 5 | maven { url = "https://maven.minecraftforge.net/" } 6 | gradlePluginPortal() 7 | } 8 | } 9 | 10 | include("common") 11 | include("fabric") 12 | include("forge") 13 | 14 | rootProject.name = "create-multiloader-addon-tempate" 15 | --------------------------------------------------------------------------------