ApiPlugins

class ApiPlugins(tomlParser: TomlParser, apiProperties: ApiProperties, versionMeta: VersionMeta, utilities: Utilities) : JarPluginManager(source)

Manager for ServerPackCreator plugins. In itself it doesn't do much. It gathers lists of all available extensions for TabExtension,PreGenExtension,PreZipExtension and PostGenExtension so they can then be run during server pack generation and during initialization of the GUI.

Author

Griefed

Parameters

tomlParser

To read plugin-configurations, so they can be provided to extensions.

apiProperties

ServerPackCreator settings to be provided to extensions.

versionMeta

Version meta to be provided to extensions.

utilities

Utilities to be provided to extensions.

Constructors

Link copied to clipboard
constructor(tomlParser: TomlParser, apiProperties: ApiProperties, versionMeta: VersionMeta, utilities: Utilities)

Functions

Link copied to clipboard

Add any and all additional tabs to the ServerPackCreator tabbed pane (main GUI). You may use this to add tabs to your own JTabbedPane, if you so desire. Could be pretty awesome to have your plugins extra tabs in a separate window!

Link copied to clipboard
protected open override fun createExtensionFactory(): ExtensionFactory
Link copied to clipboard
protected open override fun createPluginFactory(): PluginFactory
Link copied to clipboard
fun <T> getAllExtensionsOfPlugin(plugin: PluginWrapper, type: Class<T>): List<T>

Get all extension of the specified type for the specified plugin.

Link copied to clipboard

Create config panels for the passed server pack configuration tab. Note that this method does NOT add the panels to the tab, it only creates them and passes the server pack config tab object-reference to each config panel, so they, in turn, may use any available fields and methods for their own operations. A given server pack config tab needs to add the panels which are returned by this method, so a user may make their configurations accordingly.

Link copied to clipboard
fun getPluginConfig(pluginId: String): Optional<CommentedConfig>

Get the global plugin configuration for an plugin of the passed ID. The configuration is wrapped in an Optional, because an plugin may not provide a global configuration. If you intend on using a global configuration for your plugin, make sure to check whether it is present before trying to use it!

Link copied to clipboard

Get the configuration-file for a plugin, if it exists. This is wrapped in an Optional, because not every plugin may provide a configuration-file to use globally for the relevant plugins settings. If you intend on using a global configuration, make sure to check whether the file is present, before moving on!

Link copied to clipboard
fun runConfigCheckExtensions(packConfig: PackConfig, configCheck: ConfigCheck = ConfigCheck()): ConfigCheck

Run any and all configuration-check extensions, using the passed configuration model and the destination at which the server pack is to be generated and stored at.

Link copied to clipboard
fun runPostGenExtensions(packConfig: PackConfig, destination: String)

Run any and all Post-server pack-generation extensions, using the passed configuration model and the destination at which the server pack is to be generated and stored at.

Link copied to clipboard
fun runPreGenExtensions(packConfig: PackConfig, destination: String)

Run any and all Pre-Server Pack-Generation extensions, using the passed configuration model and the destination at which the server pack is to be generated and stored at.

Link copied to clipboard
fun runPreZipExtensions(packConfig: PackConfig, destination: String)

Run any and all Pre-ZIP-archive creation extensions, using the passed configuration model and the destination at which the server pack is to be generated and stored at.