ok final pack update for server scripts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
$GAME_VERSION = "1.20.1"
|
||||
$FORGE_VERSION = "1.20.1-47.1.84"
|
||||
$FINDME_VERSION = "3.2.1d"
|
||||
$FORGE_VERSION = "1.20.1-47.2.0"
|
||||
$FINDME_VERSION = "1.20.1-3.2.1d"
|
||||
|
||||
$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)) {
|
||||
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 "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."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Install (Neo)Forge
|
||||
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 NeoForge..."
|
||||
Write-Host -ForegroundColor Yellow "Clearing potentially incorrect versions of Forge..."
|
||||
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"
|
||||
|
||||
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 {
|
||||
Write-Progress -Activity "Installing NeoForge" -Status $_
|
||||
Write-Progress -Activity "Installing Forge" -Status $_
|
||||
}
|
||||
|
||||
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."
|
||||
} 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
|
||||
}
|
||||
|
||||
@@ -126,4 +127,4 @@ if ($PSVersionTable.Platform.startsWith("Win")) {
|
||||
}
|
||||
|
||||
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 %*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
FORGE_VERSION=1.20.1-47.1.84
|
||||
FORGE_VERSION="1.20.1-47.2.0"
|
||||
|
||||
# Ensure java is installed
|
||||
if ! command -v java >/dev/null 2>&1; then
|
||||
@@ -22,13 +22,15 @@ download() {
|
||||
|
||||
# Install (Neo)Forge
|
||||
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
|
||||
rm run.sh run.bat
|
||||
fi
|
||||
|
||||
# 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
|
||||
download "https://mediafilez.forgecdn.net/files/5074/609/findme-3.2.1-forge.jar" -O mods/findme-3.2.1-forge.jar
|
||||
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 @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
|
||||
|
||||
Reference in New Issue
Block a user