Not rated yet

MultiLoader Template Mod

1854 views 17 downloadsJan 13, 2023 Jan 13, 2023

Creators and Publishers

Jaredlll08

Creator

mchoarder

Publisher

Additional Links

You may find some useful information by following these links

https://github.com/jaredlll08/MultiLoader-Template


Share this post



MultiLoader Template is a mod development template designed for targeting Minecraft Forge, QuiltMC, and FabricMC in one environment. It is a Gradle project containing four nested Gradle projects, each doing different tasks and used for building your jars. There are many different versions, both official and unofficial which do various things, such as Quilt Compat, Kotlin, Kotlin DSL, and others. Multiloader alone has no dependencies outside of a Java Development Kit and an IDE; however, it is easy to implement 3rd party dependencies if your mod needs them. MultiLoader is only recommended for those with more experience modding and independently working with Quilt, Fabric, and MC Forge.


MultiLoader is not a mod loader or a mod itself; however, it is a development environment that reduces the amount of code copied and pasted by having divisions in your code for different platforms. There are five environments you need to worry about:

  • Forge: For code specific to Minecraft Forge, based on ForgeGradle

  • Fabric: For code specific to FabricMC, Based on Fabric Loom

  • Quilt: For code specific to QuiltMC, Based on QuiltLoom

  • Common: For code that works on all 3 (This is where most of your code should     be), Based on VanillaGradle by SpongePowered

  • Main     (The main Gradle which runs all the others)


The reason there are version-specific folders is that some of the code is specific on different platforms, such as:

  • Calls to the Loader

  • Registries (MC Forge has their own and can’t use vanilla ones)

  • SpongeMixins

  • Reflection or working with Obfuscated or intermediary names

  • Anything else which may use specific API references


MultiLoader is commonly used by many mods and libraries, which makes it attractive to developers who want to make their mods work across platforms. Most developers will support its usage, though there are exceptions when the code based between APIs is much different. The template is officially supported on 1.17 and newer but can likely be down ported with some work. Fabric API and Quilt Standard Libraries should be automatically downloaded.


GeckoLib officially has a page explaining how to use  with  GeckoLib.


The template is officially developed by Jaredlll08 and DarkhaxDev (and others like Wixtin), who have since ported most of their mods. These mods include Bookshelf, AttributeFix, Controlling, Enchantment descriptions, Ingredient Extension API, Game Stages, Item Stages, Dark Utilities, Faux Custom Entity Data, Recipe Stages, Tip the Scales, ContentTweaker, CraftTweaker, ModTweaker, so much more. If you are extending any mod by Jared or DarkHax, you should use this template as they officially support it.


Most of Yung’s mods are built on Multiloader, which uses Yung’s API. If you use Yung’s API, you probably should use MultiLoader Template.


The template is also commonly used by lesser-known mods such as Vein Mining, Passive Chunk Pregenerator, Open Parties and Claims, Apple Crates, and others. It can also be good if you have a bunch of forge or fabric code and want to experiment and try to move to the other.


There is a chance this may work with Architectury API; however, they have their templates called Architectury Templates, which has since added a Multiloader style config and which gives you more config though you are more likely to get official support from ModLoader authors with Multiloader which wraps the official build kits. You can also use FeatureCreep if you want to target multiple Platforms.


There are some drawbacks, though, such as there can also be excess extra files and code from trying to split them rather than having them together, additionally, some things keep getting different in newer versions and can no longer be shared in the common folder. Prominent examples of this happened in 1.19.3 and 1.18.2, which saw massive changes, some of which required loader or API-specific requests. Organising it can be a nightmare compared to different projects, especially for more extensive mods. Though one advantage it has is if you share your code on git with the Gradle, you do not need as many branches, but it may be harder for people to read the code. Additionally, many common mods are just the Forge versions. There are many samples of how to organise your code and use the different templates like the Kotlin one, https://github.com/jaredlll08/MultiLoader-Template/blob/1.18.2/examples/MultiLoader-Template/build.gradle . MultiLoader may be a better option if you like to develop in Kotlin but do not want to deal with the issues with switching to Kotlin in the official ones and want Kotlin to Work out of the box. Please note that to run the Kotlin Versions of the mods, the template uses Kotlin for Forge and Fabric Language Kotlin, which the users will need to install.


Additionally, Jaredlll08 has voiced his not liking of Yarn Mappings and only officially supports MojMaps while Architectury Templates works with Yarn.


We have mentioned Quilt Compatibility here, and while it did exist in the 1.18 era as a beta, it was not ported to the newer versions officially; unofficial ports exist and are still maintained, however despite Jared and DarkHax’s optimism, they have yet to preserve the Quilt MultiLoader Template to 1.19.x or officially support their mods with Quilt; however, you should still be able to run your Fabric Mods with it if you do not do too complex of stuff. QuiltMC officially supports most Fabric Mods and plans to do this for the foreseeable future. As a development platform, QuiltMC is not yet developed to the point of good support and has been suffering from a poor adoption rate and is possibly in decline. Many authors are not checking their mods with Quilt compatibility, Only the 1.18 branch has official quilt support, and it is recommended you update the information with LambdAurora’s Quilt Import Utility . Though the changes to add Quilt can easily be applied to other versions. In general, though, we recommend sticking to traditional Fabric if you are going to be using MultiLoader as you want as much shared code as possible, and Quilt-exclusive features would need to be redone in the fabric versions anyhow. The suggested way to update MultiLoader for Quilt is to download the 1.18 Quilt Version and edit it for 1.19.x. You can do this for older non-Quilt versions also if you want to use Multiloader on 1.14-1.16.5.


We recommend using PortingLib with MultiLoader because PortingLib has ports of many Forge Specific features to Fabric/Quilt (and is a developer for both), meaning if you want to use any Forge specific Features, you can easily do it in the Fabric section of Multiloader.




Many unofficial forks of MultiLoader Template aim to fix some of the issues and add changes to themselves. With some Gradle knowledge, you should have the ability to change some stuff.


Some mods that use MultiLoader:



More Info

https://docs.google.com/spreadsheets/d/e/2PACX-1vTM5atBu__ZtyxN28HpaP07hgtW_7CVI3XUu_aLyVWSK09o1t1IalkRiua7NEXHuYMT5924AmUzHTge/pubhtml

Jared and DarkHax also did a lecture and FAQ called MultiLoader Madness on it at Modfest BlanketCon 2022,   other authors also lectured about using it such as WillBL and williewillus, a creator of Botania.