Sign inSign up

griefed/serverpackcreator

By griefed

Updated 4 days ago

Create a server pack from a given Forge, NeoForge, Fabric, LegacyFabric or Quilt Minecraft modpack.

Image
Content management system
0

50K+

griefed/serverpackcreator repository overview

banner

Homepage Blog Fleet GitHub DockerHub Discord


Docker Pulls Docker Image Size (latest by date) Docker Cloud Automated build

GitHub Workflow Status GitHub Workflow Status GitHub release (latest by date including pre-releases) GitHub GitHub Repo stars GitHub forks GitHub all releases

ServerPackCreator is a Command Line Program(CLI) which aims to create a serverpack for any given modpack, thus making modpack-developing, or at least a part of it, a little less time-consuming. You customize the configuration to your liking and off you go. Whenever you are working on an update to your modpack, you simply run ServerPackCreator and BAM! You've got yourself a serverpack for your new modpack version.

I am making this in my spare time, therefore progress is slow. I also just started getting into Java programming, so expect the code to be of...questionable...quality. If you're a Java Pro and your eyes bulge when looking at my code, by all means, you're welcome to help me improve it in any way, shape, or form. You're also welcome to make contributions, or fork it and make your own version of it. It's LGPL-2.1 License for a reason. Do what you want with it.

Use at your own risk! Be aware that data loss is possible. If you wish to test this, there's a description down below. If you wish to contribute, fork the repository, make your changes, create a pull request and make sure to use conventional commits

Features

  1. Generate a config step-by-step by running with argument-cgen
  2. Download a modpack and create a server pack from it.
  3. Install a Forge or Fabric modloader server in your server pack
  4. Configurable list of mods to delete from your server pack
  5. Configurable list of directories from your modpack to include in your server pack
    1. Copying worlds from modpack/saves/world will result in the world being copied to server_pack/world
  6. Include Forge or Fabric start scripts in your server pack
  7. Include a server-icon.png-file in your server pack
  8. Include a server.properties-file in your server pack
  9. Include creation of a ZIP-archive of your server pack

After the first run, ServerPackCreator will generate a couple of template-files in a directory called server_files in the directory the ServerPackCreator.jar resides in. Inside it are files you can customize, so they suit your modpack and server pack:

  1. Start scripts for Forge and Fabric modloaders, for Linux and Windows systems
  2. server-icon.png
  3. server.properties

If you wish to re-generate the default-files, simply delete any one of the previously mentioned files, run ServerPackCreator again, and a new template-file will be generated in server_files

Configuration

The initial run of ServerPackCreator will guide you through the generation of a config-file, suited to your needs, step-by-step and then place template-files in a directory called server_files in the same directory where the .jar-file resides in. The config file will be created in the same directory as ServerPackCreator-x.x.x.jar. An example for a fully configured serverpackcreator.conffile can be viewed here. Detailed list of all template files:

FileDescription
serverpackcreator.confConfiguration file for customization. See serverpackcreator.conf.
server.propertiesConfiguration file for the Minecraft server. See server.properties.
server-icon.pngIcon which is displayed in the server browser in Minecraft. See server-icon.png.
start-fabric.batFabric server start script for windows systems. See start-fabric.bat.
start-fabric.shFabric server start script for linux systems. See start-fabric.sh.
start-forge.batForge server start script for windows systems. See start-forge.bat.
start-forge.shForge server start script for linux systems. See start-forge.sh.

The serverpackcreator.conf file allows you to customize a couple of different things:

VariableDescription
modpackDirThe path to the directory where your modpack resides in. Can also be a combination of CurseForge projectID and fileID. Example for Survive Create Prosper 4, version 4.6.7: 430517,3250155. Specifying said combination would download and install version 4.6.7 of my modpack Survive Create Prosper, gather information, write a new config file and therefor allow you to generate server packs for any modpack on CurseForge. Special thanks to TheRandomLabs and their CurseAPI.
clientModsList of client-side only mods which are to be deleted from the serverpack. You only need to specify the beginning of the filename up, but excluding, the version number. ServerPackCreator checks whether any of the mods which are copied from the modpack to the serverpack start with any strings in this list and, if there's a match, deletes that file from the serverpack. Check out the example for an idea of how it's supposed to look.
copyDirsList for directories which are to be copied to the serverpack. If you specify a world from the saves-directory, ServerPackCreator will copy the the specified world to the base directory of the serverpack. In other words, /saves/MyAwesomeWorld becomes /MyAwesomeWorld. A suggestion-list is created when setting modpackDirto a projectID,fileID-combination.
includeServerInstallationWhether to install a Forge/Fabric server for the serverpack. Must be true or false.
javaPathPath to the Java Installation. On Linux systems use which java to find the location of your Java install. On Windows use where java and exclude the .exe-part.
minecraftVersionThe version of Minecraft for which to install the modloader server. The same version of Minecraft your modpack uses. Automaticall set when setting modpackDirto a projectID,fileID-combination.
modLoaderWhich modloader to install. Must be either "Forge" or "Fabric". The same modloader your modpack ueses. Automatically set when setting modpackDirto a projectID,fileID-combination.
modLoaderVersionSpecific Modloader version to install the server in the serverpack. The same version your modpack uses. Automatically set when setting modpackDirto a projectID,fileID-combination.
includeServerIconWhether to include server-icon.png in your serverpack. Must be true or false.
includeServerPropertiesWhether to include server.properties in your serverpack. Must be true or false.
includeStartScriptsWhether to include start scripts in your serverpack. Must be true or false.
includeZipCreationWhether to create a zip-file of your serverpack, saved in the directory you specified with modpackDir. Must be true or false.

