|
Quilt Loader 1
|
Object share for inter-mod communication, obtainable through FabricLoader#getObjectShare.
More...
Object share for inter-mod communication, obtainable through FabricLoader#getObjectShare.
The share allows mods to exchange data without directly referencing each other. This makes simple interaction easier by eliminating any compile- or run-time dependencies if the shared value type is independent of the mod (only Java/game/Fabric types like collections, primitives, String, Consumer, Function, ...).
Active interaction is possible as well since the shared values can be arbitrary Java objects. For example exposing a Runnable or Function allows the "API" user to directly invoke some program logic.
It is required to prefix the share key with the mod id like mymod:someProperty. Mods should not modify entries by other mods. The share is thread safe.