From 1cdc4232865e0076173d6c651ccd4c3fb069fc6b Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Wed, 31 Jan 2024 19:29:11 +0300 Subject: [PATCH] paper + rcon --- README.md | 7 +++++-- minecraft/run.sh | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50c30ee..a61dc7a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ You can configure nearly everything by setting up the following Enviroment Varia |---|---|---| | `RAM` | How much RAM do you want to allocate to the server? | `1G` (default) | | `MC_VERSION` | What version of Minecraft do you want to install? | `1.20.4` (default) | -| `MC_SERVER` | Which server should be installed automatically? (only `pufferfish`, `purpur`, `patina` are supported) | `purpur` (default) | +| `MC_SERVER` | Which server should be installed automatically? (only `pufferfish`, `purpur`, `patina`, `paper` are supported) | `purpur` (default) | | `SSH_PASSWORD` | SSH password | `admin` (default) | | `FORCE_REINSTALL` | Would you like to reinstall your server? `1` - yes; `0` - no | `0` (default) | @@ -41,7 +41,9 @@ You can configure nearly everything by setting up the following Enviroment Varia ## Using RCON -... ToDo...? +You can connect to your server console using Minecraft RCON. You only need server IP-address, RCON port (usually default) and RCON password (you should change it in server.properties, but default is admin). + +If you are using Windows 10 (11) system, you can use [my simple batch script](https://gist.github.com/grey-cat-1908/6aa7894ae94588886aa5a1c7e786b5e4) to install and use Minecraft RCON. ## Connecting to the server using SFTP @@ -64,6 +66,7 @@ Purpur is automatically installed the first time you run it. If you want to chan | [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) | `pufferfish` | [Patina](https://github.com/PatinaMC/Patina) | `patina` | [Purpur](https://purpurmc.org/) | `purpur` +| [Paper](https://papermc.io/) | `paper` ## Installing plugins diff --git a/minecraft/run.sh b/minecraft/run.sh index 028fbdc..edb396d 100644 --- a/minecraft/run.sh +++ b/minecraft/run.sh @@ -6,6 +6,21 @@ delete_server() { fi } +get_paper_server() { + if [[ -z "$MC_VERSION" ]]; then + MC_VERSION="1.20.4" + fi + majorVersion=$MC_VERSION + PAPER_BUILD_JSON=$(curl -X GET -s "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds") + PAPER_BUILD_FILENAME=$(jq -n "$PAPER_BUILD_JSON" | jq -jc '.builds[-1].downloads.application.name') + PAPER_BUILD_NUMBER=$(jq -n "$PAPER_BUILD_JSON" | jq '.builds[-1].build') + PAPER_BUILD_DOWNLOAD_URL="https://api.papermc.io/v2/projects/paper/versions/${MC_VERSION}/builds/${PAPER_BUILD_NUMBER}/downloads/${PAPER_BUILD_FILENAME}" + + delete_server + + wget --quiet -O server.jar -T 60 $PAPER_BUILD_DOWNLOAD_URL +} + get_pufferfish_server() { if [[ -z "$MC_VERSION" ]]; then MC_VERSION="1.20" @@ -59,6 +74,9 @@ get_server() { if [[ "$MC_SERVER" = "purpur" ]]; then get_purpur_server fi + if [[ "$MC_SERVER" = "paper" ]]; then + get_paper_server + fi } if [[ ! -e "/localcache/conf-saved.txt" ]]; then