/ServerPackCreator

Create a server pack from a Minecraft Forge, Fabric, LegacyFabric or Quilt modpack!

Primary LanguageKotlinGNU Lesser General Public License v2.1LGPL-2.1

banner

Homepage Blog Fleet GitHub DockerHub Discord


For questions, you can always join my Discord server and talk to me there.

This repository is a mirror of https://git.griefed.de/Griefed/ServerPackCreator, mainly used for issue reporting and release distribution.


GitHub release (latest by date including pre-releases) GitHub GitHub all releases Docker Pulls GitHub Repo stars GitHub forks GitHub contributors

ServerPackCreator creates a server pack from any given Forge, Fabric, Quilt or LegacyFabric modpack.

Whenever you are working on an update to your modpack, you simply run ServerPackCreator and BAM! You've got yourself a server pack for your new modpack version.

ServerPackCreator is a passion project on which I am working in my spare time. It is also the main reason for why I got into programming in the first place. Patience with issues and support is appreciated!

I started getting into Java programming in February 2021, when I was working on an update for one of my Minecraft modpacks, Survive Create Prosper 4, and got tired and bored with manually creating a server pack everytime I wanted to update and test something, or just release a new server pack for the new modpack version.

The thought "There must be a way to automate this, or at least make it less tedious..." was the spark which sent me off into the world of programming. And here we are.

Required:
  • Using the JAR-file release requires Java 17.
  • Working internet connection recommended.
Note:
  • For more detailed help and information, take a look at the Wiki and HELP.md.
Disclaimer:
  • You are still expected to be knowledgeable about your modpack, server packs in general, server administration and managing your Java installations. ServerPackCreator is not intended to take all the work off your shoulders!

  • When using alpha, beta or in-dev version of ServerPackCreator, it is advised to do so in a different directory than your regular ServerPackCreator installation. Things will break with alpha releases, stuff may break when using beta releases. If you distribute server packs generated with a pre-release (alpha, beta) of ServerPackCreator, you do so at your own risk. I will not be held responsible for errors in your server pack caused by you using a pre-release.

    • TL;DR: Don't use test to ship to prod!
Pre-Releases:

There are two kinds of pre-releases: Alphas and Betas

  • Alphas: Missing features, incomplete features, almost guaranteed to have bugs / errors
  • Betas: Feature complete, probably contains bugs / errors

Screenshots

CLI GUI WEB
cli gui dark web

Advantages/Disadvantages of CLI, GUI:

Each way of using ServerPackCreator has its advantages and disadvantages. Depending on your environment, it may be better to use one way over the other. This section highlights some of the advantages and disadvantages of each version to help you decide which way you are going to use. Note: All three ways are supported by the .jar-file. Which one is started depends on the CLI arguments used and your environment.

CLI:

Advantages Disadvantages
No need for a graphical environment. Can be used on a server to generate a server pack for immediate use. Gathering of information for a configuration file is tedious.
Step-by-Step generation of a configuration-file with the use of the -cgen argument. Generated config will be used immediately afterwards. No convenience features file folder-browsing or jumping to the generated server pack after generation.
Load and edit an existing configuration. Editing is limited to base values of a given configuration. Not editable via CLI are script settings as well as any potentially installed plugin configuration. Debugging in case of a broken/erroring configuration file can be time consuming. Careful reading of logs is required.
Manual editing of the configuration-file in case you want to change it.
Unable to edit start script placeholders and variables

GUI:

Advantages Disadvantages
Browse the filesystem for folders and file required by the configuration. Requires a graphical environment.
Setting up a configuration by browsing the filesystem and selecting your Minecraft and modloader versions from a list.
Browsing the generated server pack after generation has finished.
Loading and saving different configurations for quick generation of multiple server packs in short succession.
Edit the configuration in the GUI. No manual file-editing required.
Edit start script placeholders and values

Webservice:

