xR4YM0ND / Aged

Aged is a challenging medieval based modpack where realism & wisdom rule your life.
https://modrinth.com/modpack/aged
MIT License
11 stars 1 forks source link

[BUG] Server pack aint working right #24

Closed xR4YM0ND closed 1 month ago

SivertGullbergHansen commented 8 months ago

I found a solution, but I am not sure exactly how viable it is.

I will assume this bug is regarded to either Athena Mod missing, or incompatible mods.

The server is missing the mod Athena, so I copied this mod from my clients mod-folder into my servers mods-folder. After this it seemed fabric was crashing from mods not being compatible, but it was actually me starting the server with the incorrect java runtime version...

What worked for me was to use ATLauncher to create a server from the modpack, copy the missing Athena mod from my client's mods-folder into the servers mods-folder and then launch the server using ATLauncher.

I assume ATLauncher downloads the correct java-runtime and prefers to use this over your default installed. In linux, ATLauncher uses this script to launch the server:

#!/bin/bash

# When setting the memory below make sure to include the amount of ram letter. M = MB, G = GB. Don't use 1GB for example, it's 1G
MEMORY="2G"

# The path to the Java to use. Wrap in double quotes ("/opt/jre-17/bin/java"). Use "java" to point to system default install.
JAVAPATH="java"

# Any additional arguments to pass to Java such as Metaspace, GC or anything else
JVMARGS=""

# Don't edit past this point

cd "`dirname "$0"`"

LAUNCHARGS="$@"
# Launcher can specify path to java using a custom token
if [ "$1" = "ATLcustomjava" ]; then
    LAUNCHARGS="${@:2}"

    echo "Using launcher provided Java from $2"
    JAVAPATH="$2"
fi

echo
echo "Printing Java version, if the Java version doesn't show below, your Java path is incorrect"
$JAVAPATH -version
echo

echo "Launching fabric-server-launch.jar with '$MEMORY' max memory, jvm args '$JVMARGS' and arguments '$LAUNCHARGS'"

$JAVAPATH -Xmx$MEMORY $JVMARGS   -jar fabric-server-launch.jar "$LAUNCHARGS"
read -n1 -r -p "Press any key to close..."

and you can see ATLcustomjava is a parameter it uses, to change the JAVAPATH.

Here is the bat script for anyone on windows, who for some reason wants it:

@ECHO OFF

:: When setting the memory below make sure to include the amount of ram letter. M = MB, G = GB. Don't use 1GB for example, it's 1G

:: This is the max memory
set maxmemory=2G

:: The path to the Java to use. Wrap in double quotes ("C:\Path\To\Java\bin\java"). Use "java" to point to system default install.
set javapath="java"

:: Any additional arguments to pass to Java such as Metaspace, GC or anything else
set jvmargs=""

:: Don't edit past this point ::

set launchargs=%*
:: Launcher can specify path to java using a custom token
IF "%1"=="ATLcustomjava" (
    for /f "tokens=2,* delims= " %%a in ("%*") do set launchargs=%%b

    echo "Using launcher provided Java from %2"
    SET javapath="%2"
)

:: Remove double quotes from the javapath since we quote it beflow
for /f "delims=" %%A in ('echo %%javapath%%') do set javapath=%%~A

echo.
echo Printing Java info below, if the Java version doesn't show below, your Java path is incorrect
echo Java path is %javapath%
echo.

echo Launching fabric-server-launch.jar with '%maxmemory%' max memory, jvm args '%jvmargs%' and arguments '%launchargs%'

:: add nogui to the end of this line to disable the gui
"%javapath%" -Xmx%maxmemory% %jvm_args%   -jar fabric-server-launch.jar %launchargs%
PAUSE

Seems like ATLauncher is using this JAVA runtime version: image

java runtime gamma 17

xR4YM0ND commented 1 month ago

Still bugged in 3.0.0 , will fix this in 3.0.1