GregTech New Horizons server config

Setup for running GTNH server in docker and some other configs

Current docker-compose.yml for server, running at hayaka.gay. Download the server zip from GTNH download page, unpack it into a folder, copy the yaml in there and run docker compose up -d.

services:
  mc:
    # make sure this java version matches with pack java version
    image: itzg/minecraft-server:java25
    container_name: GTNH-2.8.4
    pull_policy: missing
    restart: unless-stopped
    tty: true
    stdin_open: true
    ports:
      - "25565:25565"
    environment:
      EULA: "TRUE"
      TYPE: CUSTOM
        #GENERIC_PACKS: /server-files/GT_New_Horizons_2.8.4_Server_Java_17-25.zip
        #GENERIC_PACKS_SUFFIX: .zip
        #GENERIC_PACKS_PREFIX: https://downloads.gtnewhorizons.com/ServerPacks/
        # if this isn't true, then the container tries to download the modpack every run
      SKIP_GENERIC_PACK_UPDATE_CHECK: "true"
      MEMORY: 6G
      # Make sure that this matches what is in your pack's startserver bash file
      JVM_OPTS: "-Dfml.readTimeout=180 @java9args.txt"
      # You may choose to instead download a specific jar version yourself, and change this value to the local jar.
      # Refer to https://docker-minecraft-server.readthedocs.io/en/latest/configuration/misc-options/#running-with-a-custom-server-jar
      CUSTOM_SERVER: "lwjgl3ify-forgePatches.jar"
      # Set server.properties according to GTNH server defaults
      MOTD: "GT:New Horizons 2.8.4"
      DIFFICULTY: "hard"
      ENABLE_COMMAND_BLOCK: "true"
      SPAWN_PROTECTION: 1
      VIEW_DISTANCE: 16
      MODE: 0
      LEVEL_TYPE: "rwg"
      SEED: "<seed>"
      ALLOW_FLIGHT: "TRUE"
      DUMP_SERVER_PROPERTIES: "TRUE"
      # Enable minecraft server console access
      CREATE_CONSOLE_IN_PIPE: "true"
# Set Whitelist
      WHITELIST: |
        nickname
# Set Administrators
      OPS: |
        nickname
    volumes:
      # attach a managed volume, change to a relative or absolute host directory if needed
      - .:/data
        #- ./:/server-file

The whitelist/ops tend not work sometimes so use the command below instead to exec into the container.

docker exec --user 1000 GTNH-2.8.4 mc-send-to-console /whitelist add <nick>

Variation you might need are:

  • /whilelist add <nick> and /whitelist del <nick>
  • /op <nick> and /deop nick

mod configs

Morpheus

Adjust the percentage of players who must be in beds in order for night to pass (Multiplayer only)

  • /_server_instance_/config/Morpheus.cfg > find I:SleeperPerc=50 and change percentage.

Maximum Chunks (Server Utilities)

Adjust the maximum number of allowed chunk loaded chunks, claimed chunks and /home commands per player. Note there are three values for each, admin/OP, VIP and normal player. In single player, the admin values are used.

To enable chunk loading, first in /_your_instance_/serverutilities/serverutilities.cfg you need to go the ranks category and turn it on by setting B:enabled=true and then in the world category the ones below to true.

  • B:chunk_claiming=true
  • B:chunk_loading=true

To change the max number of claims, go into /_your_instance_/serverutilities/server/ranks.txt and edit the following:

  • serverutilities.chunkloader.max_chunks: Total chunk loaded chunks per player. (max 30000)
  • serverutilities.claims.max_chunks: Change the total number of claimed chunks per player. (max 30000)
  • serverutilities.homes.max: Change the allowed number of /home registrations.

There are various other options in this config file to customize your overall server and what commands you want to have available. Of course some of these options will have a significant impact on balance and game experience. For example to enable /home you will need to change the commands tab to show B:home=true. See Config Filesand Permissions on wiki for more.


Pregen + Distant Horizons

Bare chunk pregen is useful even for normal playing as you won’t experience lags when travelling around the world, for example around your base.

  • /pregen start (x) (z) [radius in chunks] if you are using the command as a player instead of the console, x and z are optional.

rest is copy from wiki / not formally edited

Note: Distant Horizon should be officially coming in 2.9.0

Ended up trying the Chunk-Pregenerator mod, and it did generate biome decorations (trees, villages, ice, snow, etc.) where Server Utilities didn’t. I did run into a few crashing issues which seemed to be partially mitigated by doing the following:

  • Disabled Phosphor through Archaicfix config (this may not have actually done anything, but archaicfix lighting showed up frequently in crashes and having it off didn’t seem to hurt anything)
  • Changed B:earlyChunkTileCoordinateCheckDestructive to True in hodgepodge.cfg (server only)

Even with these set the generator would still crash at random, often after an hour+ of runtime. After some testing, I found the following to be effective in preventing repeated crashes and avoiding excessive time loss

  • Use the generator FAST_CHECK_GEN, so it tries to pick up where it left off after a crash
  • When a crash occurs, prevent an auto reboot if necessary, then go to the most recent log and identify the last region the generator was loading (in latest.log if the server did not restart after crash, most recent zipped log if it did restart). Then go to ./World/region and delete that region file. I found that it never crashed at the same point, so doing this whenever it crashed actually let it finish, it would just crash loop otherwise.

Observed side effects of this pregen method (good and bad):

  • Dynmap will refuse to map a few chunks, this results in barely-visible black squares on the web map, but visiting those chunks in game there doesn’t seem to be anything out of the ordinary.
  • Distant Horizons does register the aforementioned biome decorations with this method (see pics for comparison)

Everything here was tested on a server, but may also work the same in singleplayer

sources