paper + rcon

This commit is contained in:
grey-cat-1908 2024-01-31 19:29:11 +03:00
parent 9e1e449106
commit 1cdc423286
2 changed files with 23 additions and 2 deletions

View file

@ -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) | | `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_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) | | `SSH_PASSWORD` | SSH password | `admin` (default) |
| `FORCE_REINSTALL` | Would you like to reinstall your server? `1` - yes; `0` - no | `0` (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 ## 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 ## 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` | [Pufferfish](https://github.com/pufferfish-gg/Pufferfish) | `pufferfish`
| [Patina](https://github.com/PatinaMC/Patina) | `patina` | [Patina](https://github.com/PatinaMC/Patina) | `patina`
| [Purpur](https://purpurmc.org/) | `purpur` | [Purpur](https://purpurmc.org/) | `purpur`
| [Paper](https://papermc.io/) | `paper`
## Installing plugins ## Installing plugins

View file

@ -6,6 +6,21 @@ delete_server() {
fi 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() { get_pufferfish_server() {
if [[ -z "$MC_VERSION" ]]; then if [[ -z "$MC_VERSION" ]]; then
MC_VERSION="1.20" MC_VERSION="1.20"
@ -59,6 +74,9 @@ get_server() {
if [[ "$MC_SERVER" = "purpur" ]]; then if [[ "$MC_SERVER" = "purpur" ]]; then
get_purpur_server get_purpur_server
fi fi
if [[ "$MC_SERVER" = "paper" ]]; then
get_paper_server
fi
} }
if [[ ! -e "/localcache/conf-saved.txt" ]]; then if [[ ! -e "/localcache/conf-saved.txt" ]]; then