Class ExtensionConfigPanel

  • All Implemented Interfaces:
    java.awt.MenuContainer , java.awt.image.ImageObserver , java.io.Serializable , javax.accessibility.Accessible , javax.swing.TransferHandler.HasGetTransferHandler

    
    public abstract class ExtensionConfigPanel
    extends JPanel
                        

    Template ConfigPanel for use in {@link ConfigPanelExtension} extensions.

    Author:

    Griefed

    • Constructor Detail

      • ExtensionConfigPanel

        ExtensionConfigPanel(VersionMeta versionMeta, ApiProperties apiProperties, Utilities utilities, ServerPackConfigTab serverPackConfigTab, Optional<CommentedConfig> pluginConfig, String extensionName, String pluginID)
        Parameters:
        versionMeta - Instance of VersionMeta so you can work with available Minecraft, Forge, Fabric, LegacyFabric and Quilt versions.
        apiProperties - Instance of Properties The current configuration of ServerPackCreator, like the default list of clientside-only mods, the server pack directory etc.
        utilities - Instance of Utilities commonly used across ServerPackCreator.
        serverPackConfigTab - Instance of ServerPackConfigTab to give you access to the various fields inside it, like the modpack directory, selected Minecraft, modloader and modloader versions, etc.
        pluginConfig - Plugin specific configuration conveniently provided by ServerPackCreator.
        extensionName - The name the titled border of this ConfigPanel will get.
        pluginID - The ID of the plugin providing this extension implementation.
    • Method Detail

      • getLog

         final KotlinLogger getLog()
      • getServerPackExtensionConfig

         final ArrayList<CommentedConfig> getServerPackExtensionConfig()

        The panel's current configuration, which SPC stores under the plugin's id in the pack config.

      • serverPackExtensionConfig

         abstract ArrayList<CommentedConfig> serverPackExtensionConfig()

        Retrieve this extensions' server pack specific configuration. When no configuration with configs for this extension has been loaded yet, the returned list is empty. Fill it with life!

        Returns:

        Config list to be used in subsequent server pack generation runs, by various other extensions.

      • setServerPackExtensionConfig

         abstract Unit setServerPackExtensionConfig(ArrayList<CommentedConfig> serverPackExtensionConfig)

        Pass the extension configuration to the configuration panel, so it can then, in turn, load the available configurations and make them editable, if so desired.

        Parameters:
        serverPackExtensionConfig - The list of extension configurations to pass to the configuration panel.
      • clear

         abstract Unit clear()

        Clear the interface, or in other words, reset this extensions config panel UI. If your Config Panel Extensions has no elements you wish to reset, then simply overwrite this method with an empty method body.

        The clear()-method is called when the owning TabCreateServerPack.clearInterface()-method is called.