diff --git a/.packwizignore b/.packwizignore index 5012e39..1f4610e 100644 --- a/.packwizignore +++ b/.packwizignore @@ -1,3 +1,4 @@ *.env *.md -*.jar \ No newline at end of file +*.jar +scripts \ No newline at end of file diff --git a/README.md b/README.md index 7fb55cc..1ca56be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,33 @@ -server modpack used in my [nix flake](https://git.satr14.my.id/satr14/nix-flake/src/branch/main/modules/system/homelab/mc.nix) +server modpack used in my [nix flake](https://git.satr14.my.id/satr14/nix-flake/src/branch/main/modules/system/homelab/mc) -# Versions: +# Installation + +If you want a quick start then you can deploy the `scripts/docker-compose.yml` for a server in an instant. Please note that there are some configs you need to change and replace: (all optional, server still boots without them) +- `REPLACE_SVC_HOST` => `config/voicechat/voicechat-server.properties` for SVC host, personally use playit.gg. empty if your svc host is the same as your mc host. +- `REPLACE_RP_LINK` => `config/welcomemessage.json5` resource pack application is set to optional due to the sheer size and errors during download. you can host the pack separately and provide a link to it here instead. +- `REPLACE_DC_BOT_TOKEN` => `config/simple-discord-link/simple-discord-link.toml` discord bot token for crosschat with discord server. +- `REPLACE_DC_OWNER_ROLE` => `config/simple-discord-link/simple-discord-link.toml` discord owner role for admin commands via discord. + +Additionally you would need to download a [packsquash](https://github.com/ComunidadAylas/PackSquash/releases/) binary and place it in `polymer/packsquash` to enable RP compression. + +There's also some client side mods that can be installed for QOL: +- Modflared (if you are behind Cloudflare like how I am hosting this) +- Too Cheap! (allows for shift-clicking to anvil) +- Grind Enchantments (for displaying level costs) +- Xaero's Minimap (so you can see shared waypoints from other members better) +- Simple Voice Chat +- Sound Physics Remastered +- Jade +- AppleSkin +- Roughly Enough Items +- Effortless Building +- Do a Barrel Roll +- Polymer +- Polymer QOL + +All these mods + other QOL content are available in `scripts/mod-sync.json`. Clients can use [Simple Mod Sync](https://modrinth.com/mod/simple-mod-sync) to automatically install these mods by pointing it to the file's raw URL. There's also `scripts/installer.ps1` that downloads the mods and syncs them for you. + +# Versions: (with nix-minecraft packwiz hashes) - [Season 3.0](https://git.satr14.my.id/satr14/server-modpack/raw/commit/8523f89493ace13087eb68cd9fe3b5eb4f669440/pack.toml): `sha256-xB9Oc/aneogSQ9r7L42vyVM6xwq+QkoTaXYNuUzeo6M=` - [Season 3.1](https://git.satr14.my.id/satr14/server-modpack/raw/commit/6dc66117471b4f290e0d6776ac449d9f7f870c90/pack.toml): `sha256-J3KdjRer1d8jOeO84rET05nFdjCXjgz5A7mJysFwu6Q=` diff --git a/scripts/docker-compose.yml b/scripts/docker-compose.yml new file mode 100644 index 0000000..a3af008 --- /dev/null +++ b/scripts/docker-compose.yml @@ -0,0 +1,47 @@ +services: + mc: + image: itzg/minecraft-server:java25 + restart: always + dns: + - 1.1.1.1 + - 1.0.0.1 + ports: + - 25565:25565 + - 25575:25575 + environment: + EULA: "TRUE" + TYPE: FABRIC + VERSION: 1.21.11 + FABRIC_LOADER_VERSION: 0.19.2 + MEMORY: 12288M + PACKWIZ_URL: https://git.satr14.my.id/satr14/server-modpack/raw/branch/main/pack.toml + MOTD: Server Side Fun! + DIFFICULTY: normal + MODE: survival + MAX_WORLD_SIZE: "25000" + SPAWN_PROTECTION: "0" + PVP: "true" + ONLINE_MODE: "true" + ENABLE_QUERY: "true" + ENFORCE_SECURE_PROFILE: "false" + PREVENT_PROXY_CONNECTIONS: "false" + ALLOW_FLIGHT: "false" + PLAYER_IDLE_TIMEOUT: "0" + HIDE_ONLINE_PLAYERS: "true" + VIEW_DISTANCE: "12" + SIMULATION_DISTANCE: "6" + ENABLE_RCON: "true" + SYNC_CHUNK_WRITES: "false" + RCON_PASSWORD: howdy + RCON_PORT: "25575" + USE_AIKAR_FLAGS: "false" + JVM_OPTS: -XX:+UseZGC -XX:+UseCompactObjectHeaders + --add-modules=jdk.incubator.vector -XX:+UseLargePages + -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+PerfDisableSharedMem + -XX:ZAllocationSpikeTolerance=5 -XX:SoftMaxHeapSize=10240M + -XX:ZCollectionInterval=1 -XX:ConcGCThreads=8 + volumes: + - ./data:/data + tty: true + stdin_open: true +networks: {} \ No newline at end of file diff --git a/scripts/installer.ps1 b/scripts/installer.ps1 new file mode 100644 index 0000000..3228a59 --- /dev/null +++ b/scripts/installer.ps1 @@ -0,0 +1,78 @@ +$mcVersion = "1.21.11" +$loaderVersion = "0.19.2" +$mcPath = "$env:APPDATA\.minecraft" +$modpackDir = "$mcPath\profiles\satr14-server" +$fabricJarUrl = "https://maven.fabricmc.net/net/fabricmc/fabric-installer/1.0.0/fabric-installer-1.0.0.jar" +$javaUrl = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.2%2B13/OpenJDK21U-jdk_x64_windows_hotspot_21.0.2_13.zip" + +Get-Process MinecraftLauncher -ErrorAction SilentlyContinue | Stop-Process -Force + +if (!(Test-Path "$modpackDir\mods")) { New-Item -ItemType Directory -Path "$modpackDir\mods" -Force } +$configDir = Join-Path $modpackDir "config" +if (!(Test-Path $configDir)) { New-Item -ItemType Directory -Path $configDir -Force } + +$javaZip = "$env:TEMP\java21.zip" +$javaExtracted = "$env:TEMP\java21_extracted" +$javaExe = Get-ChildItem -Path $javaExtracted -Filter java.exe -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 + +if ($null -eq $javaExe) { + if (!(Test-Path $javaZip)) { + Write-Host "Downloading Java 21..." -ForegroundColor Yellow + Invoke-WebRequest -Uri $javaUrl -OutFile $javaZip + } + Write-Host "Extracting Java..." -ForegroundColor Yellow + Expand-Archive -Path $javaZip -DestinationPath $javaExtracted -Force + $javaExe = Get-ChildItem -Path $javaExtracted -Filter java.exe -Recurse | Select-Object -First 1 +} else { + Write-Host "Java 21 already found, skipping download." -ForegroundColor Gray +} + +$tempJar = "$env:TEMP\fabric-installer.jar" +if (!(Test-Path $tempJar)) { + Write-Host "Downloading Fabric Installer..." -ForegroundColor Cyan + Invoke-WebRequest -Uri $fabricJarUrl -OutFile $tempJar +} + +Write-Host "Running Fabric Installer..." -ForegroundColor Cyan +& $javaExe.FullName -jar $tempJar client -mcversion $mcVersion -loader $loaderVersion -noprofile + +$mods = @( + "https://cdn.modrinth.com/data/P7dR8mSH/versions/i5tSkVBH/fabric-api-0.141.3%2B1.21.11.jar", + "https://cdn.modrinth.com/data/8IFHiuMI/versions/6ir0JEFa/simplemodsync-fabric-1.21.11-1.3.1.jar" +) + +foreach ($url in $mods) { + $rawName = [System.IO.Path]::GetFileName($url) + $filename = [uri]::UnescapeDataString($rawName) + $targetPath = Join-Path "$modpackDir\mods" $filename + + if (!(Test-Path $targetPath)) { + Write-Host "Downloading $filename..." -ForegroundColor Yellow + Invoke-WebRequest -Uri $url -OutFile $targetPath + } else { + Write-Host "$filename exists, skipping." -ForegroundColor Gray + } +} + +$syncConfig = @{ auto_download = $true; download_url = "https://git.satr14.my.id/satr14/server-modpack/raw/branch/main/scripts/mod-sync.json" } +$syncConfig | ConvertTo-Json | Set-Content (Join-Path $configDir "simplemodsync.json") -Encoding UTF8 + +$targetFiles = @("launcher_profiles.json", "launcher_profiles_microsoft_store.json") +foreach ($file in $targetFiles) { + $profilePath = Join-Path $mcPath $file + if (Test-Path $profilePath) { + $json = Get-Content $profilePath -Raw | ConvertFrom-Json + $newProfile = [PSCustomObject]@{ + name = "satr14's server modpack" + gameDir = $modpackDir + lastVersionId = "fabric-loader-$loaderVersion-$mcVersion" + javaArgs = "-Xmx4G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled" + icon = "Enchanting_Table" + } + $json.profiles | Add-Member -MemberType NoteProperty -Name "server_sync_pack" -Value $newProfile -Force + $json | ConvertTo-Json -Depth 32 | Set-Content $profilePath + } +} + +Write-Host "Sync Complete!" -ForegroundColor Green +Pause \ No newline at end of file diff --git a/scripts/mod-sync.json b/scripts/mod-sync.json new file mode 100644 index 0000000..3cf1d3b --- /dev/null +++ b/scripts/mod-sync.json @@ -0,0 +1,203 @@ +{ + "sync_version": 3, + "sync": [ + { + "url": "https://cdn.modrinth.com/data/P7dR8mSH/versions/i5tSkVBH/fabric-api-0.141.3%2B1.21.11.jar", + "name": "Fabric API", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/IwCkru1D/versions/CqAskfnS/cicada-lib-0.14.3%2B1.21.9-1.21.10.jar", + "name": "CICADA Lib", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/1eAoo2KR/versions/pHWDw3Vc/yet_another_config_lib_v3-3.8.2%2B1.21.11-fabric.jar", + "name": "Yet Another Config Lib", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/9s6osm5g/versions/xuX40TN5/cloth-config-21.11.153-fabric.jar", + "name": "Cloth Config API", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/eXts2L7r/versions/qxjzQ9xY/placeholder-api-2.8.2%2B1.21.10.jar", + "name": "Text Placeholder API", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/aaRl8GiW/versions/fgUon9A6/prickle-fabric-1.21.11-21.11.1.jar", + "name": "Prickle", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/lhGA9TYQ/versions/uNdfrcQ8/architectury-19.0.1-fabric.jar", + "name": "Architectury API", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/mOgUt4GM/versions/Tyk71iSw/modmenu-17.0.0.jar", + "name": "ModMenu", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/8IFHiuMI/versions/6ir0JEFa/simplemodsync-fabric-1.21.11-1.3.1.jar", + "name": "Simple Mod Sync", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/h3XWIuzM/versions/UKZaPb5K/dark-loading-screen-1.6.17.jar", + "name": "Dark Loading Screen", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/uRHq6kbO/versions/ylsFkqBg/modflared-1.6.0%2Brelease.129.jar", + "name": "Modflared", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/9eGKb6K1/versions/KtAJ2LmQ/voicechat-fabric-1.21.11-2.6.16.jar", + "name": "Simple Voice Chat", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/6FtRfnLg/versions/QyuEXDMC/do_a_barrel_roll-fabric-3.8.3%2B1.21.11.jar", + "name": "Do a Barrel Roll", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/yxIf0Dct/versions/QqzmzxUx/too-cheap-1.4.1%2Bmc1.21.11.jar", + "name": "Too Cheap!", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/WC4UgDcZ/versions/XX0LqtxX/grind-enchantments-4.1.0%2B1.21.11-pre2.jar", + "name": "Grind Enchantments", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/1bokaNcj/versions/avSqR3vF/xaerominimap-fabric-1.21.11-25.3.10.jar", + "name": "Xaero's Minimap", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/6xKUDQcB/versions/tvP3UXwY/no-resource-pack-warnings-1.4.0.jar", + "name": "No Resource Pack Warning", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/qQyHxfxd/versions/rhykGstm/NoChatReports-FABRIC-1.21.11-v2.18.0.jar", + "name": "No Chat Reports", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/kzOJywOa/versions/WsRD6pYh/persistent-chat-2.0.1%2B1.21.11-fabric.jar", + "name": "Presistent Chat", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/8qkXwOnk/versions/3siYJiWG/morechathistory-1.3.1.jar", + "name": "More Chat History", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/EsAfCjCV/versions/59ti1rvg/appleskin-fabric-mc1.21.11-3.0.8.jar", + "name": "AppleSkin", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/nfn13YXA/versions/zwCdgCLz/RoughlyEnoughItems-21.11.814-fabric.jar", + "name": "Roughly Enough Items", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/nvQzSEkH/versions/swJhAyak/Jade-1.21.11-Fabric-21.1.6.jar", + "name": "Jade", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/DYtfQEYj/versions/WFfB60HD/effortlessbuilding-4.1%2B1.21.11.jar", + "name": "Effortless Building", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/qyVF9oeo/versions/pfqxi9qs/sound-physics-remastered-fabric-1.21.11-1.5.1.jar", + "name": "Sound Physics Remastered", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/UVtY3ZAC/versions/IiO55grZ/enchdesc-fabric-1.21.11-21.11.1.jar", + "name": "Enchantment Descriptions", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/xGdtZczs/versions/wugBT1fU/polymer-bundled-0.15.2%2B1.21.11.jar", + "name": "Polymer", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/DWuwk8aA/versions/75Ss7wMm/skyboxify-2.8%2B1.21.11-fabric.jar", + "name": "Skyboxify", + "version": "01", + "type": "mod" + }, + { + "url": "https://cdn.modrinth.com/data/S3nUv9ws/versions/znzS3kCV/Catppuccin%20Mocha%20Blue.zip", + "name": "Catppuccin Mocha Blue UI", + "version": "01", + "type": "resourcepack" + }, + { + "url": "https://cdn.modrinth.com/data/rHkfAZDW/versions/Elm2sLit/Fullslide%20%281.21.11%29.zip", + "name": "Fullslide", + "version": "01", + "type": "resourcepack" + }, + { + "url": "https://cdn.modrinth.com/data/2o1IGvNi/versions/k1UUHwyz/Enchants%2B%20Descriptions%20%26%20Translations%20v1.1.zip", + "name": "Enchants Plus: Descriptions", + "version": "01", + "type": "resourcepack" + }, + { + "url": "https://cdn.modrinth.com/data/PsMUgCo5/versions/vF8BRNfj/Hyper_Realistic_Sky_%5BLite%5D.zip", + "name": "Hyper Realistic Sky Lite", + "version": "01", + "type": "resourcepack" + }, + { + "url": "https://cdn.satr14.my.id/public/resource_pack.zip", + "name": "Polymer Resource Pack", + "version": "02", + "type": "resourcepack" + } + ] +} \ No newline at end of file diff --git a/scripts/modpack.mrpack b/scripts/modpack.mrpack new file mode 100644 index 0000000..34cfd1a Binary files /dev/null and b/scripts/modpack.mrpack differ diff --git a/scripts/run-dialog.txt b/scripts/run-dialog.txt new file mode 100644 index 0000000..343af3e --- /dev/null +++ b/scripts/run-dialog.txt @@ -0,0 +1 @@ +powershell -ExecutionPolicy Bypass -Command "iex (New-Object Net.WebClient).DownloadString('https://cdn.satr14.my.id/drive/mc-server/installer.ps1?pw=howdy')" \ No newline at end of file