public class ConfigurationModel
extends java.lang.Object
ServerPackHandler.run(ConfigurationModel) to create a server pack. A configuration model
usually consists of:
| Constructor and Description |
|---|
ConfigurationModel()
Create an empty configuration model.
|
ConfigurationModel(@NotNull java.util.List<java.lang.String> clientMods,
@NotNull java.util.List<java.lang.String> copyDirs,
@NotNull java.lang.String modpackDir,
@NotNull java.lang.String minecraftVersion,
@NotNull java.lang.String modLoader,
@NotNull java.lang.String modLoaderVersion,
@NotNull java.lang.String javaArgs,
@NotNull java.lang.String serverPackSuffix,
@NotNull java.lang.String serverIconPath,
@NotNull java.lang.String serverPropertiesPath,
boolean includeServerInstallation,
boolean includeServerIcon,
boolean includeServerProperties,
boolean includeZipCreation,
@NotNull java.util.HashMap<java.lang.String,java.lang.String> scriptSettings,
@NotNull java.util.HashMap<java.lang.String,java.util.ArrayList<com.electronwill.nightconfig.core.CommentedConfig>> addonsConfigs)
Construct a new configuration model with custom values.
|
ConfigurationModel(@NotNull Utilities utilities,
@NotNull java.io.File configFile)
Create a new configuration model from a config file.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<java.util.ArrayList<com.electronwill.nightconfig.core.CommentedConfig>> |
getAddonConfigs(@NotNull java.lang.String addonId)
Get the list of configurations for a specific addon.
|
java.util.List<java.lang.String> |
getClientMods()
Getter for a list of clientside-only mods to exclude from server pack.
|
java.util.List<java.lang.String> |
getCopyDirs()
Getter for the list of directories in the modpack to copy to the server pack.
|
java.lang.String |
getFileDiskName()
Getter for the disk-name of the CurseForge project file.
|
java.lang.String |
getFileName()
Getter for the name of the CurseForge project file.
|
boolean |
getIncludeServerIcon()
Getter for whether the server-icon.png should be included in the server pack.
|
boolean |
getIncludeServerInstallation()
Getter for whether the modloader server installation should be included.
|
boolean |
getIncludeServerProperties()
Getter for whether the server.properties should be included in the server pack.
|
boolean |
getIncludeZipCreation()
Getter for whether a ZIP-archive of the server pack should be created.
|
java.lang.String |
getJavaArgs()
Getter for the Java arguments with which the start-scripts will be generated.
|
java.lang.String |
getMinecraftVersion()
Getter for the version of Minecraft used by the modpack.
|
java.lang.String |
getModLoader()
Getter for the modloader used by the modpack.
|
java.lang.String |
getModLoaderVersion()
Getter for the version of the modloader used by the modpack.
|
java.lang.String |
getModpackDir()
Getter for the path to the modpack directory.
|
com.fasterxml.jackson.databind.JsonNode |
getModpackJson()
Getter for the JsonNode containing all information about the modpack.
|
java.util.ArrayList<com.electronwill.nightconfig.core.CommentedConfig> |
getOrCreateAddonConfigList(@NotNull java.lang.String addonId)
Get the configurations for the specified addon ID.
|
java.lang.String |
getProjectName()
Getter for the name of the CurseForge project.
|
java.util.HashMap<java.lang.String,java.lang.String> |
getScriptSettings()
Getter for the script settings used during script creation.
|
java.lang.String |
getServerIconPath()
Getter for the path to the server-icon.png to include in the server pack.
|
java.lang.String |
getServerPackSuffix()
Getter for the suffix of the server pack to be generated.
|
java.lang.String |
getServerPropertiesPath()
Getter for the path of the server.properties to include in the server pack.
|
ConfigurationModel |
save(@NotNull java.io.File destination)
Save this configuration.
|
void |
setClientMods(@NotNull java.util.List<java.lang.String> newClientMods)
Setter for the list of clientside-only mods to exclude from server pack.
|
void |
setCopyDirs(@NotNull java.util.List<java.lang.String> newCopyDirs)
Setter for the list of directories in the modpack to copy to the server pack.
|
void |
setFileDiskName(@NotNull java.lang.String fileName)
Setter for the disk-name of the CurseForge project file.
|
void |
setFileName(@NotNull java.lang.String fileName)
Setter for the name of the CurseForge project file.
|
void |
setIncludeServerIcon(boolean newIncludeServerIcon)
Setter for whether the server-icon.png should be included in the server pack.
|
void |
setIncludeServerInstallation(boolean newIncludeServerInstallation)
Setter for whether the modloader server installation should be included.
|
void |
setIncludeServerProperties(boolean newIncludeServerProperties)
Setter for whether the server.properties should be included in the server pack.
|
void |
setIncludeZipCreation(boolean newIncludeZipCreation)
Setter for whether a ZIP-archive of the server pack should be created.
|
void |
setJavaArgs(@NotNull java.lang.String javaArgs)
Setter for the Java arguments with which the start-scripts will be generated.
|
void |
setMinecraftVersion(@NotNull java.lang.String newMinecraftVersion)
Setter for the Minecraft version used by the modpack.
|
void |
setModLoader(@NotNull java.lang.String newModLoader)
Setter for the modloader used by the modpack.
|
void |
setModLoaderVersion(@NotNull java.lang.String newModLoaderVersion)
Setter for the version of the modloader used by the modpack.
|
void |
setModpackDir(@NotNull java.lang.String newModpackDir)
Setter for the path to the modpack directory.
|
void |
setModpackJson(@NotNull com.fasterxml.jackson.databind.JsonNode modpackJson)
Setter for the JsonNode containing all information about the modpack.
|
void |
setProjectName(@NotNull java.lang.String projectName)
Setter for the name of the CurseForge project.
|
void |
setScriptSettings(@NotNull java.util.HashMap<java.lang.String,java.lang.String> settings)
Putter for the script settings used during script creation.
|
void |
setServerIconPath(@NotNull java.lang.String serverIconPath)
Setter for the path of the server-icon.png to include in the server pack.
|
void |
setServerPackSuffix(@NotNull java.lang.String serverPackSuffix)
Setter for the suffix of the server pack to be generated
|
void |
setServerPropertiesPath(@NotNull java.lang.String serverPropertiesPath)
Setter for the path of the server.properties to include in the server pack.
|
java.lang.String |
toString() |
public ConfigurationModel()
public ConfigurationModel(@NotNull
@NotNull java.util.List<java.lang.String> clientMods,
@NotNull
@NotNull java.util.List<java.lang.String> copyDirs,
@NotNull
@NotNull java.lang.String modpackDir,
@NotNull
@NotNull java.lang.String minecraftVersion,
@NotNull
@NotNull java.lang.String modLoader,
@NotNull
@NotNull java.lang.String modLoaderVersion,
@NotNull
@NotNull java.lang.String javaArgs,
@NotNull
@NotNull java.lang.String serverPackSuffix,
@NotNull
@NotNull java.lang.String serverIconPath,
@NotNull
@NotNull java.lang.String serverPropertiesPath,
boolean includeServerInstallation,
boolean includeServerIcon,
boolean includeServerProperties,
boolean includeZipCreation,
@NotNull
@NotNull java.util.HashMap<java.lang.String,java.lang.String> scriptSettings,
@NotNull
@NotNull java.util.HashMap<java.lang.String,java.util.ArrayList<com.electronwill.nightconfig.core.CommentedConfig>> addonsConfigs)
clientMods - List of clientside mods to exclude from the server pack.copyDirs - 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. Either Forge,
Fabric or Quilt.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.includeServerInstallation - Whether to install the modloader server in the server pack.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.addonsConfigs - Configuration for any and all addons used by this
configuration.public ConfigurationModel(@NotNull
@NotNull Utilities utilities,
@NotNull
@NotNull java.io.File configFile)
throws java.io.FileNotFoundException,
com.electronwill.nightconfig.core.file.NoFormatFoundException
utilities - Instance of our SPC utilities.configFile - Configuration file to load.java.io.FileNotFoundException - if the specified file can not be found.com.electronwill.nightconfig.core.file.NoFormatFoundException - if the configuration format could not be determined by
Night-Config.public ConfigurationModel save(@NotNull @NotNull java.io.File destination)
destination - The file to store the configuration in.public java.util.Optional<java.util.ArrayList<com.electronwill.nightconfig.core.CommentedConfig>> getAddonConfigs(@NotNull
@NotNull java.lang.String addonId)
addonId - The ID of the addon.public java.util.ArrayList<com.electronwill.nightconfig.core.CommentedConfig> getOrCreateAddonConfigList(@NotNull
@NotNull java.lang.String addonId)
addonId - The ID identifying the addon for which to get the list of configurations.public java.lang.String getServerPackSuffix()
public void setServerPackSuffix(@NotNull
@NotNull java.lang.String serverPackSuffix)
serverPackSuffix - The suffix of the server pack to be generated.public java.util.List<java.lang.String> getClientMods()
public void setClientMods(@NotNull
@NotNull java.util.List<java.lang.String> newClientMods)
newClientMods - The new list of clientside-only mods to store.public java.util.List<java.lang.String> getCopyDirs()
public void setCopyDirs(@NotNull
@NotNull java.util.List<java.lang.String> newCopyDirs)
newCopyDirs - The new list of directories to include in server pack to store.public java.lang.String getModpackDir()
public void setModpackDir(@NotNull
@NotNull java.lang.String newModpackDir)
newModpackDir - The new modpack directory path to store.public java.lang.String getMinecraftVersion()
public void setMinecraftVersion(@NotNull
@NotNull java.lang.String newMinecraftVersion)
newMinecraftVersion - The new Minecraft version to store.public java.lang.String getModLoader()
public void setModLoader(@NotNull
@NotNull java.lang.String newModLoader)
newModLoader - The new modloader to store.public java.lang.String getModLoaderVersion()
public void setModLoaderVersion(@NotNull
@NotNull java.lang.String newModLoaderVersion)
newModLoaderVersion - The new modloader version to store.public boolean getIncludeServerInstallation()
true if the server should be installed.public void setIncludeServerInstallation(boolean newIncludeServerInstallation)
newIncludeServerInstallation - The new boolean to store.public boolean getIncludeServerIcon()
true if the icon should be included.public void setIncludeServerIcon(boolean newIncludeServerIcon)
newIncludeServerIcon - The new boolean to store.public boolean getIncludeServerProperties()
true if the properties should be included.public void setIncludeServerProperties(boolean newIncludeServerProperties)
newIncludeServerProperties - The new boolean to store.public boolean getIncludeZipCreation()
true if the ZIP-archive should be created.public void setIncludeZipCreation(boolean newIncludeZipCreation)
newIncludeZipCreation - The new boolean to store.public java.lang.String getJavaArgs()
public void setJavaArgs(@NotNull
@NotNull java.lang.String javaArgs)
javaArgs - Sets the Java arguments with which the start-scripts will be generated.public com.fasterxml.jackson.databind.JsonNode getModpackJson()
public void setModpackJson(@NotNull
@NotNull com.fasterxml.jackson.databind.JsonNode modpackJson)
modpackJson - JsonNode. The JsonNode containing all information about the modpack.public java.lang.String getProjectName()
public void setProjectName(@NotNull
@NotNull java.lang.String projectName)
projectName - The name of the CurseForge project.public java.lang.String getFileName()
public void setFileName(@NotNull
@NotNull java.lang.String fileName)
fileName - The name of the CurseForge project file.public java.lang.String getFileDiskName()
public void setFileDiskName(@NotNull
@NotNull java.lang.String fileName)
fileName - The disk-name of the CurseForge project file.public java.lang.String getServerIconPath()
public void setServerIconPath(@NotNull
@NotNull java.lang.String serverIconPath)
serverIconPath - The path to the server-icon.png to include in the server pack.public java.lang.String getServerPropertiesPath()
public void setServerPropertiesPath(@NotNull
@NotNull java.lang.String serverPropertiesPath)
serverPropertiesPath - The path to the server.properties to include in the server pack.public java.util.HashMap<java.lang.String,java.lang.String> getScriptSettings()
public void setScriptSettings(@NotNull
@NotNull java.util.HashMap<java.lang.String,java.lang.String> settings)
settings - Key-value pairs to be used in script creation.public java.lang.String toString()
toString in class java.lang.Object