ApiProperties

@Plugin(name = "ServerPackCreatorConfigFactory", category = "Core")
class ApiProperties(propertiesFile: File = File("serverpackcreator.properties")) : ConfigurationFactory

Base settings of ServerPackCreator, such as working directories, default list of clientside-only mods, default list of directories to include in a server pack, script templates, java paths and much more.

Author

Griefed

Parameters

propertiesFile

serverpackcreator.properties-file containing settings and configurations to load the API with.

Constructors

Link copied to clipboard
constructor(propertiesFile: File = File("serverpackcreator.properties"))

Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class CustomXMLConfiguration(loggerContext: LoggerContext?, configSource: ConfigurationSource?) : XmlConfiguration

Custom XmlConfiguration to pass our custom log4j2.xml config to log4j.

Properties

Link copied to clipboard

Aikars Flags commonly used for Minecraft servers to improve performance in various places.

Link copied to clipboard
val alphaBetaRegex: <Error class: unknown class>
Link copied to clipboard

The version of the ServerPackCreator API.

Link copied to clipboard
var clientsideMods: <Error class: unknown class>

String-list of clientside-only mods to exclude from server packs.

Link copied to clipboard

Regex-list of clientside-only mods to exclude from server packs.

Link copied to clipboard

Directory in which ServerPackCreator configurations from the GUI get saved in by default.

Link copied to clipboard
Link copied to clipboard

The default Batch-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

Link copied to clipboard

Default configuration-file for a server pack generation inside ServerPackCreators home-directory.

Link copied to clipboard

The default Batch-template for the java-install scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use javaScriptTemplates.

Link copied to clipboard

The default PowerShell-template for the java-install scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use javaScriptTemplates.

Link copied to clipboard

The default shell-template for the java-install scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use javaScriptTemplates.

Link copied to clipboard

The default PowerShell-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

Link copied to clipboard

Default server-icon.png-file used by Minecraft servers. This file resides in the server_files-directory inside ServerPackCreators home-directory.

Link copied to clipboard

Default server.properties-file used by Minecraft servers. This file resides in the server_files-directory inside ServerPackCreators home-directory.

Link copied to clipboard

The default shell-template for the modded server start scripts. The file returned by this method does not represent the script-template in the server_files-directory. If you wish access the configured script templates inside the server_files-directory, use startScriptTemplates.

Link copied to clipboard
Link copied to clipboard
var directoriesToExclude: <Error class: unknown class>

Directories to exclude from a server pack.

Link copied to clipboard
var directoriesToInclude: <Error class: unknown class>

Directories to include in a server pack.

Link copied to clipboard

The filter method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack. Available settings are:

Link copied to clipboard

Fabric installer manifest containing information about available Fabric installers with which to install a server.

Link copied to clipboard

The Fabric intermediaries manifest containing all required information about Fabrics intermediaries. These intermediaries are used by Quilt, Fabric and LegacyFabric.

Link copied to clipboard

Fabric version manifest containing information about available Fabric loader versions.

Link copied to clipboard
Link copied to clipboard
val fallbackDirectoriesExclusion: <Error class: unknown class>
Link copied to clipboard
val fallbackDirectoriesInclusion: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
val fallbackPostInstallCleanupFiles: <Error class: unknown class>
Link copied to clipboard
val fallbackPreInstallCleanupFiles: <Error class: unknown class>
Link copied to clipboard

Whether the fallback lists for clientside-mods and whitelisted mods have been updated.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val fallbackZipExclusions: <Error class: unknown class>
Link copied to clipboard

Only the first call to this property will return true if this is the first time ServerPackCreator is being run on a given host. Any subsequent call will return false. Handle with care!

Link copied to clipboard

Forge version manifest containing information about available Forge loader versions.

Link copied to clipboard

URL to the HasteBin server where logs and configs are uploaded to.

Link copied to clipboard
val home: File

Default home-directory for ServerPackCreator. The directory containing the ServerPackCreator JAR.

Link copied to clipboard

ServerPackCreators home directory, in which all important files and folders are stored in.

Link copied to clipboard
val i18n4kConfig: I18n4kConfigDefault
Link copied to clipboard

Directory in which the icons for quick selection are to be stored in and retrieved from.

Link copied to clipboard

Caching directory for various types of installers. Mainly used by the version-meta for caching modloaders server installers, but also used as the ServerPackCreator installer cache-directory in certain scenarios.

Link copied to clipboard
Link copied to clipboard

Is auto excluding of clientside-only mods enabled.

Link copied to clipboard

Whether the search for available PreReleases is enabled or disabled. Depending on de.griefed.serverpackcreator.versioncheck.prerelease, returns true if checks for available PreReleases are enabled, false if no checks for available PreReleases should be made.

Link copied to clipboard

