Class GenerationConfig
-
- All Implemented Interfaces:
public final class GenerationConfigSettings-group for server pack generation: clientside-mod lists and their whitelist, directory in- and exclusions, pre- and post-install cleanup-files, ZIP-archive exclusions, the clientside-mod exclusion-filter, generation-flags and Aikar's flags. Extracted from ApiProperties (refactor Phase 1b); ApiProperties remains the facade through which consumers access these values.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GenerationConfig(PropertyStore store)
-
Method Summary
Modifier and Type Method Description final TreeSet<String>getFallbackDirectoriesInclusion()Shipped default for what a new configuration copies out of a modpack. final TreeSet<String>getFallbackDirectoriesExclusion()Shipped default for directories never copied, even when an inclusion would otherwise match them. final TreeSet<String>getFallbackZipExclusions()Shipped default for what is left out of the ZIP — chiefly the files a user must supply themselves. final TreeSet<String>getFallbackPostInstallCleanupFiles()Files deleted after the loader installer has run — its leftovers, which no server needs. final TreeSet<String>getFallbackPreInstallCleanupFiles()Files deleted before the installer runs, so a stale artifact cannot be mistaken for a fresh install. final StringgetFallbackAikarsFlags()Aikar's recommended JVM flags, offered as one click in the GUI rather than typed out by a user. final ExclusionFiltergetFallbackExclusionFilter()Fallback exclusion-filter for clientside-only mod matching. final BooleangetFallbackOverwriteEnabled()Fallback-value for overwriting already existing server packs. final BooleangetFallbackZipFileExclusionEnabled()Fallback-value for the exclusion of files from ZIP-archives. final BooleangetFallbackServerPackCleanupEnabled()Fallback-value for cleanup-procedures after server pack generation. final BooleangetFallbackMinecraftPreReleasesAvailabilityEnabled()Fallback-value for the availability of Minecraft pre-releases and snapshots. final BooleangetFallbackAutoExcludingModsEnabled()Fallback-value for the automatic exclusion of clientside-only mods. final BooleangetFallbackUpdateServerPack()Fallback-value for updating existing server packs instead of clean generation. final TreeSet<String>getFallbackUpdateProtectedPaths()Shipped default for what an update must leave alone: everything a running Minecraft server writes into the directory it was started from, plus the two files an operator tunes by hand. final TreeSet<String>getClientsideMods()String-list of clientside-only mods to exclude from server packs. final TreeSet<String>getModsWhitelist()String-list of mods to include if present, regardless whether a match was found through clientsideMods. final TreeSet<String>getClientsideModsRegex()Regex-list of clientside-only mods to exclude from server packs, derived from clientsideMods by wrapping every entry in start-and-anything regex-markers. final TreeSet<String>getModsWhitelistRegex()Regex-list of mods to include if present, derived from modsWhitelist by wrapping every entry in start-and-anything regex-markers. final TreeSet<String>getDirectoriesToInclude()Directories to include in a server pack; store-entries merge with the fallback-defaults. final UnitsetDirectoriesToInclude(TreeSet<String> value)Directories to include in a server pack; store-entries merge with the fallback-defaults. final TreeSet<String>getDirectoriesToExclude()Directories to exclude from a server pack; directories present in directoriesToInclude always win and are removed from this set. final UnitsetDirectoriesToExclude(TreeSet<String> value)Directories to exclude from a server pack; directories present in directoriesToInclude always win and are removed from this set. final TreeSet<String>getPostInstallCleanupFiles()Files to delete after a modloader-server installation; store-entries merge with the fallback-defaults. final UnitsetPostInstallCleanupFiles(TreeSet<String> value)Files to delete after a modloader-server installation; store-entries merge with the fallback-defaults. final TreeSet<String>getPreInstallCleanupFiles()Files to delete before a modloader-server installation; store-entries merge with the fallback-defaults. final UnitsetPreInstallCleanupFiles(TreeSet<String> value)Files to delete before a modloader-server installation; store-entries merge with the fallback-defaults. final TreeSet<String>getZipArchiveExclusions()Files to exclude from server pack ZIP-archives; store-entries merge with the fallback-defaults. final UnitsetZipArchiveExclusions(TreeSet<String> value)Files to exclude from server pack ZIP-archives; store-entries merge with the fallback-defaults. final ExclusionFiltergetExclusionFilter()The filter-method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack; invalid or missing values default to ExclusionFilter.START. final UnitsetExclusionFilter(ExclusionFilter value)The filter-method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack; invalid or missing values default to ExclusionFilter.START. final BooleanisZipFileExclusionEnabled()Whether the exclusion of files from the ZIP-archive of the server pack is enabled. final UnitsetZipFileExclusionEnabled(Boolean value)Whether the exclusion of files from the ZIP-archive of the server pack is enabled. final BooleanisAutoExcludingModsEnabled()Whether auto-excluding of clientside-only mods is enabled. final UnitsetAutoExcludingModsEnabled(Boolean value)Whether auto-excluding of clientside-only mods is enabled. final BooleanisServerPacksOverwriteEnabled()Whether overwriting of already existing server packs is enabled. final UnitsetServerPacksOverwriteEnabled(Boolean value)Whether overwriting of already existing server packs is enabled. final BooleanisServerPackCleanupEnabled()Whether cleanup-procedures after server pack generation are enabled. final UnitsetServerPackCleanupEnabled(Boolean value)Whether cleanup-procedures after server pack generation are enabled. final BooleanisMinecraftPreReleasesAvailabilityEnabled()Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI. final UnitsetMinecraftPreReleasesAvailabilityEnabled(Boolean value)Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI. final BooleanisUpdatingServerPacksEnabled()Whether a server pack should be updated instead of cleanly generated. final UnitsetUpdatingServerPacksEnabled(Boolean value)Whether a server pack should be updated instead of cleanly generated. final TreeSet<String>getUpdateProtectedPaths()Paths an update must never delete, overwrite or put into the ZIP-archive, matched against paths relative to the server pack, where a directory covers everything beneath it. final UnitsetUpdateProtectedPaths(TreeSet<String> value)Paths an update must never delete, overwrite or put into the ZIP-archive, matched against paths relative to the server pack, where a directory covers everything beneath it. final StringgetAikarsFlags()Aikar's flags, commonly used for Minecraft servers to improve performance in various places. final UnitsetAikarsFlags(String value)Aikar's flags, commonly used for Minecraft servers to improve performance in various places. final UnitloadFallbackModsList()Merges the stored fallback-list of clientside-only mods into clientsideMods and writes the merged list back to the store. final UnitloadFallbackWhitelist()Merges the stored mod-whitelist into modsWhitelist and writes the fallback-whitelist back to the store. final List<String>clientSideMods()The clientside-only mod-list matching the active exclusionFilter: the regex-variant for ExclusionFilter.REGEX, the plain list otherwise. final List<String>whitelistedMods()The mod-whitelist matching the active exclusionFilter: the regex-variant for ExclusionFilter.REGEX, the plain list otherwise. -
-
Constructor Detail
-
GenerationConfig
GenerationConfig(PropertyStore store)
-
-
Method Detail
-
getFallbackDirectoriesInclusion
final TreeSet<String> getFallbackDirectoriesInclusion()
Shipped default for what a new configuration copies out of a modpack. Sorted, so the config file it is written into stays diff-friendly. Every
fallback*here is what SPC uses when the property is unset or unreadable, which is what keeps a damaged properties file from being fatal.
-
getFallbackDirectoriesExclusion
final TreeSet<String> getFallbackDirectoriesExclusion()
Shipped default for directories never copied, even when an inclusion would otherwise match them.
-
getFallbackZipExclusions
final TreeSet<String> getFallbackZipExclusions()
Shipped default for what is left out of the ZIP — chiefly the files a user must supply themselves.
-
getFallbackPostInstallCleanupFiles
final TreeSet<String> getFallbackPostInstallCleanupFiles()
Files deleted after the loader installer has run — its leftovers, which no server needs.
-
getFallbackPreInstallCleanupFiles
final TreeSet<String> getFallbackPreInstallCleanupFiles()
Files deleted before the installer runs, so a stale artifact cannot be mistaken for a fresh install.
-
getFallbackAikarsFlags
final String getFallbackAikarsFlags()
Aikar's recommended JVM flags, offered as one click in the GUI rather than typed out by a user.
-
getFallbackExclusionFilter
final ExclusionFilter getFallbackExclusionFilter()
Fallback exclusion-filter for clientside-only mod matching.
-
getFallbackOverwriteEnabled
final Boolean getFallbackOverwriteEnabled()
Fallback-value for overwriting already existing server packs.
-
getFallbackZipFileExclusionEnabled
final Boolean getFallbackZipFileExclusionEnabled()
Fallback-value for the exclusion of files from ZIP-archives.
-
getFallbackServerPackCleanupEnabled
final Boolean getFallbackServerPackCleanupEnabled()
Fallback-value for cleanup-procedures after server pack generation.
-
getFallbackMinecraftPreReleasesAvailabilityEnabled
final Boolean getFallbackMinecraftPreReleasesAvailabilityEnabled()
Fallback-value for the availability of Minecraft pre-releases and snapshots.
-
getFallbackAutoExcludingModsEnabled
final Boolean getFallbackAutoExcludingModsEnabled()
Fallback-value for the automatic exclusion of clientside-only mods.
-
getFallbackUpdateServerPack
final Boolean getFallbackUpdateServerPack()
Fallback-value for updating existing server packs instead of clean generation.
-
getFallbackUpdateProtectedPaths
final TreeSet<String> getFallbackUpdateProtectedPaths()
Shipped default for what an update must leave alone: everything a running Minecraft server writes into the directory it was started from, plus the two files an operator tunes by hand. A server pack is routinely run in place, so its directory stops being ServerPackCreator's the moment somebody starts a server out of it — regenerating over it must not cost them a world, their ban-list or their memory settings. Entries are matched against paths relative to the server pack, a directory covering everything beneath it.
-
getClientsideMods
final TreeSet<String> getClientsideMods()
String-list of clientside-only mods to exclude from server packs.
-
getModsWhitelist
final TreeSet<String> getModsWhitelist()
String-list of mods to include if present, regardless whether a match was found through clientsideMods.
-
getClientsideModsRegex
final TreeSet<String> getClientsideModsRegex()
Regex-list of clientside-only mods to exclude from server packs, derived from clientsideMods by wrapping every entry in start-and-anything regex-markers.
-
getModsWhitelistRegex
final TreeSet<String> getModsWhitelistRegex()
Regex-list of mods to include if present, derived from modsWhitelist by wrapping every entry in start-and-anything regex-markers.
-
getDirectoriesToInclude
final TreeSet<String> getDirectoriesToInclude()
Directories to include in a server pack; store-entries merge with the fallback-defaults.
-
setDirectoriesToInclude
final Unit setDirectoriesToInclude(TreeSet<String> value)
Directories to include in a server pack; store-entries merge with the fallback-defaults.
-
getDirectoriesToExclude
final TreeSet<String> getDirectoriesToExclude()
Directories to exclude from a server pack; directories present in directoriesToInclude always win and are removed from this set.
-
setDirectoriesToExclude
final Unit setDirectoriesToExclude(TreeSet<String> value)
Directories to exclude from a server pack; directories present in directoriesToInclude always win and are removed from this set.
-
getPostInstallCleanupFiles
final TreeSet<String> getPostInstallCleanupFiles()
Files to delete after a modloader-server installation; store-entries merge with the fallback-defaults.
-
setPostInstallCleanupFiles
final Unit setPostInstallCleanupFiles(TreeSet<String> value)
Files to delete after a modloader-server installation; store-entries merge with the fallback-defaults.
-
getPreInstallCleanupFiles
final TreeSet<String> getPreInstallCleanupFiles()
Files to delete before a modloader-server installation; store-entries merge with the fallback-defaults.
-
setPreInstallCleanupFiles
final Unit setPreInstallCleanupFiles(TreeSet<String> value)
Files to delete before a modloader-server installation; store-entries merge with the fallback-defaults.
-
getZipArchiveExclusions
final TreeSet<String> getZipArchiveExclusions()
Files to exclude from server pack ZIP-archives; store-entries merge with the fallback-defaults. The placeholders MINECRAFT_VERSION, MODLOADER and MODLOADER_VERSION are replaced during generation.
-
setZipArchiveExclusions
final Unit setZipArchiveExclusions(TreeSet<String> value)
Files to exclude from server pack ZIP-archives; store-entries merge with the fallback-defaults. The placeholders MINECRAFT_VERSION, MODLOADER and MODLOADER_VERSION are replaced during generation.
-
getExclusionFilter
final ExclusionFilter getExclusionFilter()
The filter-method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack; invalid or missing values default to ExclusionFilter.START.
-
setExclusionFilter
final Unit setExclusionFilter(ExclusionFilter value)
The filter-method with which to determine whether a user-specified clientside-only mod should be excluded from the server pack; invalid or missing values default to ExclusionFilter.START.
-
isZipFileExclusionEnabled
final Boolean isZipFileExclusionEnabled()
Whether the exclusion of files from the ZIP-archive of the server pack is enabled.
-
setZipFileExclusionEnabled
final Unit setZipFileExclusionEnabled(Boolean value)
Whether the exclusion of files from the ZIP-archive of the server pack is enabled.
-
isAutoExcludingModsEnabled
final Boolean isAutoExcludingModsEnabled()
Whether auto-excluding of clientside-only mods is enabled. Reading migrates the legacy property-key to the current one, with the legacy value winning.
-
setAutoExcludingModsEnabled
final Unit setAutoExcludingModsEnabled(Boolean value)
Whether auto-excluding of clientside-only mods is enabled. Reading migrates the legacy property-key to the current one, with the legacy value winning.
-
isServerPacksOverwriteEnabled
final Boolean isServerPacksOverwriteEnabled()
Whether overwriting of already existing server packs is enabled.
-
setServerPacksOverwriteEnabled
final Unit setServerPacksOverwriteEnabled(Boolean value)
Whether overwriting of already existing server packs is enabled.
-
isServerPackCleanupEnabled
final Boolean isServerPackCleanupEnabled()
Whether cleanup-procedures after server pack generation are enabled.
-
setServerPackCleanupEnabled
final Unit setServerPackCleanupEnabled(Boolean value)
Whether cleanup-procedures after server pack generation are enabled.
-
isMinecraftPreReleasesAvailabilityEnabled
final Boolean isMinecraftPreReleasesAvailabilityEnabled()
Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI.
-
setMinecraftPreReleasesAvailabilityEnabled
final Unit setMinecraftPreReleasesAvailabilityEnabled(Boolean value)
Whether Minecraft pre-releases and snapshots are available to the user in, for example, the GUI.
-
isUpdatingServerPacksEnabled
final Boolean isUpdatingServerPacksEnabled()
Whether a server pack should be updated instead of cleanly generated.
-
setUpdatingServerPacksEnabled
final Unit setUpdatingServerPacksEnabled(Boolean value)
Whether a server pack should be updated instead of cleanly generated.
-
getUpdateProtectedPaths
final TreeSet<String> getUpdateProtectedPaths()
Paths an update must never delete, overwrite or put into the ZIP-archive, matched against paths relative to the server pack, where a directory covers everything beneath it.
Deliberately the union of fallbackUpdateProtectedPaths and whatever is configured, in both accessors: protection is additive, so a user can widen it and cannot — by editing a properties-file, by a half-written value, or by a settings-panel that saves a shorter list — end up with their own world unprotected. Somebody who genuinely wants a protected file regenerated has two ways to say so that leave no room for accident: turn updating off, or delete the file and let the next run write it fresh.
Builds a new set on every read rather than handing out a field, for the reason
clientsideModsRegexnext door does: a caller holding the config's own collection watches it be emptied underneath them the next time anything reads the property.
-
setUpdateProtectedPaths
final Unit setUpdateProtectedPaths(TreeSet<String> value)
Paths an update must never delete, overwrite or put into the ZIP-archive, matched against paths relative to the server pack, where a directory covers everything beneath it.
Deliberately the union of fallbackUpdateProtectedPaths and whatever is configured, in both accessors: protection is additive, so a user can widen it and cannot — by editing a properties-file, by a half-written value, or by a settings-panel that saves a shorter list — end up with their own world unprotected. Somebody who genuinely wants a protected file regenerated has two ways to say so that leave no room for accident: turn updating off, or delete the file and let the next run write it fresh.
Builds a new set on every read rather than handing out a field, for the reason
clientsideModsRegexnext door does: a caller holding the config's own collection watches it be emptied underneath them the next time anything reads the property.
-
getAikarsFlags
final String getAikarsFlags()
Aikar's flags, commonly used for Minecraft servers to improve performance in various places.
-
setAikarsFlags
final Unit setAikarsFlags(String value)
Aikar's flags, commonly used for Minecraft servers to improve performance in various places.
-
loadFallbackModsList
final Unit loadFallbackModsList()
Merges the stored fallback-list of clientside-only mods into clientsideMods and writes the merged list back to the store.
-
loadFallbackWhitelist
final Unit loadFallbackWhitelist()
Merges the stored mod-whitelist into modsWhitelist and writes the fallback-whitelist back to the store.
-
clientSideMods
final List<String> clientSideMods()
The clientside-only mod-list matching the active exclusionFilter: the regex-variant for ExclusionFilter.REGEX, the plain list otherwise.
-
whitelistedMods
final List<String> whitelistedMods()
The mod-whitelist matching the active exclusionFilter: the regex-variant for ExclusionFilter.REGEX, the plain list otherwise.
-
-
-
-