@SpringBootApplication
@EnableScheduling
public class ServerPackCreator
extends java.lang.Object
main(String[]), or
getInstance(String[]), or getInstance() to work with ServerPackCreator. For
available arguments to initialize and run SPC with, check ServerPackCreator.Mode and
ServerPackCreator.CommandlineParser for how the initialization is prioritized. An instance of SPC will have
the base amount of class-instances available to it. If a given instance of a class is null, then
calling the appropriate getter will ensure a new instance is initialized first, hence the huge
amount of synchronized-methods.serverpackcreator.properties-file to set Spring Boot properties. So if
you want to change Spring Boot specific properties, that's the file to do that in.| Modifier and Type | Class and Description |
|---|---|
class |
ServerPackCreator.CommandlineParser
The Commandline Parser checks the passed commandline arguments to determine the mode to run
in.
|
static class |
ServerPackCreator.Mode
Available mods of ServerPackCreator and their respective CLI-arguments required to be
activated/used.
|
| Constructor and Description |
|---|
ServerPackCreator(@NotNull java.lang.String[] args)
Initialize ServerPackCreator and determine the
ServerPackCreator.Mode to run in from the passed entries
in the String-array. |
| Modifier and Type | Method and Description |
|---|---|
void |
checkDatabase()
Ensures serverpackcreator.db exists.
|
boolean |
checkForConfig()
Check whether a
serverpackcreator.conf-file exists. |
boolean |
checkServerFilesFile(@NotNull java.io.File fileToCheckFor)
Check whether the specified server-files file exists and create it if it doesn't.
|
@NotNull AnnotationScanner |
getAnnotationScanner()
This instances annotation scanner used to determine the sideness of Forge mods for Minecraft
1.12.2 and older.
|
@NotNull ApplicationAddons |
getApplicationAddons()
This instances addon manager for ServerPackCreator-addons, if any are installed.
|
@NotNull ApplicationProperties |
getApplicationProperties()
This instances settings used across ServerPackCreator, such as the working-directories, files
and other settings.
|
@NotNull java.lang.String[] |
getArgs()
This instances arguments with which ServerPackCreator was started.
|
@NotNull BooleanUtilities |
getBooleanUtilities()
This instances common boolean utilities used across ServerPackCreator.
|
@NotNull ConfigurationEditor |
getConfigurationEditor()
This instances configuration editor used when running in
ServerPackCreator.Mode.CLI. |
@NotNull ConfigurationHandler |
getConfigurationHandler()
This instances ConfigurationHandler for checking a given
ConfigurationModel for
validity, so a server pack can safely be created from it. |
@Nullable javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
This instances DocumentBuilder for working with XML-data.
|
@NotNull FabricScanner |
getFabricScanner()
This instances scanner to determine the sideness of Fabric mods.
|
@NotNull FileUtilities |
getFileUtilities()
This instances common file utilities used across ServerPackCreator.
|
@NotNull I18n |
getI18n()
This instances internationalization used in the GUI and error messages displayed in the very
same.
|
static @NotNull ServerPackCreator |
getInstance()
Acquire an instance of ServerPackCreator using the
--setup-argument so a prepared
environment is present after acquiring the instance. |
static @NotNull ServerPackCreator |
getInstance(java.lang.String[] args)
Acquire an instance of ServerPackCreator using the specified argument.
|
@NotNull JarUtilities |
getJarUtilities()
This instances common JAR-utilities used across ServerPackCreator.
|
@NotNull JsonUtilities |
getJsonUtilities()
This instances common JSON utilities used across ServerPackCreator.
|
@NotNull ListUtilities |
getListUtilities()
This instances common list utilities used across ServerPackCreator.
|
@NotNull MigrationManager |
getMigrationManager()
This instances MigrationManager responsible for checking and executing any required
migration-steps between version upgrades.
|
@NotNull ModScanner |
getModScanner()
This instances modscanner to determine the sideness of a given Forge, Fabric, LegacyFabric or
Quilt mod.
|
@NotNull com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper()
This instances JSON-ObjectMapper used across ServerPackCreator with which this instance was
initialized.
|
@NotNull QuiltScanner |
getQuiltScanner()
This instances scanner to determine the sideness of Quilt mods.
|
@NotNull ServerPackCreatorWindow |
getServerPackCreatorGui()
This instances frame holding the GUI allowing the user to run and configure their server
packs.
|
@NotNull ServerPackCreatorSplash |
getServerPackCreatorSplash()
Splash screen displayed during the boot up of ServerPackCreator if a graphical environment is
supported and SPC is started in GUI-mode.
|
@NotNull ServerPackHandler |
getServerPackHandler()
This instances ServerPackHandler used to turn a
ConfigurationModel into a server pack. |
@NotNull org.springframework.context.ConfigurableApplicationContext |
getSpringBootApplicationContext(@NotNull java.lang.String[] args)
This instances application context when running as a webservice.
|
@NotNull StringUtilities |
getStringUtilities()
This instances common String utilities used across ServerPackCreator.
|
@NotNull SystemUtilities |
getSystemUtilities()
This instances common system utilities used across ServerPackCreator.
|
@NotNull com.electronwill.nightconfig.toml.TomlParser |
getTomlParser()
This instances toml parser to read and parse various
.toml-files during modscanning,
addon- and extension config loading and provisioning, serverpackcreator.conf reading and more. |
@NotNull TomlScanner |
getTomlScanner()
This instances toml scanner to determine the sideness of Forge mods for Minecraft 1.13.x and
newer.
|
@NotNull UpdateChecker |
getUpdateChecker()
This instances update checker to inform the user about any potentially available update,
including links to said update, if any.
|
@NotNull Utilities |
getUtilities()
This instances collection of common utilities used across ServerPackCreator.
|
@NotNull VersionMeta |
getVersionMeta()
This instances version meta used for checking version-correctness of Minecraft and supported
modloaders, as well as gathering information about Minecraft servers and modloader installers.
|
@NotNull WebUtilities |
getWebUtilities()
This instances common web utilities used across ServerPackCreator.
|
@NotNull XmlUtilities |
getXmlUtilities()
This instances common XML utilities used across ServerPackCreator.
|
static void |
main(java.lang.String[] args)
Initialize ServerPackCreator with the passed commandline-arguments and run.
|
void |
overwriteServerFilesFile(@NotNull java.io.File fileToOverwrite)
Overwrite the specified server-files file, even when it exists.
|
void |
run()
Run ServerPackCreator with the mode acquired from
ServerPackCreator.CommandlineParser. |
void |
run(@NotNull ServerPackCreator.Mode modeToRunIn)
Run ServerPackCreator in a specific
ServerPackCreator.Mode. |
void |
updateCheck(boolean logToConsole)
Check for update-availability.
|
void |
web(java.lang.String[] args)
Run the ServerPackCreator webservice and provide Spring Boot with arguments.
|
public ServerPackCreator(@NotNull
@NotNull java.lang.String[] args)
ServerPackCreator.Mode to run in from the passed entries
in the String-array. A new instance of SPC will initialize an instance of
ApplicationProperties, required for just about everything, as well as I18n for
localization purposes. FileUtilities, SystemUtilities, ListUtilities
and JarUtilities are also setup, so feel free to use them right away.args - Commandline arguments with which ServerPackCreator is run. Determines which mode
ServerPackCreator will enter and which locale is used. In order to see which
argument results in which mode, see ServerPackCreator.Mode.@NotNull public @NotNull FileUtilities getFileUtilities()
@NotNull public @NotNull SystemUtilities getSystemUtilities()
@NotNull public @NotNull ListUtilities getListUtilities()
@NotNull public @NotNull JarUtilities getJarUtilities()
@NotNull public static @NotNull ServerPackCreator getInstance()
--setup-argument so a prepared
environment is present after acquiring the instance. If a new instance of ServerPackCreator is
created as the result of calling this method, then the setup is run to ensure a properly
prepared environment, otherwise the already existing instance of ServerPackCreator is returned,
allowing you to do your operations.--setup-argument, or the already existing
instance, if one was initialized already.@NotNull public static @NotNull ServerPackCreator getInstance(java.lang.String[] args)
args - Arguments with which to instantiate ServerPackCreator. Possible arguments can be
found at ServerPackCreator.Mode.public static void main(java.lang.String[] args)
throws java.io.IOException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException
For a list of available commandline arguments, check out ServerPackCreator.Mode
args - Commandline arguments with which ServerPackCreator is run. Determines which mode
ServerPackCreator will enter and which locale is used.javax.xml.parsers.ParserConfigurationException - indicates a serious configuration error.java.io.IOException - if any IO errors occur.org.xml.sax.SAXException - if any parse errors occur.public void web(java.lang.String[] args)
args - Arguments passed from invocation in main(String[]).@NotNull public @NotNull java.lang.String[] getArgs()
@NotNull public @NotNull I18n getI18n()
@NotNull public @NotNull com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIESDeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAYJsonReadFeature.ALLOW_UNESCAPED_CONTROL_CHARS@NotNull public @NotNull ApplicationProperties getApplicationProperties()
@NotNull public @NotNull BooleanUtilities getBooleanUtilities()
@NotNull public @NotNull JsonUtilities getJsonUtilities()
@NotNull public @NotNull XmlUtilities getXmlUtilities()
@Nullable public @Nullable javax.xml.parsers.DocumentBuilder getDocumentBuilder()
@NotNull public @NotNull StringUtilities getStringUtilities()
@NotNull public @NotNull WebUtilities getWebUtilities()
@NotNull public @NotNull Utilities getUtilities()
@NotNull public @NotNull MigrationManager getMigrationManager()
@NotNull public @NotNull VersionMeta getVersionMeta() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
java.io.IOException - When manifests couldn't be parsed.javax.xml.parsers.ParserConfigurationException - When xml-manifests couldn't be read.org.xml.sax.SAXException - When xml-manifests couldn't be read.@NotNull public @NotNull ConfigurationHandler getConfigurationHandler() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
ConfigurationModel for
validity, so a server pack can safely be created from it.java.io.IOException - When the VersionMeta had to be instantiated, but
an error occured during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occured during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occured during the parsing of a manifest.@NotNull public @NotNull ApplicationAddons getApplicationAddons() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
java.io.IOException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.@NotNull public @NotNull ServerPackHandler getServerPackHandler() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
ConfigurationModel into a server pack.java.io.IOException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.@NotNull public @NotNull ServerPackCreatorSplash getServerPackCreatorSplash()
@NotNull public @NotNull UpdateChecker getUpdateChecker()
@NotNull public @NotNull ModScanner getModScanner()
@NotNull public @NotNull AnnotationScanner getAnnotationScanner()
@NotNull public @NotNull FabricScanner getFabricScanner()
@NotNull public @NotNull QuiltScanner getQuiltScanner()
@NotNull public @NotNull com.electronwill.nightconfig.toml.TomlParser getTomlParser()
.toml-files during modscanning,
addon- and extension config loading and provisioning, serverpackcreator.conf reading and more..toml-files.@NotNull public @NotNull TomlScanner getTomlScanner()
@NotNull public @NotNull ConfigurationEditor getConfigurationEditor() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
ServerPackCreator.Mode.CLI. Bear in mind that
the CLI config editor only provides limited functionality.java.io.IOException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.@NotNull public @NotNull ServerPackCreatorWindow getServerPackCreatorGui() throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
java.io.IOException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.@NotNull
public @NotNull org.springframework.context.ConfigurableApplicationContext getSpringBootApplicationContext(@NotNull
@NotNull java.lang.String[] args)
args - CLI arguments to pass to Spring Boot when it has not yet been started.public void run()
throws java.io.IOException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException
ServerPackCreator.CommandlineParser.java.io.IOException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.public void run(@NotNull
@NotNull ServerPackCreator.Mode modeToRunIn)
throws java.io.IOException,
javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException
ServerPackCreator.Mode.modeToRunIn - Mode to run in.java.io.IOException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.javax.xml.parsers.ParserConfigurationException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.org.xml.sax.SAXException - When the VersionMeta had to be instantiated, but
an error occurred during the parsing of a manifest.public boolean checkForConfig()
serverpackcreator.conf-file exists. If it doesn't exist, and we are not
running in ServerPackCreator.Mode.CLI or ServerPackCreator.Mode.CGEN, create an unconfigured default one which can
then be loaded into the GUI.true if a serverpackcreator.conf-file was created.public boolean checkServerFilesFile(@NotNull
@NotNull java.io.File fileToCheckFor)
fileToCheckFor - The file which is to be checked for whether it exists and if it doesn't,
should be created.true if the file was generated.public void overwriteServerFilesFile(@NotNull
@NotNull java.io.File fileToOverwrite)
fileToOverwrite - The file which is to be overwritten. If it exists. it is first deleted,
then extracted from our JAR-file.public void checkDatabase()
public void updateCheck(boolean logToConsole)
logToConsole - Whether to log update information to console or to logs.