Interface SettingsSaverRegistrar


public interface SettingsSaverRegistrar
Takes mods' settings registrations. Settings Saver passes one to SettingsSaverPlugin.register(SettingsSaverRegistrar), and SettingsSaverMods.register(ModSettings) forwards to the same one. Mods never implement this interface; Settings Saver does.

Implementations are thread-safe: registrations may come from any thread, at any time during the game.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers one mod's settings files, so profiles can save, load and sync them.
  • Method Details

    • register

      void register(ModSettings settings)
      Registers one mod's settings files, so profiles can save, load and sync them.

      A registration made before Minecraft reads its options takes part in the launch's restore: an instance without the file yet gets the profile's copy. A later registration starts syncing as soon as it is made, and still gets that restore if it happened during the same launch.

      This method never throws. Settings Saver logs a warning, ignores the whole registration and carries on without it when

      • settings is null;
      • a mod with the same mod id is already registered (the first one stays);
      • one of its files or directories is, contains, or lies inside a path that Settings Saver already syncs, either one of its own (such as options.txt) or one registered by another mod;
      • one of its paths is module.txt, the name the profile uses for its version record.
      A Minecraft fix naming a release Settings Saver doesn't know is skipped with a warning, and the rest of the registration is kept.
      Parameters:
      settings - the mod's settings, from ModSettings.builder(String, String, String)