-
Notifications
You must be signed in to change notification settings - Fork 47
Cardinal Components World
Pyrofab edited this page Aug 21, 2020
·
7 revisions
This module allows mods to attach components to World objects. World components can be automatically synchronized by implementing SyncedComponent, most commonly through the WorldSyncedComponent helper interface.
World components are registered by a WorldComponentInitializer, exposed as cardinal-components-world in the mod json (more information on the component registration page). Once a component factory is registered, its associated component will be available on every World instance, on both clients and servers.
World components can be automatically synchronized from the server to the client by implementing WorldSyncedComponent (legacy), or AutoSyncedComponent (V3) - more information is available on the component synchronization page.
+ No dependency required
+ Slightly easier to setup (no registration)
- Only exists on `ServerWorld` - cannot be synchronized, requires casting to use
- Must extend the `PersistentState` abstract class