From 9aef4110fd2969556e43d844fee217a7c99068ce Mon Sep 17 00:00:00 2001 From: RealStickman Date: Fri, 23 Dec 2022 08:44:17 +0100 Subject: [PATCH] Reformat prettier --- pages/02.linux/minecraft-server/default.en.md | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/pages/02.linux/minecraft-server/default.en.md b/pages/02.linux/minecraft-server/default.en.md index 00cab8f..e1837f3 100644 --- a/pages/02.linux/minecraft-server/default.en.md +++ b/pages/02.linux/minecraft-server/default.en.md @@ -1,41 +1,45 @@ --- -title: 'Minecraft Server' +title: "Minecraft Server" visible: true --- [toc] -Make sure to allow port `25565/tcp` to your server + +Make sure to allow port `25565/tcp` to your server ## Vanilla ## PaperMC ## Forge Server + Download the forge installer from their website and install the server to a directory of your choosing. -Copy that folder to your server +Copy that folder to your server On the server, create a directory for the server. `# mkdir /etc/minecraft` -Put your folder here +Put your folder here Install java -`# apt install openjdk-17-jre` +`# apt install openjdk-17-jre` Add a `minecraft` user. `# useradd minecraft` -`# chown minecraft:minecraft -R /etc/minecraft/` +`# chown minecraft:minecraft -R /etc/minecraft/` Start the server a first time. -`sudo -u minecraft /etc/minecraft/forge-(version)/run.sh` +`sudo -u minecraft /etc/minecraft/forge-(version)/run.sh` -Accept the EULA by editing `/etc/minecraft/forge-(version)/eula.txt` +Accept the EULA by editing `/etc/minecraft/forge-(version)/eula.txt` ## Fabric Server ## Systemd Service -> Adapted from [this gist](https://gist.github.com/dotStart/ea0455714a0942474635) -`/etc/systemd/system/minecraft.service` +> Adapted from [this gist](https://gist.github.com/dotStart/ea0455714a0942474635) + +`/etc/systemd/system/minecraft.service` + ``` [Unit] Description=Minecraft Server @@ -64,9 +68,11 @@ WantedBy=multi-user.target ``` ## Systemd Service with STDIN available -> Based on [this stackexchange answer](https://unix.stackexchange.com/questions/598221/how-to-control-systemd-service-using-screen/612118#612118) -`/etc/systemd/system/minecraft.socket` +> Based on [this stackexchange answer](https://unix.stackexchange.com/questions/598221/how-to-control-systemd-service-using-screen/612118#612118) + +`/etc/systemd/system/minecraft.socket` + ``` [Unit] PartOf=minecraft.service @@ -75,7 +81,8 @@ PartOf=minecraft.service ListenFIFO=%t/minecraft.stdin ``` -`/etc/systemd/system/minecraft.service` +`/etc/systemd/system/minecraft.service` + ``` [Unit] Description=Minecraft Server @@ -104,7 +111,9 @@ To run commands, redirect commands into your socket. `echo "command" > /run/minecraft.stdin` ### Pipe commands script -**No safety at all!!** + +**No safety at all!!** + ``` #!/usr/bin/env bash echo "$@" > /run/minecraft.stdin