ThatOrThis
A Fabric mod for choosing between sets of Fabric mods.
What is this
ThatOrThis is designed mainly for modpack developers. It hacks into Fabric Loader to allow loading mods from additional user-selectable directories. This allows the end user to choose which mod(s) to load into their modpack, or workaround incompatible mod sets.
Technically speaking, ThatOrThis take its inspiration from Modsmod and GrossFabricHacks, which abuses the LanguageAdapter feature of the Fabric Loader. This allows part of this mod's code to run even before Fabric Loader starts to initialize most other mods. It then read configs, resolve for additional mods to load, and inject them into the loader via Java reflection wizardry.
Features
- Load mods from directories other than the default
.minecraft/mods - Let the end user to choose which feature(s) they want (e.g. OptiFabric for shaders or Sodium for optimization)
- Runtime check for dependencies and conflicts of additional mods
- Configurable settings screen accessible via ModMenu integration
- Option names and tooltips support formatting codes and translation keys
Usage
For ordinary users (who installed this mod manually)
Install this mod into your mods folder, along with ModMenu and Fabric API.
Launch Minecraft and open the settings screen via ModMenu. Follow the instructions.
ThatOrThis will be running under the default (limited) rule set if configured this way. If you need features more than toggling individual mods, please refer to the "modpack developers" section.
For modpack users (who downloaded a modpack containing this mod)
Open the settings screen via ModMenu. Change the settings as you desire. Done.
Note that the new settings won't come into effect until you re-launch the game.
For modpack developers (who wish to integrate this mod into a modpack)
Install this mod into your mods folder, along with ModMenu and Fabric API.
Then, create thatorthis folder in your config folder, and file rules.json in that. If done correctly, the path for it should be .minecraft/config/thatorthis/rules.json.
rules.json defines all the available settings and their options. Specs for it can be found here.
Finally, put the mods into subdirectories of the mods folder, as defined in the rule file.
This mod is open-sourced and MIT licensed, meaning that you can include it into your modpack and redistribute it without asking for permission, as long as you credit me (and of course the authors of all other mods) in your modpack.
Compatibility
- ThatOrThis requires a recent version of Minecraft
and Fabric Loaderto work.- Forge support is never planned; use ModDirector instead.
- Currently only Fabric Loader v0.11.x is supported. Support for v0.12.x will come with ThatOrThis v0.3.0.
- ModMenu and Fabric API are optional, meaning that ThatOrThis will work correctly without them given valid
rules.jsonandchoices.json.- However they are required for the in-game settings screen. You can load them via ThatOrThis, but it is not recommended.
- Loading programming language support mods (e.g. for Kotlin, Scala and Grovvy) via ThatOrThis is not recommended.
- They might work, but this feature has not been tested; place them right into the mods directory whenever possible.
- Modsmod does the exact same thing as ThatOrThis to the Fabric Loader, thus incompatible with each other.
NOTE: ThatOrThis is only intended for small, client-side mods. It may cause crashes and/or server/world incompatibilities if rules and options are not designed carefully. Test your modpack throughly before and after installing this mod.
How to Install ThatOrThis (Mod)
ThatOrThis by EZForever is verified for Fabric across Minecraft versions 1.16.5, 1.17, 1.17.1 (latest release: 0.2.6+1.16, file size: 79 KB). Follow the steps below to install it safely from ModCraft.tv:
- Click the Download button above and select your Minecraft version (1.16.5, 1.17, 1.17.1) and platform (Fabric).
- Make sure you have the compatible loader or environment installed for Fabric.
- Move the downloaded ThatOrThis file into your Minecraft
.minecraft/modsfolder and launch the game.
Full changelog:
- Fix crash when loading nested jar mods in a development environment
- Properly warn user about Fabric Loader v0.12.x incompatibility
- Support will be added in the next update (hopefully v0.3.0)
Tested with Minecraft 1.16.5 + Fabric Loader 0.11.7 + ModMenu 1.16.22, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
Full changelog:
- Fix crash when loading nested jar mods in a development environment
- Properly warn user about Fabric Loader v0.12.x incompatibility
- Support will be added in the next update (hopefully v0.3.0)
Tested with Minecraft 1.17.1 + Fabric Loader 0.11.7 + ModMenu 2.0.14, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
Full changelog:
- Fix tooltip persisting after sudden focus change (#14)
- Fix tooltip showing on buttons covered by the margin of the list
- Log additional mods and directories in separate lines like the Fabric Loader
Tested with Minecraft 1.16.5 + Fabric Loader 0.11.6 + ModMenu 1.16.10, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
Full changelog:
- Minecraft 1.17.1 support
- Fix tooltip persisting after sudden focus change (#14)
- Fix tooltip showing on buttons covered by the margin of the list
- Log additional mods and directories in separate lines like the Fabric Loader
Tested with Minecraft 1.17.1 + Fabric Loader 0.11.6 + ModMenu 2.0.3, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
GENERATED rules.Full changelog:
- Added Russian translation for ThatOrThis GUI (thanks to @Felix14-v2)
- Added optional
customNamefield toGENERATEDrules for customizing the mapping from mod IDs to names. Refer to [config specs][rules_example_json5] for details.
Tested with Minecraft 1.16.5 + Fabric Loader 0.11.3 + ModMenu 1.16.9, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
[rules_example_json5]: https://github.com/EZForever/ThatOrThis/blob/master/rules.example.json5
GENERATED rules.Full changelog:
- Added Russian translation for ThatOrThis GUI (thanks to @Felix14-v2)
- Added optional
customNamefield toGENERATEDrules for customizing the mapping from mod IDs to names. Refer to [config specs][rules_example_json5] for details.
Tested with Minecraft 1.17 + Fabric Loader 0.11.3 + ModMenu 2.0.2, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
[rules_example_json5]: https://github.com/EZForever/ThatOrThis/blob/master/rules.example.json5
Tested with Minecraft 1.16.5 + Fabric Loader 0.11.3 + ModMenu 1.16.9, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
Tested with Minecraft 1.17 + Fabric Loader 0.11.3 + ModMenu 2.0.0-beta.7, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
LanguageAdapter mods.Full changelog:
- Mods skipped by ThatOrThis (via
GENERATEDswitches or disabled screens) are logged intodebug.logfor easlier debugging. - ModMenu integration: *right click* on ModMenu's button now brings up ThatOrThis' settings screen.
- A tooltip is also added to ModMenu's button as a usage hint.
- If config files are not correctly loaded when launching the game, this shortcut will force a config reload until valid configs are read. This is useful for designing rules and options.
LanguageAdaptermods (programming language support mods, GrossFabricHacks, etc.) can now be loaded via ThatOrThis. ThatOrThis will issue warnings and try to "fix" their functionality, but without guarantee.- As a result, the GrossFabricHacks warning has been removed.
Tested with Minecraft 1.16.5 + Fabric Loader 0.11.1 + ModMenu 1.16.8, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
The "lock" button is enabled on
GENERATED screens (so you can disable all mods at once instead of hitting each mod's switch), and can be enabled on NESTED screens if "canDisable": true is set on the rule in the config file.Tested with Minecraft 1.16.5 + Fabric Loader 0.11.1 + ModMenu 1.16.8, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
- NOTE: v0.2.0 introduces breaking changes regarding config file schemas; see [migration guide][migration-guide] for details.**
This update adds more types of rules, supporting toggling of individual rules and nested settings screens. Refer to [config specs][rules_example_json5] for details. ThatOrThis is also made usable to ordinary users via a default rule set.
Full changelog:
- Rules (and choices) now has types:
DEFINEDis the "classic" type, choose between *defined* sets of directoriesGENERATED*generates* a settings screen for individual modsNESTEDallows rules to be placed on a *nested* settings screenDISABLEDfor showing textual hintsNULLas spacers- A default rule set will be used if
rules.jsonis not present - This rule set allows toggling mods in
thatorthisdirectory, with usage hints on the settings screen - Mod description is now translated
Tested with Minecraft 1.16.5 + Fabric Loader 0.11.1 + ModMenu 1.16.8, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.
[migration-guide]: https://github.com/EZForever/ThatOrThis/releases/tag/v0.2.0#user-content-v0.2.0-migration-guide
[rules_example_json5]: https://github.com/EZForever/ThatOrThis/blob/master/rules.example.json5
Tested with Minecraft 1.16.5 (*Both client-side and server-side*) + Fabric Loader 0.11.1 + ModMenu 1.16.8, should work on slightly older versions.
Remember, this mod is a HUGE HACK that can wreak havoc with your modpack; use with care.