Repository navigation
Conversation
Forge and NeoForge are installed by running their installer with --installServer. The installer writes the launch arguments to libraries/.../unix_args.txt, which LinuxGSM copies to serverfiles and starts with: java -Xmx<javaram>M @user_jvm_args.txt @unix_args.txt nogui. javaram keeps working and JVM options added to user_jvm_args.txt are used. Forge uses the recommended build for the Minecraft version, or the latest build when there is no recommended one. Minecraft older than 1.17 is refused: those Forge versions use a different install layout. NeoForge versions follow the Minecraft version (1.21.10 is 21.10.x, 26.3 is 26.3.0.x). Beta builds are only used with branch="snapshot". Installers are verified against the SHA1 published next to them. The executable check now ignores a leading @ so it finds unix_args.txt. Switching between Fabric, Forge and NeoForge warns that the mods directory holds mods for the old loader.
fn_reload_startparameters reloads preexecutable from the config in start, debug and details, which put -jar back in front of @unix_args.txt. NeoForge then failed to start. The variant start settings are now applied by one function, fn_variant_startparameters, called after each reload. It replaces the three copies of the startparameters and fs_basepath handling.
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds Forge and NeoForge as Minecraft: Java Edition variants, using the
variantsetting added for Fabric, Paper, Purpur, Folia and Leaf.--installServer. The installer writes the launch arguments tolibraries/.../unix_args.txt; LinuxGSM copies that toserverfiles/unix_args.txtand starts the server withjava -Xmx<javaram>M @user_jvm_args.txt @unix_args.txt nogui.javaramkeeps working, and JVM options added touser_jvm_args.txtare used too.branch="snapshot".check_executable.shignores a leading@so it findsunix_args.txt.start,debuganddetailsreload the start parameters from the config, which put-jarback in front of@unix_args.txt. The variant start settings are now applied again by one function,fn_variant_startparameters, which replaces the three copies of thestartparametersandfs_basepathhandling.Fixes #4907
Related to #2299
Affected servers: mc
Type of change
Testing
Tested on a test server in a clean
ubuntu-26.04container, with this branch:auto-install --variant neoforge --version latest: EULA accepted, NeoForge 26.3.0.103 installer downloaded and verified by SHA1, installer ran,variant.txtandbuild.txtwritten. Server reached "Done", onemonitorpassed with the started lock unchanged.update --variant forge: Forge 26.3-66.1.8 (recommended build) installed over NeoForge, with the mods warning. Reached "Done",monitorpassed, started lock unchanged.update --variant neoforge --version 1.21.10: NeoForge 21.10.64 installed. Reached "Done" on a new world,monitorpassed, started lock unchanged. (A world saved by 26.3 won't load on 1.21.10, which is a Minecraft limit.)detailsshowsjava -Xmx1024M @user_jvm_args.txt @unix_args.txt noguifor both loaders.updatewith nothing new reports "No update available".update --variant forge --version 1.16.5fails with "Forge for Minecraft 1.16.5 is not supported. Use Minecraft 1.17 or newer."latest) and NeoForge (1.21, 1.21.10, 26.3,latest, betas skipped onrelease).shellcheckclean on the changed modules.Risk and rollback
@strip incheck_executable.shand moving the variant start-parameter handling instart,debuganddetailsintofn_variant_startparameters, which does the same thing for the other variants../mcserver update --variant vanilla.Breaking changes
Documentation
Checklist
PR will not be merged until all steps are complete.
Thank you for your Pull Request!