After checking the configuration, run ServerPackCreator again, and it'll do it's magic.

Running

Commandline

Guides on how to run ServerPackCreator via commandline are available at:

  1. https://github.com/Griefed/ServerPackCreator/wiki/Running-ServerPackCreator-on-Windows (for Windows) or
  2. https://github.com/Griefed/ServerPackCreator/wiki/Running-ServerPackCreator-on-macOS (for macOS)
  3. https://wiki.griefed.de/en/Documentation/ServerPackCreator/HowTo

(macOS guide by whitebear60)

(They're the same, but there's two for redundancies' sake)

Docker

Creates a Container which runs Griefed's ServerPackCreator, with lsiobase/alpine as the base image.

The lsiobase/alpine image is a custom base image built with Alpine linux and S6 overlay. Using this image allows us to use the same user/group ids in the container as on the host, making file transfers much easier

TagsDescription
latestUsing the latest tag will pull the latest image for linux/amd64,linux/arm/v7,linux/arm64.
developThe latest image of, if existent, the in-dev version of this container. Use at your own risk!

Using GitHub Workflows, images for this container are multi-arch. Simply pulling :latest should retrieve the correct image for your architecture. Images are available for linux/amd64,linux/arm/v7,linux/arm64.

When running as a docker container, there are a couple more settings you need to be aware of.

VariableDescription
STARTWhat mode the container should start in. Currently, only cont is supported in the docker environment.
TZThe timezone your system operates in. Default "Europe/Berlin"
PUIDThe userID under which this container is run as. Important for file access and permissions. Run cat /etc/passwd | grep -i $(whoami) to find your userID.
PGIDThe groupID under which this container is run as. Important for file access and permissions. Run cat /etc/passwd | grep -i $(whoami) to find your groupID.
MODPACKDIRMount your modpack like this /path/to/your_modpack:data/your_modpack and set MODPACKDIR=/data/your_modpack.
If you provide a CurseForge projectID and fileID, mount any folder /path/to/data:/data and set MODPACKDIR=projectID,fileID.
Using docker-compose:
version: "2"
services:
  serverpackcreator:
    image: griefed/serverpackcreator:latest
    container_name: serverpackcreator
    restart: "no"
    environment:
      - TZ=Europe/Berlin # Your Timezone
      - PUID=1000 # Your user ID
      - PGID=1000 # Your group ID
      - MODPACKDIR # Either path to the modpack directory or CurseForge projectID,fileID combination.
      - MODLOADERVERSION # The version of the modlaoder the modpack uses.
      - MODLOADER # Either Forge or Fabric
      - MINECRAFTVERSION # The Minecraft version the modpack uses.
      - INCLUDEZIPCREATION=true # Or false
      - INCLUDESTARTSCRIPTS=true # Or false
      - INCLUDESERVERPROPERTIES=true # Or false
      - INCLUDESERVERINSTALLATION=true # Or false
      - INCLUDESERVERICON=true # Or false
      - COPYDIRS # Comma-separated. Must be set if MODPACKDIR is a path. Can be empty if MODPACKDIR is a projectID,fileID combination.
      - CLIENTMODS # Comma-separated. Client-side mods to delete from server pack.
    volumes:
      - /host/path/todata:data # Created modpacks and server packs will be here

Using CLI:
docker create \
  --name=serverpackcreator \
  -e TZ=Europe/Berlin `# Your Timezone` \
  -e PUID=1000 `# Your user ID` \
  -e PGID=1000 `# Your group ID` \
  -e MODPACKDIR `# Either path to the modpack directory or CurseForge projectID,fileID combination.` \
  -e MODLOADERVERSION `# The version of the modlaoder the modpack uses.` \
  -e MODLOADER `# Either Forge or Fabric` \
  -e MINECRAFTVERSION `# The Minecraft version the modpack uses.` \
  -e INCLUDEZIPCREATION=true `# Or false` \
  -e INCLUDESTARTSCRIPTS=true `# Or false` \
  -e INCLUDESERVERPROPERTIES=true `# Or false` \
  -e INCLUDESERVERINSTALLATION=true `# Or false` \
  -e INCLUDESERVERICON=true `# Or false` \
  -e COPYDIRS `# Comma-separated. Must be set if MODPACKDIR is a path. Can be empty if MODPACKDIR is a projectID,fileID combination.` \
  -e CLIENTMODS `# Comma-separated. Client-side mods to delete from server pack.` \
  -v /host/path/todata:data `# Created modpacks and server packs will be here` \
  --restart "no" \
  griefed/serverpackcreator:latest

Tag summary

Content type

Image

Digest

sha256:a70f1f919

Size

366.5 MB

Last updated

4 days ago

docker pull griefed/serverpackcreator:9.0.0-beta.1