Interface ServerPackConfigTab
-
- All Implemented Interfaces:
public interface ServerPackConfigTabForce every server pack configuration tab to provide a certain set of methods. Said set of methods give plugins access to various configurable values, such as
the modpack directory
the list of clientside-only mods
the list of files and folders to include or exclude and more.
What every accessor here reads and writes is the tab's live state — what the user currently sees — not the last saved configuration. That is the contract the individual methods rely on rather than repeating:
a getter reflects unsaved edits, so two calls around a user interaction can legitimately differ;
a setter mutates the tab exactly as typing into it would, which means SPC's own validation and status icons react to it — call validateInputFields if you need that to happen at a point of your choosing;
nothing here persists anything. getCurrentConfiguration builds a
PackConfigfrom the live state on demand, and saveCurrentConfiguration is the only method that reaches disk.
The paired
getX/getXListaccessors are the same data in two shapes: the string as it appears in the field, and the parsed entries. Prefer the list form for logic — the string form's delimiters are a UI detail.Griefed
-
-
Method Summary
Modifier and Type Method Description abstract UnitsetClientSideMods(List<String> entries)Replace the clientside-mod exclusion list, as if the user had typed it into the tab. abstract UnitsetWhitelist(List<String> entries)Replace the whitelist — entries here survive a clientside-exclusion match. abstract UnitsetInclusions(List<InclusionSpecification> entries)Replace the inclusion specifications: what gets copied into the server pack, with optional filters. abstract UnitsetIconInclusionTicked(Boolean ticked)Tick or untick "include the server icon". abstract UnitsetJavaArguments(String javaArguments)Replace the JVM arguments written into the generated start scripts. abstract UnitsetMinecraftVersion(String version)Select the Minecraft version. abstract UnitsetModloader(String modloader)Select the modloader. abstract UnitsetModloaderVersion(String version)Select the modloader version, meaningful only together with the Minecraft version and modloader. abstract UnitsetModpackDirectory(String directory)Set the modpack directory the server pack is generated from. abstract UnitsetPropertiesInclusionTicked(Boolean ticked)Tick or untick "include server.properties". abstract UnitsetScriptVariables(HashMap<String, String> variables)Replace the start-script placeholder values, keyed by their SPC_..._SPCmarker.abstract UnitsetServerIconPath(String path)Set the server icon to include, or empty for the shipped default. abstract UnitsetServerPackSuffix(String suffix)Set the suffix appended to the generated pack's directory name, so variants can coexist. abstract UnitsetServerPropertiesPath(String path)Set the server.propertiesto include, or empty for the shipped default.abstract UnitsetZipArchiveCreationTicked(Boolean ticked)Tick or untick "also create a ZIP archive" — the artifact a web-frontend user downloads. abstract StringgetClientSideMods()The clientside-mod list as the single string shown in the field. abstract List<String>getClientSideModsList()The clientside-mod list parsed into entries — the list form of getClientSideMods. abstract StringgetWhitelist()The whitelist as the single string shown in the field. abstract List<String>getWhitelistList()The whitelist parsed into entries — the list form of getWhitelist. abstract List<InclusionSpecification>getInclusions()The inclusion specifications currently configured. abstract PackConfiggetCurrentConfiguration()The tab's current state as a PackConfig, built on demand and not persisted. abstract FilesaveCurrentConfiguration()Write the tab's current configuration to disk and return the file it was written to. abstract StringgetJavaArguments()The JVM arguments currently configured, as written into the generated start scripts. abstract StringgetMinecraftVersion()The selected Minecraft version, which determines loader-version validity and the required Java. abstract StringgetModloader()The selected modloader in SPC's canonical spelling ( Forge,NeoForge,Fabric,Quilt,LegacyFabric).abstract StringgetModloaderVersion()The selected modloader version. abstract StringgetModpackDirectory()The configured modpack directory — the source the server pack is generated from. abstract HashMap<String, String>getScriptSettings()The start-script placeholder values, keyed by their SPC_..._SPCmarker.abstract StringgetServerIconPath()The configured server-icon path, or empty when the shipped default is used. abstract StringgetServerPackSuffix()The configured suffix, appended to the generated directory's name so variants of one modpack can coexist. abstract StringgetServerPropertiesPath()The configured server.propertiespath, or empty when the shipped default is used.abstract BooleanisMinecraftServerAvailable()Whether Mojang publishes a server for the selected Minecraft version. abstract BooleanisServerIconInclusionTicked()Whether "include the server icon" is ticked. abstract BooleanisServerPropertiesInclusionTicked()Whether "include server.properties" is ticked. abstract BooleanisZipArchiveCreationTicked()Whether "also create a ZIP archive" is ticked — the archive is what a web-frontend user downloads. abstract UnitclearScriptVariables()Empty the start-script placeholder table, leaving generation to fall back on the shipped defaults. abstract UnitsetAikarsFlagsAsJavaArguments()Replace the JVM arguments with Aikar's recommended flags — a convenience the GUI offers as one click. abstract UnitvalidateInputFields()Re-run the tab's validation and refresh its status icons, as an edit to a field would. abstract StringacquireRequiredJavaVersion()Mojang's declared required Java major for the selected Minecraft version — the same authority the start scripts and the grinder use, rather than a version-derived guess. -
-
Method Detail
-
setClientSideMods
abstract Unit setClientSideMods(List<String> entries)
Replace the clientside-mod exclusion list, as if the user had typed it into the tab.
-
setWhitelist
abstract Unit setWhitelist(List<String> entries)
Replace the whitelist — entries here survive a clientside-exclusion match.
-
setInclusions
abstract Unit setInclusions(List<InclusionSpecification> entries)
Replace the inclusion specifications: what gets copied into the server pack, with optional filters.
-
setIconInclusionTicked
abstract Unit setIconInclusionTicked(Boolean ticked)
Tick or untick "include the server icon".
-
setJavaArguments
abstract Unit setJavaArguments(String javaArguments)
Replace the JVM arguments written into the generated start scripts.
-
setMinecraftVersion
abstract Unit setMinecraftVersion(String version)
Select the Minecraft version. Changing it can invalidate the selected modloader version.
-
setModloader
abstract Unit setModloader(String modloader)
Select the modloader. Unrecognised names are ignored rather than rejected — see
PackConfig.modloader.
-
setModloaderVersion
abstract Unit setModloaderVersion(String version)
Select the modloader version, meaningful only together with the Minecraft version and modloader.
-
setModpackDirectory
abstract Unit setModpackDirectory(String directory)
Set the modpack directory the server pack is generated from.
-
setPropertiesInclusionTicked
abstract Unit setPropertiesInclusionTicked(Boolean ticked)
Tick or untick "include server.properties".
-
setScriptVariables
abstract Unit setScriptVariables(HashMap<String, String> variables)
Replace the start-script placeholder values, keyed by their
SPC_..._SPCmarker.
-
setServerIconPath
abstract Unit setServerIconPath(String path)
Set the server icon to include, or empty for the shipped default.
-
setServerPackSuffix
abstract Unit setServerPackSuffix(String suffix)
Set the suffix appended to the generated pack's directory name, so variants can coexist.
-
setServerPropertiesPath
abstract Unit setServerPropertiesPath(String path)
Set the
server.propertiesto include, or empty for the shipped default.
-
setZipArchiveCreationTicked
abstract Unit setZipArchiveCreationTicked(Boolean ticked)
Tick or untick "also create a ZIP archive" — the artifact a web-frontend user downloads.
-
getClientSideMods
abstract String getClientSideMods()
The clientside-mod list as the single string shown in the field. Use getClientSideModsList for entries.
-
getClientSideModsList
abstract List<String> getClientSideModsList()
The clientside-mod list parsed into entries — the list form of getClientSideMods.
-
getWhitelist
abstract String getWhitelist()
The whitelist as the single string shown in the field. Use getWhitelistList for entries.
-
getWhitelistList
abstract List<String> getWhitelistList()
The whitelist parsed into entries — the list form of getWhitelist.
-
getInclusions
abstract List<InclusionSpecification> getInclusions()
The inclusion specifications currently configured. Order is meaningful: entries are applied in sequence, so a later one can copy over what an earlier one placed.
-
getCurrentConfiguration
abstract PackConfig getCurrentConfiguration()
The tab's current state as a PackConfig, built on demand and not persisted. Use saveCurrentConfiguration when the configuration should also reach disk.
-
saveCurrentConfiguration
abstract File saveCurrentConfiguration()
Write the tab's current configuration to disk and return the file it was written to.
-
getJavaArguments
abstract String getJavaArguments()
The JVM arguments currently configured, as written into the generated start scripts.
-
getMinecraftVersion
abstract String getMinecraftVersion()
The selected Minecraft version, which determines loader-version validity and the required Java.
-
getModloader
abstract String getModloader()
The selected modloader in SPC's canonical spelling (
Forge,NeoForge,Fabric,Quilt,LegacyFabric).
-
getModloaderVersion
abstract String getModloaderVersion()
The selected modloader version. Only meaningful together with getModloader and getMinecraftVersion.
-
getModpackDirectory
abstract String getModpackDirectory()
The configured modpack directory — the source the server pack is generated from.
-
getScriptSettings
abstract HashMap<String, String> getScriptSettings()
The start-script placeholder values, keyed by their
SPC_..._SPCmarker. Keys absent here fall back toPackConfig.defaultScriptValues, so an empty map is normal rather than a missing configuration.
-
getServerIconPath
abstract String getServerIconPath()
The configured server-icon path, or empty when the shipped default is used.
-
getServerPackSuffix
abstract String getServerPackSuffix()
The configured suffix, appended to the generated directory's name so variants of one modpack can coexist.
-
getServerPropertiesPath
abstract String getServerPropertiesPath()
The configured
server.propertiespath, or empty when the shipped default is used.
-
isMinecraftServerAvailable
abstract Boolean isMinecraftServerAvailable()
Whether Mojang publishes a server for the selected Minecraft version. Not every version has one, and a pack for a version without a server cannot be generated — so this gates generation rather than describing the UI.
-
isServerIconInclusionTicked
abstract Boolean isServerIconInclusionTicked()
Whether "include the server icon" is ticked.
-
isServerPropertiesInclusionTicked
abstract Boolean isServerPropertiesInclusionTicked()
Whether "include server.properties" is ticked.
-
isZipArchiveCreationTicked
abstract Boolean isZipArchiveCreationTicked()
Whether "also create a ZIP archive" is ticked — the archive is what a web-frontend user downloads.
-
clearScriptVariables
abstract Unit clearScriptVariables()
Empty the start-script placeholder table, leaving generation to fall back on the shipped defaults.
-
setAikarsFlagsAsJavaArguments
abstract Unit setAikarsFlagsAsJavaArguments()
Replace the JVM arguments with Aikar's recommended flags — a convenience the GUI offers as one click.
-
validateInputFields
abstract Unit validateInputFields()
Re-run the tab's validation and refresh its status icons, as an edit to a field would.
-
acquireRequiredJavaVersion
abstract String acquireRequiredJavaVersion()
Mojang's declared required Java major for the selected Minecraft version — the same authority the start scripts and the grinder use, rather than a version-derived guess.
-
-
-
-