MinecraftServerControl / mscs

Powerful command-line control for UNIX and Linux powered Minecraft servers
https://minecraftservercontrol.github.io
BSD 2-Clause "Simplified" License
490 stars 61 forks source link

Forge: Missing required library #344

Open xadox-1st opened 3 months ago

xadox-1st commented 3 months ago

MSCS running in an Ubuntu 22.04.4 LTS LXC on Proxmox.

After setting up forge (tried several forge releases >=1.17.1) with the manual: https://minecraftservercontrol.github.io/docs/mscs/adjusting-world-server-properties/forge

I am not able to start the forge server. Most of the forge libraries can not be found. here is an snippet from the console.out:

...
Missing required library: org/ow2/asm/asm/9.7/asm-9.7.jar
Missing required library: org/ow2/asm/asm-analysis/9.7/asm-analysis-9.7.jar
Missing required library: org/ow2/asm/asm-commons/9.7/asm-commons-9.7.jar
Missing required library: org/ow2/asm/asm-tree/9.7/asm-tree-9.7.jar
Missing required library: org/ow2/asm/asm-util/9.7/asm-util-9.7.jar
Missing required library: org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar
...

All of the are under "/opt/mscs/server/forge-VERSION/libraries"

cat mscs.properties:

mscs-enabled=true
mscs-client-version=1.21.1
mscs-server-version=1.21.1
mscs-server-command=/opt/mscs/server/forge-1.21.1-52.0.2/run.sh
mscs-server-url=

cat ../forge-1.21.1-52.0.2/libraries/net/minecraftforge/forge/1.21.1-52.0.3/unix_args.txt

-Djava.net.preferIPv6Addresses=system -jar /opt/mscs/server/forge-1.21.1-52.0.2/forge-1.21.1-52.0.3-shim.jar

cat run.sh

#!/usr/bin/env sh
# Add custom JVM arguments (such as RAM allocation) to the user_jvm_args.txt

java -jar /opt/mscs/server/forge-1.21.1-52.0.2/forge-1.21.1-52.0.3-shim.jar --onlyCheckJava || exit 1

# Add custom program arguments (such as nogui) to the next line before the --nogui "$@" or pass them to this script directly
java @/opt/mscs/server/forge-1.21.1-52.0.2/user_jvm_args.txt @/opt/mscs/server/forge-1.21.1-52.0.2/libraries/net/minecraftforge/forge/1.21.1-52.0.3/unix_args.txt --nogui "$@"
sandain commented 3 months ago

If I remember right, the libraries folder needs to be in the world folder. This allows for each world to have a separate set of libraries disconnected from the server setup. I think a soft link in the world folder to your current setup would also work.

ln -s /opt/mscs/server/forge-1.21.1-52.0.2/libraries /opt/mscs/worlds/WORLDNAME/libraries

If this is indeed the issue, we should update the documentation. If you feel comfortable submitting a patch for the documentation, I would appreciate it.

Redmage753 commented 3 months ago

If I remember right, the libraries folder needs to be in the world folder. This allows for each world to have a separate set of libraries disconnected from the server setup. I think a soft link in the world folder to your current setup would also work.

ln -s /opt/mscs/server/forge-1.21.1-52.0.2/libraries /opt/mscs/worlds/WORLDNAME/libraries

If this is indeed the issue, we should update the documentation. If you feel comfortable submitting a patch for the documentation, I would appreciate it.

This fixed it for me - almost identical setup, just using mscs with debian lxc on proxmox. I also had to manually add /opt/mscs/server/forge-1.21.1-52.0.8/ before every forge-1.21.1-52.0.8-shim.jar reference. I retried the sed commands/deleted the files and reinstalled, cloned backups and ran each one individually.

I ended up adding it in two places: /opt/mscs/server/forge-1.21.1-52.0.8/run.sh java -jar forge-1.21.1-52.0.8-shim.jar --onlyCheckJava || exit 1 to java -jar /opt/mscs/server/forge-1.21.1-52.0.8/forge-1.21.1-52.0.8-shim.jar --onlyCheckJava || exit 1 and /opt/mscs/server/forge-1.21.1-52.0.8/libraries/net/minecraftforge/forge/1.21.1-52.0.8/unix_args.txt -Djava.net.preferIPv6Addresses=system -jar forge-1.21.1-52.0.8-shim.jar to -Djava.net.preferIPv6Addresses=system -jar /opt/mscs/server/forge-1.21.1-52.0.8/forge-1.21.1-52.0.8-shim.jar

I will try to submit a documentation patch later, unless I see this issue close.