ok final pack update for server scripts

This commit is contained in:
ursamina
2024-02-27 03:12:17 +00:00
parent 1ffe6183b4
commit 233c84b755
2 changed files with 19 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
$GAME_VERSION = "1.20.1" $GAME_VERSION = "1.20.1"
$FORGE_VERSION = "1.20.1-47.1.84" $FORGE_VERSION = "1.20.1-47.2.0"
$FINDME_VERSION = "3.2.1d" $FINDME_VERSION = "1.20.1-3.2.1d"
$PACK_URI = "https://raw.githubusercontent.com/GregTechCEu/GregTech-Modern-Community-Pack/main/pack.toml" $PACK_URI = "https://raw.githubusercontent.com/GregTechCEu/GregTech-Modern-Community-Pack/main/pack.toml"
@@ -8,33 +8,34 @@ $PACK_URI = "https://raw.githubusercontent.com/GregTechCEu/GregTech-Modern-Commu
if (!(Get-Command java)) { if (!(Get-Command java)) {
Write-Host -ForegroundColor Red "Java 17, which is a requirement for Minecraft, was not detected on this system." Write-Host -ForegroundColor Red "Java 17, which is a requirement for Minecraft, was not detected on this system."
Write-Host -ForegroundColor Green "On windows you can install it via the winget windows package manager by running:" Write-Host -ForegroundColor Green "On windows you can install it via the winget windows package manager by running:"
Write-Host -ForegroundColor Green "winget install -e --id EclipseAdoptium.Temurin.17.JRE" Write-Host -ForegroundColor Green "winget install -e --id Microsoft.OpenJDK.17"
Write-Host -ForegroundColor Green "On other systems, via your platform's package manager." Write-Host -ForegroundColor Green "On other systems, via your platform's package manager."
exit 1 exit 1
} }
# Install (Neo)Forge # Install (Neo)Forge
if (!(Test-Path "forge-$FORGE_VERSION-installer.jar")) { if (!(Test-Path "forge-$FORGE_VERSION-installer.jar")) {
# Neoforge maven, might come in handy later.
# $FORGE_URI = "https://maven.neoforged.net/releases/net/neoforged/forge/$FORGE_VERSION/forge-$FORGE_VERSION-installer.jar"
$FORGE_URI = "https://maven.minecraftforge.net/net/minecraftforge/forge/$FORGE_VERSION/forge-$FORGE_VERSION-installer.jar"
$FORGE_URI = "https://maven.neoforged.net/releases/net/neoforged/forge/$FORGE_VERSION/forge-$FORGE_VERSION-installer.jar" Write-Host -ForegroundColor Yellow "Clearing potentially incorrect versions of Forge..."
Write-Host -ForegroundColor Yellow "Clearing potentially incorrect versions of NeoForge..."
Get-ChildItem -Path ".\" -Filter "forge-*-installer.jar" | Remove-Item | Out-Null Get-ChildItem -Path ".\" -Filter "forge-*-installer.jar" | Remove-Item | Out-Null
Write-Host -ForegroundColor Blue "Fetching NeoForge Version $FORGE_VERSION" Write-Host -ForegroundColor Blue "Fetching Forge Version $FORGE_VERSION"
Invoke-WebRequest -Uri $FORGE_URI -OutFile "forge-$FORGE_VERSION-installer.jar" Invoke-WebRequest -Uri $FORGE_URI -OutFile "forge-$FORGE_VERSION-installer.jar"
Write-Host -ForegroundColor Blue "Installing NeoForge as server, this will take a few minutes." Write-Host -ForegroundColor Blue "Installing Forge as server, this will take a few minutes."
java -jar "forge-$FORGE_VERSION-installer.jar" --installServer 2>&1 | ForEach-Object { java -jar "forge-$FORGE_VERSION-installer.jar" --installServer 2>&1 | ForEach-Object {
Write-Progress -Activity "Installing NeoForge" -Status $_ Write-Progress -Activity "Installing Forge" -Status $_
} }
if ($LASTEXITCODE -eq 0) { if ($LASTEXITCODE -eq 0) {
Write-Host -ForegroundColor Green "NeoForge installation completed successfully." Write-Host -ForegroundColor Green "Forge installation completed successfully."
Write-Progress -Completed -Activity "Removing progress bar." Write-Progress -Completed -Activity "Removing progress bar."
} else { } else {
Write-Host -ForegroundColor Red "NeoForge installation failed with exit code $LASTEXITCODE." Write-Host -ForegroundColor Red "Forge installation failed with exit code $LASTEXITCODE."
exit 1 exit 1
} }
@@ -126,4 +127,4 @@ if ($PSVersionTable.Platform.startsWith("Win")) {
} }
Write-Host "Running the server..." Write-Host "Running the server..."
java @( "@user_jvm_args.txt", "@libraries/net/neoforged/forge/$FORGE_VERSION/$PLATFORM_ARGS" ) nogui %* java @( "@user_jvm_args.txt", "@libraries/net/minecraftforge/forge/$FORGE_VERSION/$PLATFORM_ARGS" ) nogui %*

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
FORGE_VERSION=1.20.1-47.1.84 FORGE_VERSION="1.20.1-47.2.0"
# Ensure java is installed # Ensure java is installed
if ! command -v java >/dev/null 2>&1; then if ! command -v java >/dev/null 2>&1; then
@@ -22,13 +22,15 @@ download() {
# Install (Neo)Forge # Install (Neo)Forge
if [ ! -f forge-$FORGE_VERSION-installer.jar ]; then if [ ! -f forge-$FORGE_VERSION-installer.jar ]; then
download "https://maven.neoforged.net/releases/net/neoforged/forge/$FORGE_VERSION/forge-$FORGE_VERSION-installer.jar"
# download "https://maven.neoforged.net/releases/net/neoforged/forge/$FORGE_VERSION/forge-$FORGE_VERSION-installer.jar"
download "https://maven.minecraftforge.net/net/minecraftforge/forge/$FORGE_VERSION/forge-$FORGE_VERSION-installer.jar"
java -jar forge-$FORGE_VERSION-installer.jar --installServer java -jar forge-$FORGE_VERSION-installer.jar --installServer
rm run.sh run.bat rm run.sh run.bat
fi fi
# FindMe does not allow distribution on curseforge # FindMe does not allow distribution on curseforge
if [ ! -f mods/findme-3.2.1-forge.jar ]; then if [ ! -f mods/findme-3.1.1-forge.jar ]; then
mkdir -p mods mkdir -p mods
download "https://mediafilez.forgecdn.net/files/5074/609/findme-3.2.1-forge.jar" -O mods/findme-3.2.1-forge.jar download "https://mediafilez.forgecdn.net/files/5074/609/findme-3.2.1-forge.jar" -O mods/findme-3.2.1-forge.jar
fi fi
@@ -40,4 +42,4 @@ fi
java -jar packwiz-installer-bootstrap.jar -g -s server https://raw.githubusercontent.com/GregTechCEu/GregTech-Modern-Community-Pack/main/pack.toml java -jar packwiz-installer-bootstrap.jar -g -s server https://raw.githubusercontent.com/GregTechCEu/GregTech-Modern-Community-Pack/main/pack.toml
java @user_jvm_args.txt @libraries/net/neoforged/forge/$FORGE_VERSION/unix_args.txt nogui java @user_jvm_args.txt @libraries/net/minecraftforge/forge/$FORGE_VERSION/unix_args.txt nogui