Package net.neoforged.neoforge.network
Class ConfigSync
java.lang.Object
net.neoforged.neoforge.network.ConfigSync
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Map<Connection, Map<String, byte[]>> Connection -> Config file name -> byte[] of the config serialized to TOML.private static final Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidreceiveSyncedConfig(byte[] contents, String fileName) static voidRegisters a listener forModConfigEvent.Reloadingfor all mod busses, that will sync changes to server configs to connected clients.static voidstatic voidsyncPendingConfigs(MinecraftServer server)
-
Field Details
-
lock
-
configsToSync
Connection -> Config file name -> byte[] of the config serialized to TOML.Pending config updates get sent to players in the PLAY phase only, but start being tracked as soon as the
SyncConfigconfiguration task runs. This ensures that all updates during the configuration phase will eventually arrive to the clients.Connections get removed when GC'ed thanks to the WeakHashMap.
-
-
Constructor Details
-
ConfigSync
private ConfigSync()
-
-
Method Details
-
syncAllConfigs
-
registerEventListeners
public static void registerEventListeners()Registers a listener forModConfigEvent.Reloadingfor all mod busses, that will sync changes to server configs to connected clients. -
syncPendingConfigs
-
receiveSyncedConfig
-