unix args for 1.20.1

This commit is contained in:
InvalidPanda ツ
2024-02-23 22:27:12 +01:00
committed by GitHub
Unverified
parent c116f0fb9a
commit 403773c952
@@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2024-02-14T21:28:58+01:00",
"exported_at": "2024-02-23T22:25:23+01:00",
"name": "NeoForge",
"author": "mail@invalidpanda.dev",
"description": "NeoForge is a new fork of Forge, supporting Minecraft version 1.20.1 and newer.",
@@ -24,7 +24,7 @@
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n#\r\n# NeoForge Installation script\r\n#\r\n# Files kindly mirrored by invalidpandaa\r\n# Inspired by orginal Forge install script by parkervcp (c)\r\n#\r\n# Server files: \/mnt\/server\r\n\r\napt update\r\napt install -y curl jq\r\n\r\nif [[ ! -d \/mnt\/server ]]; then\r\n mkdir \/mnt\/server\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\nDOWNLOAD_LINK=https:\/\/mirror.invalidpanda.dev\/neoforge\/${MC_VERSION}\/installer.jar\r\n\r\n# Download the installer\r\necho -e \"Downloading NeoForge installer with Minecraft version ${MC_VERSION} \\nDownload link is ${DOWNLOAD_LINK}\\n\"\r\nif curl --output \/dev\/null --silent --head --fail \"${DOWNLOAD_LINK}\"; then\r\n curl -LO ${DOWNLOAD_LINK}\r\n\r\n # Check if file exists\r\n if [ -e \"installer.jar\" ]; then\r\n echo -e \"Successfully downloaded installer.jar\"\r\n else\r\n echo -e \"Failed to download installer.jar. Exiting now! \\n\"\r\n exit 1\r\n fi\r\nelse\r\n echo -e \"Couldn't reach the download server! If this error persists, please contact mail@invalidpanda.dev. \\n\"\r\n exit 1\r\nfi\r\n\r\nfunction unix_args {\r\n echo -e \"Detected Forge 1.17 or newer version. Setting up forge unix args. \\n\"\r\n ln -sf libraries\/net\/neoforged\/neoforge\/*\/unix_args.txt unix_args.txt\r\n}\r\n\r\n# Delete args to support downgrading\/upgrading\r\nrm -rf libraries\/net\/neoforged\/neoforge\r\nrm unix_args.txt\r\n\r\n\r\n# Installing NeoForge\r\necho -e \"Installing NeoForge server \\n\"\r\njava -jar installer.jar --installServer || { echo -e \"\\nFailed to install NeoForge server with Minecraft version ${MC_VERSION}! \\nMake sure to allocate enough memory and disk space.\"; exit 4; }\r\n\r\n# Check if we need a symlink for 1.17+ Forge JPMS args\r\nif [[ $MC_VERSION =~ ^1\\.(17|18|19|20|21|22|23) || $FORGE_VERSION =~ ^1\\.(17|18|19|20|21|22|23) ]]; then\r\n unix_args\r\nfi \r\n \r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar\r\necho -e \"Installation process is completed.\"",
"script": "#!\/bin\/bash\r\n#\r\n# NeoForge Installation script\r\n#\r\n# Files kindly mirrored by invalidpandaa\r\n# Inspired by orginal Forge install script by parkervcp (c)\r\n#\r\n# Server files: \/mnt\/server\r\napt update\r\napt install -y curl jq\r\nif [[ ! -d \/mnt\/server ]]; then\r\nmkdir \/mnt\/server\r\nfi\r\ncd \/mnt\/server\r\nDOWNLOAD_LINK=https:\/\/mirror.invalidpanda.dev\/neoforge\/${MC_VERSION}\/installer.jar\r\n# Download the installer\r\necho -e \"Downloading NeoForge installer with Minecraft version ${MC_VERSION} \\nDownload link is ${DOWNLOAD_LINK}\\n\"\r\nif curl --output \/dev\/null --silent --head --fail \"${DOWNLOAD_LINK}\"; then\r\ncurl -LO ${DOWNLOAD_LINK}\r\n# Check if file exists\r\nif [ -e \"installer.jar\" ]; then\r\necho -e \"Successfully downloaded installer.jar\"\r\nelse\r\necho -e \"Failed to download installer.jar. Exiting now! \\n\"\r\nexit 1\r\nfi\r\nelse\r\necho -e \"Couldn't reach the download server! If this error persists, please contact mail@invalidpanda.dev. \\n\"\r\nexit 1\r\nfi\r\nfunction unix_args {\r\necho -e \"Setting up Unix args...\"\r\nif [ \"$MC_VERSION\" = \"1.20.1\" ]; then\r\nln -sf libraries\/net\/neoforged\/forge\/*\/unix_args.txt unix_args.txt\r\nelse\r\nln -sf libraries\/net\/neoforged\/neoforge\/*\/unix_args.txt unix_args.txt\r\nfi\r\n}\r\n# Delete args to support downgrading\/upgrading\r\nrm -rf libraries\/net\/neoforged\/neoforge\r\nrm -rf libraries\/net\/neoforged\/forge # if on 1.20.1\r\nrm unix_args.txt\r\n# Installing NeoForge\r\necho -e \"Installing NeoForge server \\n\"\r\njava -jar installer.jar --installServer || { echo -e \"\\nFailed to install NeoForge server with Minecraft version ${MC_VERSION}! \\nMake sure to allocate enough memory and disk space.\"; exit 4; }\r\n# Check if we need a symlink for 1.17+ Forge JPMS args\r\nif [[ $MC_VERSION =~ ^1\\.(17|18|19|20|21|22|23) || $FORGE_VERSION =~ ^1\\.(17|18|19|20|21|22|23) ]]; then\r\nunix_args\r\nfi\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar\r\necho \"--------------------------------------------------------------------------------------\r\n\r\nInstallation complete!\r\n\r\nIf any issues occured during install, please contact mail@invalidpanda.dev.\r\n\r\n--------------------------------------------------------------------------------------\"",
"container": "openjdk:8-jdk-slim",
"entrypoint": "bash"
}