-
Notifications
You must be signed in to change notification settings - Fork 0
Synchronization and Network Protocol
The framework dictates state synchronization through defined operational scopes and authoritative network boundaries.
Properties assigned the LEVEL or GLOBAL operational scope submit to authoritative server state control. The local disk serialization acts exclusively as a client-side cache or server-side baseline. Properties assigned CLIENT or scopes reject network synchronization attempts and maintain local authority.
Network data transmission necessitates serialization to the NBT format. The framework executes this conversion via the Codec<T> instance bound to the property during the builder sequence.
-
encodeValueToNbt(): Translates the active memory state into an NBT payload for outbound transmission. -
decodeValueFromNbt(Tag tag): Parses inbound NBT payloads and mutates the active memory state to match.
Properties implement explicit execution pipelines to handle varying synchronization vectors.
-
acceptAuthoritativeUpdate(Tag tag): Forces a localized state override originating from a server command or authorized operator modification. -
onSync(T serverValue): Applies a deserialized network state sequence transmitted by the authoritative server to the local runtime value and sets internal synchronization flags. -
onDisconnect(): Executes local state teardown upon severing connection with the authoritative server, purging network-assigned runtime values and dropping dynamic instances.