ServerPackCreator also has a webservice which you can run with the -web-argument. However, this webservice is still barebones and prone to massive improvements in a later milestone, so usage of said webservice-mode is not advised at this moment.


1. Issues and help

  • Report a bug / ask for a feature / ask for an improvement / request a documentation improvement:
  • There's a Wiki available which goes into further detail for many of ServerPackCreators available aspects:
  • The same as the Wiki, but as a file should you prefer it. 😊

2. Small feature overview

  1. Exclude clientside-only mods
    • Automatically by letting ServerPackCreator scan the mods of your modpack for their sideness
    • Manually by configuring a list mods which ServerPackCreator will filter out according to your input and the chosen filter.
  2. Add files and directories in your server pack.
    • Files and directories in your modpack
    • Files and directories from your computer
  3. Add a server icon
    • Server icons are automatically scaled down, or up, to 64x64!
    • Specify a custom one, or use a default provided by ServerPackCreator.
      • Change the default to your liking if you intend on using the same icon across multiple server packs!
  4. Add a server.properties
    • Ship your server pack with default settings!
    • Specify a custom one, or use a default provided by ServerPackCreator.
      • Change the default to your liking if you intend on using the same icon across multiple server packs!
  5. Many modloaders supported
    • Forge
    • Fabric
    • LegacyFabric
    • Quilt
  6. Use Minecraft snapshots and pre-releases
    • Per default, only regular releases enabled
  7. Let ServerPackCreator install the modloader-server for your server pack, for immediate testing and debugging after generation!
  8. Let ServerPackCreator generate a ZIP-archive, for immediate upload to places like CurseForge (after you've tested your server pack, of course 😉)
  9. Configure commandline arguments with which to start the Minecraft server
    • Does your modpack require a lot of RAM? Well, tell ServerPackCreator to create the start scripts with -Xms8G -Xmx8G or similar values!
    • Aikars flags are available, too. If you like 'em, use 'em.
  10. Create your own start-script templates
    • Add additional functionality to your servers start scripts
    • Use placeholders in your templates, to be replaced with custom values
      • Example: placeholder SPC_FLYNN_LIVES_SPC in the templates can be replaced with a value configured on a per-server pack basis, i.e Now that's a big door
  11. Plugins!
    • ServerPackCreator allows you to use plugins to add new features in various places.
    • An example plugins is available with every release, and the source code for it can be found in this repository, at Example Plugin

3. How To

This How-To guide was inspired by the wonderful Kreezxil. Guide originally from his website, with permission to add it to this README.

ServerPackCreator does what Kreezxil's articles do to create your server pack. It takes away the building part, not the debugging part. However, it gives a nice installer script which stops players from asking how to install a pack made with it. The scripts run on both Windows, and Linux, and probably also Mac.

howto

I’ve placed numbers on the screenshot, and here’s what those sections do:

  1. Click the folder-button to browse to select the folder where the client pack/modpack lives.
  2. Optional! Specify a suffix for your server pack. It should honestly match the client pack version you’re distributing.
  3. Click this folder to navigate to the mods folder of your client pack. Here, you will CTRL select only those mods that run on a client exclusively. If the mod runs on a server, do not select it. Do not select everything, if you do that you’re failing right out the gate. Check the mod’s page to know for sure if it’s client only. If you are completely unsure which mod in your modpack should be selected, skip this step and keep the default list you see in the screenshot.
  4. After clicking this folder, you will choose those folders that must be included in your server pack for it to function properly. These should honestly at minimum be the mods and config directories. Without these, your server pack would not be compatible with your modpack.
  5. Optional! Click the folder-button to browse to an image file which should become the server icon of your server pack.
    1. A preview of the server-icon is displayed on the right
    2. If the server-icon setting is empty, the default icon will be displayed
  6. Optional! Click the folder-button to browse to a server.properties-file you want your players to use with your server pack. With this, you can provide default settings like difficulty, or the world-type.
  7. Select the Minecraft version of your modpack.
  8. Select the mod loader you are using.
  9. Choose the exact version of the modloader you are using.
  10. In this section are options that you can toggle. I recommend to toggle them all on. It will pre-install the modloader server so you can immediately start and test/debug, include the server-icon.png (either you specified one, or a default will be used), include the server.properties (either you specified one, or a default will be used) and finally, create a ZIP-archive of your server pack.
  11. Optional! JVM arguments, also called Java flags, to start your server with. Have you heard of the so-called Aikars Flags? You can use them via the Use Aikars Flags-button, or set your own. Useful if your server pack needs a lot of RAM and you want your server pack users to not have to work with these values themselves.
  12. Optional! This table lets you edit the Java path used in the start scripts. This does nothing for the scripts in the ZIP-archive, so don't worry. If your modpack and server pack need a different Java version to run, you can set the path the that Java versions binary/executable here.
  13. Optional! Even more optional that #5, #6, #11 and #12, under this menu is an option to save and load a custom configuration. Useful for if you have more than one mod pack for which you make server packs. Note: Regardless of what you do, a default configuration exists.

And finally hit the play button ("Generate") to build the server pack. Once it is done, the app will ask if you want to go there. You should do that, and activate one of the start-up scripts that matches your system.

For more, go follow the rest of the relevant articles at Kreezcraft-How to make a Forge server from a Forge pack and Kreezcraft-How to make a Fabric server from a Fabric pack.

3.1 Bonus

3.1.1 Automatic Minecraft version, modloader and modloader version detection

Upon selecting the modpack directory, ServerPackCreator will scan said directory and try to determine the required Minecraft version, modloader and version of the modloader. ServerPackCreator will inform you about the versions and modloader it discovered. In case you want to re-scan the modpack-directory, hit the button with the magnifying glass-icon!

3.1.2 Using default settings, reverting to configuration value

Sometimes you want to go back a couple of steps. The list of clientside-only mods and directory and files to include in your server pack each provide you with two convenience-buttons.

The top one, with the arrow pointing backwards, will revert the adjacent field back to the value of the last loaded configuration.

The bottom one, with the cog and two red arrows, will reset the adjacent field back to the globally set, ServerPackCreator wide, configuration, regardless of what your configuration specified. Defaults! Factory setting! Ya know. Back to the..future or something.

3.1.3 Open your server.properties

The left button next to the custom properties field opens the server.properties file in your computers default text-editor. If no custom properties-file has been configured, the default one will be opened. If you've configured a custom properties-file, the custom one will be opened.

Bear in mind: The default one is, just as the factory settings for clientside-mods and files/directories to include, used globally by ServerPackCreator. Edit with caution!

3.1.2 Minecraft 1.12.2 Java 8, Minecraft 1.18.2 Java 17 and all that fuzz

Do you have Minecraft modpacks which require different Java versions? Say, a Minecraft 1.12.2 pack, requiring Java 8, and a Minecraft 1.18.2 pack, requiring Java 17? Check out how ServerPackCreator can automatically update the Java path in the created start scripts to your required Java versions, depending on which Minecraft version and therefor Java version is desired! Read Me!

When configured correctly, everytime you change the Minecraft version the SPC_JAVA_SPC-placeholder value in the script settings table will be adjusted according to the Java version required by the selected Minecraft versions server. Very convenient if you switch back and forth between modpacks which need different Java versions. This change only affects the scripts for local testing and debugging. Scripts in ZIP-archives are not affected. They will always point to java, unless you've provided your own start script templates. That's a story for another day though.

3.2 Further help

More help is available at the official ServerPackCreator Help Wiki Section.

It goes into detail on the many configurable aspects of ServerPackCreator.

Give it a read before asking something, it does contain lots of useful information. 🙂

4. Java

ServerPackCreator requires Java 17.

ATTENTION: I can not and will not guarantee that ServerPackCreator will work flawlessly with any other Java version other than version 17. Things may break at random, at any place, if a different Java version is used. You are welcome to try and use any other version, but do not report issues back to me if you do encounter problems when running ServerPackCreator with a more recent Java version.

5. Plugins

The plugin-section shows an excerpt from the README of the example plugin README. Check out the repository of the example plugin, linked below, for more details.

5.1. Example plugin for ServerPackCreator

This repository contains an example plugin. Available at Example Plugin

ServerPackCreator provides several extension endpoints for pf4j plugins, to add additional functionality. This example plugin demonstrates an implementation for all available extension endpoints of ServerPackCreator.

The example plugin demonstrates how extension for ServerPackCreator are implemented, one small example for every extension point available in ServerPackCreator.

5.2 Available Extensions

5.2.1 Configuration Panel Extension

The configuration panel is intended to let you add a panel in which you, or the user of your plugin, may configure something for any of the extensions added by your plugin.

configpanel

The above example lets you configure four text-fields, one for each extension point used during server pack configuration checking and server pack generation. More on this in Configuration Check Extension.

Extension configurations are saved to the serverpackcreator.conf of the server pack and re-loaded along with everything else, like the Minecraft version, modloader and modloader version etc.

5.2.2 Tab Extension

Tab extensions allow you to add whole tabs to the GUI of ServerPackCreator. These additional tabs are intended to let you add text-fields and such, which allow you to configure your global plugin configuration. You may add anything you want to it. The sky is the limit!

tab

The above example adds a button which, when pressed, opens a minimalistic Tetris game in a new window. It's not supposed to be actually that entertaining, but rather to demonstrate that you can do what you want inside your tab.

Below the big button are some text-fields which allow you to change some values of the global plugin-wide configuration. Global plugin-configurations are handed to you by ServerPackCreator when the tab is instantiated.

Global plugin-configurations are passed to every extension, along with any available extension-specific configuration, automatically, so you don't have to worry about anything other than actually saving changes you made in the tab.

Maybe have a timer auto-save every few seconds? Your tab, your choice! 😁

5.2.3 Configuration Check Extension

The configuration check extension point allows you to run your own config checks, be that on any of the already available data from the server pack config tab, or your own data from the configuration panel, or your own tab, or whatever else you may want to check.

check

The above example simply checks whether the string in text of the passed CommentedConfig in a list of passed configs contains text. If it does, then we add a custom error message to the list of errors encountered during configuration checks. That list is then displayed to the user after the configurations checks have all run.

Make use of this extension point in combination with the Configuration Panel Extension and/or Tab Extension in order to check user input for any errors!

5.2.4 Pre Server Pack Generation Extension

The Pre Server Pack Generation extensions run, as the name implies, right before the generation of a server pack really begins. You may use this to prepare the environment for any of the tailing extensions.

pregen

The above example shows the run of a PreGen extension, with the global plugin configuration as well as the extension-specific extension passed to it by ServerPackCreator.

5.2.5 Pre Server Pack ZIP-archive Creation Extension

The Pre Server Pack ZIP-archive Creation extensions run, as the name implies, right before the creation of the server packs ZIP-archive is, or would be, started. Want to add any files to the ZIP-archive? Or make sure some file doesn't make it into the ZIP-archive?

prezip

The above example shows the run of a PreZip extension, with the global plugin configuration as well as the extension-specific extension passed to it by ServerPackCreator.

5.2.6 Post Server Pack Generation Extension

The Post Server Pack Generation extensions run, as the name implies, after the generation of a server pack has finished. Want to add any files to the server pack, but don't want them to end up in the ZIP-archive? Maybe download, install and configure DynMap with some render-data? This would be the place to do that!

postgen

The above example shows the run of a PreGen extension, with the global plugin configuration as well as the extension-specific extension passed to it by ServerPackCreator.


See now why the ConfigPanel, ConfigCheck and Tab extensions are so nice to have? The possibilities are (almost) endless!😁

5.3 The reason for allowing ServerPackCreator to run plugin:

Some people need additional functionality for their server packs, or have some additional wishes for them. Some of those things may not fit into the core functionality of ServerPackCreator itself.

It may also be that it is such a niche feature, that I either don't have the time to code it in, or simply don't want to. Maybe it doesn't fit into the overall design of ServerPackCreator, too. Who knows, it could be any of those reasons or another.

Hence, the plugin functionality.

This allows people to write their own plugins to expand the functionality of ServerPackCreator with their own features as they see fit.

5.4 Adding your own

A curated list of officially acknowledged plugins can be found here (redirects to GitHub Pages)

How to get your own plugin into this list:

If you have written your own plugin for ServerPackCreator and you would like to see it added here, please open an issue over at ServerPackCreator, using the Documentation template.

For a plugin to be accepted, you must at least provide:

  • The name of and link to the repository, and therefore the plugin.
  • The owner of the repository, and therefore the plugin.
  • The branch of the repository where the main code resides in.
  • A description of the plugin.

6 Running

  1. If you've used the installer to acquire ServerPackCreator, use the shortcut created by the installer to run ServerPackCreator. The installers provide their own Java runtime, so you do not need to install Java separately.
  2. If you've downloaded the JAR-file, and depending on how your Java installation is set up, you may be able to simply run the JAR via double-click or other methods, or you may need to run it from the commandline.

There are a couple of arguments which may or may not be helpful for you, depending on how you plan on using ServerPackCreator:

Argument Description
-help Print ServerPackCreators help to commandline.
-update Check whether a newer version of ServerPackCreator is available.
-cgen Run ServerPackCreators configuration generation.
-cli Run ServerPackCreator in commandline-mode. If no graphical environment is supported, this is the default ServerPackCreator will enter, even when starting ServerPackCreator with no extra arguments at all.
-web Run ServerPackCreator as a webservice.
-gui Run ServerPackCreator with our GUI. If a graphical environment is supported, this is the default ServerPackCreator will enter, even when starting ServerPackCreator with no extra arguments at all.
--setup Set up and prepare the environment for subsequent runs of ServerPackCreator. This will create/copy all files needed for ServerPackCreator to function properly from inside its JAR-file and setup everything else, too.

6.1 Localization

If you wish to run ServerPackCreator with your locale (if it is already supported), you can either:

  1. Run java -jar ServerPackCreator-X.X.X.jar -lang yourLocale for example java -jar ServerPackCreator-X.X.X.jar -lang en. This will create the lang.properties-file with your specified locale.
  2. Running java -jar ServerPackCreator-x.x.x.jar without -lang en or any other language will either set the locale to en by default, or use the already defined locale from the serverpackcreator.properites-file.
  3. Modify the serverpackcreator.properties-file and set your locale like this lang=yourLocale for example lang=en

If you want to contribute translations to ServerPackCreator, check out the i18n-directory containing already available translations to see how they are set up. Then, make your changes, test them, and open a pull request on GitHub according to the Contribution-Guidelines.

6.1.1 Adding a translation

Say you want to translate ServerPackCreator to german. You would need to add the file <Module_Name>_de_DE.properties in the following places:

  • serverpackcreator-api\src\commonMain\i18n
    • Prefix: Api_
  • serverpackcreator-cli\src\main\i18n
    • Prefix: Cli_
  • serverpackcreator-gui\src\main\i18n
    • Prefix: Gui_
  • serverpackcreator-plugin-example\src\main\i18n
    • Prefix: Example_
  • serverpackcreator-updater\src\main\i18n
    • Prefix: Updates_

English translations for each can be found at:

  1. API module
  2. CLI module
  3. GUI module
  4. Example Kotlin
  5. Updater module

In the english properties for the Gui, for example, you will see entries like

menubar.gui.menu.file=File
menubar.gui.menu.edit=Edit
menubar.gui.menu.view=View
menubar.gui.menu.about=About
menubar.gui.menu.help=Help

So, in order to translate them to german, in your Gui_de_DE.properties-file, you would add

menubar.gui.menu.file=Datei
menubar.gui.menu.edit=Bearbeiten
menubar.gui.menu.view=Ansicht
menubar.gui.menu.about=Info
menubar.gui.menu.help=Hilfe

To make these available whilst coding, rebuild the project. The i18n4k-plugin will generate the necessary code, which will, in turn, then be available for you to use and test. Alternatively, you can run the Gradle task generateI18n4kFiles to generate the translation-code.

Then, either in your serverpackcreator.properties set de.griefed.serverpackcreator.language=de_DE or launch ServerPackCreator with the argument -lang=de_DE.

Voilà! The menubar will now have german translations!

7 Contributing

Java documentation available at:

Read contributions before considering contributing to ServerPackCreator.

A short excerpt:

If you want to contribute to ServerPackCreator, then the following procedure must be adhered to:

  1. Fork ServerPackCreator
  2. Create a new branch in your fork, following one of the following naming schemes:
    1. The end of each branch name bust be suffixed with a one-word description fitting the changes made. Examples:
      • griefed_chore_readme
      • griefed_perf_curseforgemodpack
      • griefed_feat_ziparchive
    2. For more details on what the naming scheme entails, see .releaserc.yml in the base directory of the repository or scroll down to the Commits-section.
    3. Schemes:
      1. your_username_breaking_
      2. your_username_build_
      3. your_username_chore_
      4. your_username_ci_
      5. your_username_docs_
      6. your_username_feat_
      7. your_username_fix_
      8. your_username_perf_
      9. your_username_refactor_
      10. your_username_revert_
      11. your_username_style_
      12. your_username_test_
      13. your_username_other_
  3. Make your changes to your new branch:
    1. Try to keep the changes atomic, so they best fit the name of the branch.
    2. Follow conventional commit messages. See Commits-section for more details. Example:
      • feat: Allow upload of modpack-export zip-archive to web-frontend
      • refactor: Use apache commons-io for copying, instead of Files
  4. Open an issue on the main repository, using the Pull Request template:
    1. Issue title: Your Username - Branch type (e.g. feat) - Short description of your changes. Example:
      • Griefed - feat - Allow upload of modpack-export zip-archive to web-frontend
    2. Issue description: Fill in the sections the template provide.
    3. Submit the new issue
  5. I will then create a new branch in the main repository, with the same name as your branch, to which you will then create a pull request to.
  6. If checks and tests pass, or any changes necessary have been made, the pull request is ready to be merged etc., I will merge it to your main repository branch.
  7. I can then merge your main repository branch into main/master/whatever locally, push these changes to my GitLab instance, which will in turn push these changes to GitHub.
  8. Done!

This is the only way to ensure that any changes made to ServerPackCreator always arrive on my GitLab instance first, then on GitHub. Since I want to stay independent of GitHub and their architecture, I have to make use of my own GitLab installation. Hence this procedure. So, if one day, GitHub vanishes, we still can provide people with ServerPackCreator from my GitLab instance.

8. Awesomesauce!

None of this would have been possible without the excellent IDEs by JetBrains. They have kindly provided this open source project with an All Products Pack license. Additionally, ej-Technologies has provided an open-source license for JProfiler for ServerPackCreator, which allows me to resolve performance bottlenecks, pin down memory leaks and understand threading issues. Huge shoutout and thank you!

JetBrains IntelliJ IDEA WebStorm JProfiler
JetBrains IntelliJ IDEA WebStorm ej-Technologies
JProfiler

✨ Thanks to all of my Supporters and Sponsors ✨


10. Libraries and Licenses

This project would not be possible without these awesome groups, creators and developers and their wonderful libraries they have kindly provided to people such as me.