Package net.neoforged.neoforge.network
Class ConfigSync
java.lang.Object
net.neoforged.neoforge.network.ConfigSync
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
receiveSyncedConfig
(byte[] contents, String fileName) static void
Registers a listener forModConfigEvent.Reloading
for all mod busses, that will sync changes to server configs to connected clients.static void
syncAllConfigs
(net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener listener) static void
syncPendingConfigs
(net.minecraft.server.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
SyncConfig
configuration 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
public static void syncAllConfigs(net.minecraft.network.protocol.configuration.ServerConfigurationPacketListener listener) -
registerEventListeners
public static void registerEventListeners()Registers a listener forModConfigEvent.Reloading
for all mod busses, that will sync changes to server configs to connected clients. -
syncPendingConfigs
public static void syncPendingConfigs(net.minecraft.server.MinecraftServer server) -
receiveSyncedConfig
-