@Component
public final class ServerPackHandler
extends java.lang.Object
| Constructor and Description |
|---|
ServerPackHandler(ApplicationProperties injectedApplicationProperties,
VersionMeta injectedVersionMeta,
Utilities injectedUtilities,
ApplicationPlugins injectedApplicationPlugins,
ModScanner injectedModScanner)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getServerPackDestination(ConfigurationModel configurationModel)
Acquire the destination directory in which the server pack will be generated.
|
boolean |
run(@NotNull ConfigurationModel configurationModel)
Create a server pack from a given instance of
ConfigurationModel. |
ServerPackModel |
run(@NotNull ServerPackModel serverPackModel)
Create a server pack from a given instance of
ServerPackModel via webUI. |
void |
zipBuilder(java.lang.String minecraftVersion,
boolean includeServerInstallation,
java.lang.String destination,
java.lang.String modloader,
java.lang.String modloaderVersion)
Creates a ZIP-archive of the server pack previously generated.
|
@Autowired public ServerPackHandler(ApplicationProperties injectedApplicationProperties, VersionMeta injectedVersionMeta, Utilities injectedUtilities, ApplicationPlugins injectedApplicationPlugins, ModScanner injectedModScanner) throws java.io.IOException
Used for Dependency Injection.
Receives an instance of I18n or creates one if the received one is null. Required
for use of localization.
injectedApplicationProperties - Instance of Properties required for various
different things.injectedVersionMeta - Instance of VersionMeta required for everything
version related.injectedUtilities - Instance of Utilities.injectedApplicationPlugins - Instance of ApplicationPlugins.injectedModScanner - Instance of ModScanner required to determine
sideness of mods.java.io.IOException - if the VersionMeta could not be instantiated.public ServerPackModel run(@NotNull @NotNull ServerPackModel serverPackModel)
ServerPackModel via webUI.serverPackModel - An instance of ServerPackModel which contains the configuration
of the modpack.ServerPackModel which got altered during the creation of
said server pack.public java.lang.String getServerPackDestination(ConfigurationModel configurationModel)
Survive Create Prosper 4 - 5.0.1 would become Survive_Create_Prosper_4_-_5.0.1
Even though it is the year 2022, spaces in paths can and do still cause trouble. Such
as for Powershell scripts. Powershell throws a complete fit if the path contains spaces....configurationModel - Model containing the modpack directory of the modpack from which the
server pack will be generated.public boolean run(@NotNull
@NotNull ConfigurationModel configurationModel)
ConfigurationModel.configurationModel - An instance of ConfigurationModel which contains the
configuration of the modpack from which the server pack is to be
created.public void zipBuilder(java.lang.String minecraftVersion,
boolean includeServerInstallation,
java.lang.String destination,
java.lang.String modloader,
java.lang.String modloaderVersion)
ApplicationProperties.isZipFileExclusionEnabled(), files will be excluded. To customize
the files which will be excluded, see
ApplicationProperties.getFilesToExcludeFromZipArchive()minecraftVersion - Determines the name of the Minecraft server JAR to exclude
from the ZIP-archive if the modloader is Forge.includeServerInstallation - Determines whether the Minecraft server JAR info should be
printed.destination - The destination where the ZIP-archive should be created in.modloader - The modloader the modpack and server pack use.modloaderVersion - The modloader version the modpack and server pack use.