Whether to automatically update the SPC_JAVA_SPC-placeholder in the script variables table with a Java path matching the required Java version for the Minecraft server.

Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI.

Link copied to clipboard

Whether cleanup procedures after server pack generation are enabled.

Link copied to clipboard

Whether overwriting of already existing server packs is enabled.

Link copied to clipboard

Whether a server pack should be updated instead of cleanly generated.

Link copied to clipboard

Whether the exclusion of files from the ZIP-archive of the server pack is enabled.

Link copied to clipboard

Java installation used for installing the modloader server during server pack creation.

Link copied to clipboard

Paths to Java installations available to SPC for automatically updating the script variables of a given server pack configuration.

Link copied to clipboard

Start-script templates to use during server pack generation. Each key represents a different template and script-type.

Link copied to clipboard
Link copied to clipboard

Path to the PostgreSQL database used by the webservice-side of ServerPackCreator.

Link copied to clipboard
Link copied to clipboard

Language used by ServerPackCreator.

Link copied to clipboard

The LegacyFabric game version manifest containing information about which Minecraft version LegacyFabric is available for.

Link copied to clipboard

LegacyFabric installer manifest containing information about available LegacyFabric installers with which to install a server.

Link copied to clipboard

LegacyFabric loader manifest containing information about Fabric loader maven versions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Storage location for logs created by ServerPackCreator. This is the logs-directory inside ServerPackCreators home-directory.

Link copied to clipboard

Directory to which default/fallback manifests are copied to during the startup of ServerPackCreator.

Link copied to clipboard

Directory to which Minecraft server manifests are copied during the startup of ServerPackCreator.

Link copied to clipboard

Minecraft version manifest containing information about available Minecraft versions.

Link copied to clipboard

Modpacks directory in which uploaded modpack ZIP-archives and extracted modpacks are stored.

Link copied to clipboard
var modsWhitelist: <Error class: unknown class>

String-list of mods to include if present, regardless whether a match was found through clientsideMods.

Link copied to clipboard

Regex-list of mods to include if present, regardless whether a match was found throug clientsideModsRegex.

Link copied to clipboard

New NeoForge version manifest containing information about available NeoForge loader versions. This manifest contains versions for Minecraft 1.20.2 and up.

Link copied to clipboard

Old NeoForge version manifest containing information about available NeoForge loader versions. This manifest only contains versions for Minecraft 1.20.1.

Link copied to clipboard

Overrides which, well, override, any property which may be set in the regular serverPackCreatorPropertiesFile.

Link copied to clipboard

Directory in which plugin-specific configurations are stored in.

Link copied to clipboard

Directory in which plugins for ServerPackCreator are to be placed in.

Link copied to clipboard
var postInstallCleanupFiles: <Error class: unknown class>

List of files to delete after a server pack server installation.

Link copied to clipboard
var preInstallCleanupFiles: <Error class: unknown class>

List of files to delete before a server pack server installation.

Link copied to clipboard
Link copied to clipboard

Directory in which the properties for quick selection are to be stored in and retrieved from.

Link copied to clipboard

Quilt installer manifest containing information about available Quilt installers with which to install a server.

Link copied to clipboard

Quilt version manifest containing information about available Quilt loader versions.

Link copied to clipboard
Link copied to clipboard

Directory in which default server-files are stored in.

Link copied to clipboard

The serverpackcreator.properties-file which both resulted from starting ServerPackCreator and provided the settings, properties and configurations for the currently running instance.

Link copied to clipboard

Directory in which generated server packs, or server packs being generated, are stored in, as well as their ZIP-archives, if created.

Link copied to clipboard
val serverPacksRegex: <Error class: unknown class>
Link copied to clipboard

Start-script templates to use during server pack generation. Each key represents a different template and script-type.

Link copied to clipboard
protected val substitutor: StrSubstitutor
Link copied to clipboard

Modloaders supported by ServerPackCreator.

Link copied to clipboard

Temp-directory storing files and folders required temporarily during the run of a server pack generation or other operations.

Link copied to clipboard

Base-directory for Tomcat, used by the webservice-side of ServerPackCreator.

Link copied to clipboard

Logs-directory for Tomcat, used by the webservice-side of ServerPackCreator.

Link copied to clipboard
val trueFalseRegex: <Error class: unknown class>
Link copied to clipboard

The URL from which a .properties-file is read during updating of the fallback clientside-mods list. The default can be found in fallbackUpdateURL.

Link copied to clipboard

Work-directory for storing temporary, non-critical, files and directories.

Link copied to clipboard
var zipArchiveExclusions: <Error class: unknown class>

List of files to be excluded from ZIP-archives. Current filters are:

Functions

Link copied to clipboard
fun acquireJavaPath(pathToJava: String? = null): String

