PreloadManager
Lightweight preload patcher utility
Screenshots 5 screenshots
About this mod Author’s original text
Preload Manager
Lightweight preload patcher utility
_IMPORTANT_: If used incorrectly you can really break plugins, I am not responsible for you breaking something in your pack. This should really only be used by modpack creators and mod developers who want an easy way to disable a plugin if it exists.
Why this exists
I had a request for my other plugins to remove LethalConfig as a dependency package to support a single use case.
Both other plugins have LethalConfig as a soft dependency so it can be removed if wanted, however, there is one use case where manually uninstalling it doesn't help.
That use case is when a modpack creator publishes a modpack with LethalConfig removed, when that modpack is installed via a mod manager, all dependencies are also downloaded even when not listed in the modpack.
This means a modpack creator who wants a specific experience, with a dependency removed, doesn't have a way to do that other than sharing a profile code.
Now obviously the best way to fix this is to have implement some way to ignore a specific dependency in the modpack config, but that doesn't exist right now from what I understand.
So I decided to write a small preload patching utility which lets anyone disable a plugin from loading if they want to.
Features
- Disables the awake method in plugins that are configured in the config file
- Easy usage by other mod developers who don't want to learn how to do this themselves
- Feel free to fork it if you want to use this as a base for your own preload patcher (GitHub link can be found in the link at the top right)
- Pattern protection so no one can just use wildcards to disable all mods
- Ability to add a json file with plugin names if desired
- See guide below
Potential Future Features
- Allow a mod developer to...
- Load their own methods at preload
- Run their own methods for every plugin load event
- I'll probably think of more later
Compatibility
This should be compatible with any mod, however, if you are trying to disable a mod which has its own preload patcher - you likely will have a bad time...
JSON Information
To make things easier I have created an extremely fast and efficient parallel recursive file search for any files named exactly.json in the Config or Plugin folder.
Using an exact file name ensures that it doesn't attempt to read just any json file, it will also ensure the least amount of required processing.
This also means anyone can make this mod a dependency for their mod and just add a single json file in their mods zip file to disable some other mod (or mods) for what ever reason.
JSON format
The format is very simple and is just a single string array you can learn more Here
[
"ModName",
"SomeOtherModName",
"AnotherOne"
]
Configuration
The config file is named.PreloadManager.cfg and will be located in the normal Config directory (also accessible via the mod manager config tab)
Disable Preloader
Want to disable this preloader entirely? Set this to true and it will just harmlessly return when initialized.
This will disable this preloader entirely
Setting type: Boolean
Default value: false
Disable Preloader = false
Disable Json Search
This will disable the parallel recursive file search for any files named exactly.json in the Config or Plugin folder. I use a very fast and performant method which searches even a modpack with 200+ mods extremely fast and efficiently (average time between 0.10 and 0.20 seconds).
Disable searching for any 'PreloadManager.json' files in the config and plugin directories
Setting type: Boolean
Default value: false
Disable Json Search = false
Mod List
This is where a modpack creator can list the mod names to disable, or path to a specific json file using the built in internal location/path variables (This can be used with 'Disable Json Search' if you don't want the file search but still want to use a json file). If this config item is empty (default) then this prel
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: