Class PackConfig
-
- All Implemented Interfaces:
public class PackConfigA PackConfig contains the settings required to create a server pack. A configuration model usually consists of:
Modpack directory
Minecraft version
Modloader
Modloader version
Java args for the start scripts
Files and directories to copy to the server pack
Whether to pre-install the modloader server
Whether to include a server-icon
Whether to include a server.properties
Whether to create a ZIP-archive
Griefed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPackConfig.CompanionThe start-script placeholder defaults every new configuration begins with.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PackConfig()PackConfig(List<String> clientMods, List<String> whitelist, List<InclusionSpecification> copyDirs, String modpackDir, String minecraftVersion, String modLoader, String modLoaderVersion, String javaArgs, String serverPackSuffix, String serverIconPath, String serverPropertiesPath, Boolean includeServerIcon, Boolean includeServerProperties, Boolean includeZipCreation, HashMap<String, String> scriptSettings, HashMap<String, ArrayList<CommentedConfig>> pluginsConfigs)Construct a new configuration model with custom values. PackConfig(File configFile)Create a new configuration model from a config file.
-
Method Summary
Modifier and Type Method Description final RegexgetForge()final RegexgetNeoForge()final RegexgetFabric()final RegexgetQuilt()final RegexgetLegacyFabric()final RegexgetWhitespace()final ArrayList<String>getClientMods()final ArrayList<String>getModsWhitelist()final ArrayList<InclusionSpecification>getInclusions()final HashMap<String, String>getScriptSettings()final HashMap<String, ArrayList<CommentedConfig>>getPluginsConfigs()final StringgetModpackDir()final UnitsetModpackDir(String value)final StringgetMinecraftVersion()final UnitsetMinecraftVersion(String value)final StringgetModloaderVersion()final UnitsetModloaderVersion(String value)final StringgetJavaArgs()final UnitsetJavaArgs(String value)final StringgetServerPackSuffix()final UnitsetServerPackSuffix(String value)final StringgetServerIconPath()final UnitsetServerIconPath(String value)final StringgetServerPropertiesPath()final UnitsetServerPropertiesPath(String value)final StringgetModloader()final UnitsetModloader(String newModLoader)final BooleanisServerIconInclusionDesired()final UnitsetServerIconInclusionDesired(Boolean value)final BooleanisServerPropertiesInclusionDesired()final UnitsetServerPropertiesInclusionDesired(Boolean value)final BooleanisZipCreationDesired()final UnitsetZipCreationDesired(Boolean value)final JsonNodegetModpackJson()final UnitsetModpackJson(JsonNode value)final StringgetConfigVersion()final UnitsetConfigVersion(String value)final Optional<File>getCustomDestination()final UnitsetCustomDestination(Optional<File> value)StringgetProjectID()UnitsetProjectID(String value)StringgetVersionID()UnitsetVersionID(String value)ModpackSourcegetSource()UnitsetSource(ModpackSource value)StringgetName()UnitsetName(String value)final PackConfigsave(File destination)Save this configuration to disk, resolving the ApiProperties through the global ApiWrapper-singleton. final PackConfigsave(File destination, ApiProperties apiProperties)Save this configuration to disk, using the given apiProperties for the configuration version-stamp. final UnitsetPluginsConfigs(HashMap<String, ArrayList<CommentedConfig>> pluginConfigs)Replace all per-plugin configuration wholesale, discarding whatever was set before. final ArrayList<CommentedConfig>getPluginConfigs(String pluginId)Configuration for one plugin, creating an empty list on first ask so an extension can always read and append without null-checking. final UnitsetClientMods(List<String> newClientMods)Replace the clientside-exclusion list wholesale. final UnitsetModsWhitelist(List<String> newModsWhitelist)Replace the whitelist wholesale — entries here survive a clientMods match. final UnitsetInclusions(ArrayList<InclusionSpecification> newCopyDirs)Replace the inclusion specifications wholesale. final UnitsetScriptSettings(HashMap<String, String> settings)Replace the start-script placeholder values wholesale. StringtoString()Every field of this configuration, for logging a generation run and for debugging a rejected config. -
-
Constructor Detail
-
PackConfig
PackConfig()
-
PackConfig
PackConfig(List<String> clientMods, List<String> whitelist, List<InclusionSpecification> copyDirs, String modpackDir, String minecraftVersion, String modLoader, String modLoaderVersion, String javaArgs, String serverPackSuffix, String serverIconPath, String serverPropertiesPath, Boolean includeServerIcon, Boolean includeServerProperties, Boolean includeZipCreation, HashMap<String, String> scriptSettings, HashMap<String, ArrayList<CommentedConfig>> pluginsConfigs)
Construct a new configuration model with custom values.
- Parameters:
clientMods- List of clientside mods to exclude from the server pack.whitelist- List of mods to include if present, regardless whether a match was found through clientModscopyDirs- List of directories and/or files to include in the server pack.modpackDir- The path to the modpack.minecraftVersion- The Minecraft version the modpack uses.modLoader- The modloader the modpack uses.modLoaderVersion- The modloader version the modpack uses.javaArgs- JVM flags to create the start scripts with.serverPackSuffix- Suffix to create the server pack with.serverIconPath- Path to the icon to use in the server pack.serverPropertiesPath- Path to the server.properties to create the server pack with.includeServerIcon- Whether to include the server-icon.png in the server pack.includeServerProperties- Whether to include the server.properties in the server pack.includeZipCreation- Whether to create a ZIP-archive of the server pack.scriptSettings- Map containing key-value pairs to be used in start script creation.pluginsConfigs- Configuration for any and all plugins used by this configuration.
-
PackConfig
PackConfig(File configFile)
Create a new configuration model from a config file.
- Parameters:
configFile- Configuration file to load.
-
-
Method Detail
-
getNeoForge
final Regex getNeoForge()
-
getLegacyFabric
final Regex getLegacyFabric()
-
getWhitespace
final Regex getWhitespace()
-
getClientMods
final ArrayList<String> getClientMods()
-
getModsWhitelist
final ArrayList<String> getModsWhitelist()
-
getInclusions
final ArrayList<InclusionSpecification> getInclusions()
-
getScriptSettings
final HashMap<String, String> getScriptSettings()
-
getPluginsConfigs
final HashMap<String, ArrayList<CommentedConfig>> getPluginsConfigs()
-
getModpackDir
final String getModpackDir()
-
setModpackDir
final Unit setModpackDir(String value)
-
getMinecraftVersion
final String getMinecraftVersion()
-
setMinecraftVersion
final Unit setMinecraftVersion(String value)
-
getModloaderVersion
final String getModloaderVersion()
-
setModloaderVersion
final Unit setModloaderVersion(String value)
-
getJavaArgs
final String getJavaArgs()
-
setJavaArgs
final Unit setJavaArgs(String value)
-
getServerPackSuffix
final String getServerPackSuffix()
-
setServerPackSuffix
final Unit setServerPackSuffix(String value)
-
getServerIconPath
final String getServerIconPath()
-
setServerIconPath
final Unit setServerIconPath(String value)
-
getServerPropertiesPath
final String getServerPropertiesPath()
-
setServerPropertiesPath
final Unit setServerPropertiesPath(String value)
-
getModloader
final String getModloader()
-
setModloader
final Unit setModloader(String newModLoader)
-
isServerIconInclusionDesired
final Boolean isServerIconInclusionDesired()
-
setServerIconInclusionDesired
final Unit setServerIconInclusionDesired(Boolean value)
-
isServerPropertiesInclusionDesired
final Boolean isServerPropertiesInclusionDesired()
-
setServerPropertiesInclusionDesired
final Unit setServerPropertiesInclusionDesired(Boolean value)
-
isZipCreationDesired
final Boolean isZipCreationDesired()
-
setZipCreationDesired
final Unit setZipCreationDesired(Boolean value)
-
getModpackJson
final JsonNode getModpackJson()
-
setModpackJson
final Unit setModpackJson(JsonNode value)
-
getConfigVersion
final String getConfigVersion()
-
setConfigVersion
final Unit setConfigVersion(String value)
-
getCustomDestination
final Optional<File> getCustomDestination()
-
setCustomDestination
final Unit setCustomDestination(Optional<File> value)
-
getProjectID
String getProjectID()
-
setProjectID
Unit setProjectID(String value)
-
getVersionID
String getVersionID()
-
setVersionID
Unit setVersionID(String value)
-
getSource
ModpackSource getSource()
-
setSource
Unit setSource(ModpackSource value)
-
save
@Deprecated(message = "Resolves ApiProperties through the ApiWrapper-singleton.", replaceWith = @ReplaceWith(expression = "save(destination, apiProperties)")) final PackConfig save(File destination)
Save this configuration to disk, resolving the ApiProperties through the global ApiWrapper-singleton. Prefer the explicit save overload which receives the ApiProperties directly, avoiding the hidden service-locator dependency.
-
save
final PackConfig save(File destination, ApiProperties apiProperties)
Save this configuration to disk, using the given apiProperties for the configuration version-stamp.
-
setPluginsConfigs
final Unit setPluginsConfigs(HashMap<String, ArrayList<CommentedConfig>> pluginConfigs)
Replace all per-plugin configuration wholesale, discarding whatever was set before.
-
getPluginConfigs
final ArrayList<CommentedConfig> getPluginConfigs(String pluginId)
Configuration for one plugin, creating an empty list on first ask so an extension can always read and append without null-checking. That side effect is why this is a function rather than a map access.
-
setClientMods
final Unit setClientMods(List<String> newClientMods)
Replace the clientside-exclusion list wholesale.
-
setModsWhitelist
final Unit setModsWhitelist(List<String> newModsWhitelist)
Replace the whitelist wholesale — entries here survive a clientMods match.
-
setInclusions
final Unit setInclusions(ArrayList<InclusionSpecification> newCopyDirs)
Replace the inclusion specifications wholesale.
-
setScriptSettings
final Unit setScriptSettings(HashMap<String, String> settings)
Replace the start-script placeholder values wholesale.
-
-
-
-