Class ConfigurationManager

java.lang.Object
dev.despical.pixelpainter.config.ConfigurationManager

public final class ConfigurationManager extends Object
Creates bundled configuration files and publishes validated resource snapshots.

A reload first reads settings, messages and the block palette into local candidates. Active references change only after all candidates are valid, so a malformed resource cannot leave the plugin partly reconfigured.

Call this manager on the server thread: palette validation resolves Bukkit block data. Existing image preparations and painting jobs keep the settings and colors they captured before a later reload.

  • Constructor Details

    • ConfigurationManager

      public ConfigurationManager(org.bukkit.plugin.java.JavaPlugin plugin)
      Creates a manager without writing files or loading configuration.
      Parameters:
      plugin - owner of the bundled resources and data directory
  • Method Details

    • initialize

      public void initialize() throws Exception
      Copies missing bundled resources and loads the first validated snapshot.
      Throws:
      Exception - if resource creation or validation fails
    • reload

      public void reload() throws Exception
      Loads all candidates before replacing the active configuration references.
      Throws:
      Exception - if any resource cannot be read or validated
    • settings

      public Settings settings()
      Returns the current operational limits and presentation settings.
      Returns:
      validated settings after initialization
    • messages

      public Messages messages()
      Returns the current message templates.
      Returns:
      validated messages after initialization
    • palette

      public BlockPalette palette()
      Returns the current server-resolved block palette.
      Returns:
      validated palette after initialization