Interface ModConstructor
- All Known Implementing Classes:
CoolCatCanvasConstructor,CoolCatCoreConstructor
public interface ModConstructor
A mod's common entry point, written once in common code and run the same way on every loader. It's constructed on
both sides (client and dedicated server).
Hooking it up:
- Fabric: list the class under the
"coolcatlib:common"entrypoint infabric.mod.json; no Fabric class is needed. - Forge: extend
ForgeModEntrypointin the@Modclass and callcommon(MyMod::new). - Anywhere else:
construct(String, Supplier)from the loader's own entry point.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconstruct(String modId, Supplier<? extends ModConstructor> factory) Constructs a mod's common entry point:onConstructMod()runs right away,onCommonSetup()once the loader is ready.default voidRuns once registries are filled, on the main thread (Forge's common setup; right after construction on Fabric).default voidRuns while mods are constructed: create andregister()deferred registers, register payloads, events, configs and reload listeners.
-
Method Details
-
construct
Constructs a mod's common entry point:onConstructMod()runs right away,onCommonSetup()once the loader is ready. Call it while mods are constructed. -
onConstructMod
default void onConstructMod()Runs while mods are constructed: create andregister()deferred registers, register payloads, events, configs and reload listeners. -
onCommonSetup
default void onCommonSetup()Runs once registries are filled, on the main thread (Forge's common setup; right after construction on Fabric).
-