Loading & Rebuilding
SlimeCore completely overhauls the way datapacks are loaded.
As stated in Pack Manifests:
Packs MUST NOT add to the function tags
#minecraft:loador#minecraft:tickInstead, packs MUST include a manifest that declares information on how to load them.
The /datapack enable and /datapack disable commands SHOULD NOT be used under any circumstance. Safe pack disabling/enabling/uninstalling is provided through explicit rebuilding.
Loading
Loading always occurs upon world reload (/reload), and refers to the following sequence:
- Call all preload entrypoints.
- Call all load tags.
- Call all entrypoints.
Call order in each step is determined by the world's current build.
Rebuilding
Rebuilding is the process of re-evaluating the world's current build given the currently installed/enabled/disabled packs. More specifically, it refers to the following sequence:
- Gather all pack manifests of all installed packs (including disabled).
- Verify that all packs have a known datapack path.
- Evaluate a build with pack manifests of enabled packs:
- Verify that pack manifests are individually valid.
- Verify that there are no duplicate packs IDs.
- Verify that no abstract interfaces are implemented more than once.
- Verify that all dependencies are fulfilled.
- Verify that all abstract interfaces are implemented.
- Verify that there are no dependency cycles.
- Verify that there exists possible entrypoint and preload entrypoint orderings that fulfills all restrictions.
- Create a valid call order of preload entrypoints, load tags, and entrypoints.
- If any packs are being disabled/uninstalled, uninstall/disable packs in reverse load order.
- Set the world's current build to the evaluated build.
- Trigger a load.
If any step in the rebuild process fails, the world's previous build remains applied.
By default, rebuilding occurs upon world reload (/reload) iff any changes to installed pack manifests are detected (including additions/removals).
Rebuilding can be explicitly triggered.
Explicitly Rebuilding
Calling the developer function slimecore:rebuild triggers an explicit rebuild. Explicit rebuilds allows for safe and tracked disabling/enabling/uninstalling of packs. Information on slimecore:rebuild's usage can be found in it's respective function mcdoc file within the SlimeCore datapack.
Debugging and Development
SlimeCore alone does not provide any logging or feedback when loading or rebuilding, but it does provide hooks for these purposes, which any datapack can implement debug/logging subscribers.
A basic (unofficial) debugging/devtool datapack can be found here.