Check the given path to a Java installation for validity and return it, if it is valid. If the passed path is a UNIX symlink or Windows lnk, it is resolved, then returned. If the passed path is considered invalid, the system default is acquired and returned.

Link copied to clipboard
fun changeLocale(locale: Locale)

Writes the specified locale from -lang your_locale to a lang.properties file to ensure every subsequent start of serverpackcreator is executed using said locale.

Link copied to clipboard
Link copied to clipboard
fun clientSideMods(): <Error class: unknown class>

Acquire the default fallback list of clientside-only mods. If de.griefed.serverpackcreator.serverpack.autodiscovery.filter is set to ExclusionFilter.REGEX, a regex fallback list is returned.

Link copied to clipboard

Default map of start-script templates: sh, ps1, bat.

Link copied to clipboard

Default list of script templates used by ServerPackCreator.

Link copied to clipboard

Default map of start-script templates: sh, ps1, bat.

Link copied to clipboard
open override fun getConfiguration(loggerContext: LoggerContext, source: ConfigurationSource): Configuration

Depending on whether this is the first run of ServerPackCreator on a users machine, the default log4j2 configuration may be present at different locations. The default one is the config inside the home-directory of SPC, of which we will try to set up our logging with. If said file fails for whatever reason, we will try to use a config inside the directory from which SPC was executed. Should that fail, too, the config from the classpath is used, to ensure we always have default configs available. Should that fail, too, though, log4j is set up with its own default settings.

open fun getConfiguration(loggerContext: LoggerContext, name: String, configLocation: URI): Configuration
open fun getConfiguration(loggerContext: LoggerContext, name: String, configLocation: URI, loader: ClassLoader): Configuration
Link copied to clipboard
protected open fun getDefaultPrefix(): String
Link copied to clipboard
protected open fun getInputFromString(config: String, loader: ClassLoader): ConfigurationSource
Link copied to clipboard

The .exe or JAR-file of ServerPackCreator.

Link copied to clipboard

The folder containing the ServerPackCreator.exe or JAR-file.

Link copied to clipboard

The name of the .exe or JAR-file.

Link copied to clipboard

The Java version used to run ServerPackCreator.

Link copied to clipboard

Architecture of the operating system on which ServerPackCreator is running on.

Link copied to clipboard

The name of the operating system on which ServerPackCreator is running on.

Link copied to clipboard

The version of the OS on which ServerPackCreator is running on.

Link copied to clipboard
Link copied to clipboard
protected open override fun getSupportedTypes(): Array<String>
Link copied to clipboard
protected open fun getTestPrefix(): String
Link copied to clipboard
protected open fun getVersion(): String
Link copied to clipboard
protected open fun isActive(): Boolean
Link copied to clipboard
fun isExe(): Boolean

Whether a .exe or JAR-file was used for running ServerPackCreator.

Link copied to clipboard

Whether a viable path to a Java executable or binary has been configured for ServerPackCreator.

Link copied to clipboard
fun javaPath(javaVersion: Int): Optional<String>
fun javaPath(javaVersion: String): <Error class: unknown class>

Get the path to the specified Java executable/binary, wrapped in an Optional for your convenience.

Link copied to clipboard
fun loadOverrides(properties: File = overridesPropertiesFile)
Link copied to clipboard
fun loadProperties(saveProps: Boolean = true)

Load properties using the default file path. Only call this method on an already initialized ApiProperties-object.

fun loadProperties(propertiesFile: File = File(serverPackCreatorProperties).absoluteFile, saveProps: Boolean = true)

Reload from a specific properties-file.

Link copied to clipboard

Get the old version of ServerPackCreator used to perform necessary migrations between the old and the current version.

Link copied to clipboard
Link copied to clipboard

Retrieve a custom property in the serverpackcreator.properties-file. Beware that every property you retrieve this way contains a prefix, to prevent clashes with any other properties.

Link copied to clipboard
fun saveProperties(propertiesFile: File)

Store the ApplicationProperties to disk, overwriting the existing one.

Link copied to clipboard
fun setOldVersion(version: String)

Set the old version of ServerPackCreator used to perform necessary migrations between the old and the current version.

Link copied to clipboard
fun storeCustomProperty(property: String, value: String): String

Store a custom property in the serverpackcreator.properties-file. Beware that every property you add receives a prefix, to prevent clashes with any other properties.

Link copied to clipboard
fun storePreference(pref: String, value: String)
Link copied to clipboard

Update the fallback clientside-only mod-list of our serverpackcreator.properties from the main-repository or one of its mirrors.

Link copied to clipboard
fun whitelistedMods(): <Error class: unknown class>

Acquire the default fallback list of whitelisted mods. If de.griefed.serverpackcreator.serverpack.autodiscovery.filter is set to ExclusionFilter.REGEX, a regex fallback list is returned.