revive project
- now using docker - single world only
This commit is contained in:
parent
ebe71cf741
commit
a7d5b829f1
17 changed files with 91 additions and 310 deletions
18
.gitignore
vendored
18
.gitignore
vendored
|
@ -1,16 +1,4 @@
|
||||||
/_/
|
/_/
|
||||||
/master/*
|
/data/
|
||||||
/modules/
|
mods.txt
|
||||||
/plugins/
|
whitelist.json
|
||||||
/secret/*
|
|
||||||
/servers/*
|
|
||||||
/test/
|
|
||||||
cache/
|
|
||||||
logs/
|
|
||||||
|
|
||||||
/waterfall-*.jar
|
|
||||||
*.log*
|
|
||||||
!.gitkeep
|
|
||||||
|
|
||||||
config.yml
|
|
||||||
modules.yml
|
|
||||||
|
|
3
.vscode/extensions.json
vendored
Normal file
3
.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"recommendations": ["esbenp.prettier-vscode"]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[yaml]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[json]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"[jsonc]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
"cSpell.words": [
|
||||||
|
"AIKAR",
|
||||||
|
"essentialsx",
|
||||||
|
"healthcheck",
|
||||||
|
"itzg",
|
||||||
|
"LPMC",
|
||||||
|
"maintenancemode",
|
||||||
|
"MODRINTH",
|
||||||
|
"pompydev"
|
||||||
|
]
|
||||||
|
}
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2021 developomp
|
Copyright (c) 2021 pompydev
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
94
README.md
94
README.md
|
@ -1,88 +1,16 @@
|
||||||
# [LPMC](https://github.com/developomp/LPMC)
|
# LPMC
|
||||||
|
|
||||||
> **THIS PROJECT IS A WORK IN PROGRESS**
|
- seed: `-4172144997902289642` (2b2t seed)
|
||||||
|
|
||||||
[](./LICENSE)
|
# Tools
|
||||||
[](https://github.com/mvdan/sh)
|
|
||||||
[](https://github.com/prettier/prettier)
|
|
||||||
|
|
||||||
## Updating
|
| Usage | URL |
|
||||||
|
| ------------------: | :--------------------------------------------------------------------- |
|
||||||
|
| Editing chunks | https://github.com/Amulet-Team/Amulet-Map-Editor |
|
||||||
|
| Editing NBT files | https://marketplace.visualstudio.com/items?itemName=Misodee.vscode-nbt |
|
||||||
|
| 3D model extraction | https://github.com/erich666/Mineways |
|
||||||
|
| World inspection | https://github.com/toolbox4minecraft/amidst |
|
||||||
|
|
||||||
> **THIS IS NOT A SETUP INSTRUCTION.**
|
## Sister projects
|
||||||
|
|
||||||
- version: 1.17.1
|
- https://github.com/pompydev/lpmc.pompy.dev
|
||||||
- seed: `-4172144997902289642` for all worlds (yeah it's 2b2t seed)
|
|
||||||
- platform: ubuntu 20.04 on ARM processor and username set to ubuntu.
|
|
||||||
- working directory is project root (`/home/ubuntu/LPMC`).
|
|
||||||
- scripts are executed with user permission and **NOT** with root permission.
|
|
||||||
- worlds should already exist in the [servers](./servers) directory.
|
|
||||||
|
|
||||||
### 1. Download waterfall
|
|
||||||
|
|
||||||
1. [Download](https://papermc.io/downloads#Waterfall) the latest version of waterfall. (latest version as of writing: 451)
|
|
||||||
2. Put it in project root (no need to rename it)
|
|
||||||
|
|
||||||
### 2. Download paper
|
|
||||||
|
|
||||||
1. [Download](https://papermc.io/downloads#Paper-1.17) the latest version of paper version 1.17.1. (latest version as of writing: 353)
|
|
||||||
2. Put it in the [`master`](./master) directory.
|
|
||||||
|
|
||||||
### 3. Download plugins
|
|
||||||
|
|
||||||
- Put them in the [`master`](./master) directory.
|
|
||||||
|
|
||||||
| Plugin | Documentation |
|
|
||||||
| --------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------- |
|
|
||||||
| [EssentialsX](https://dev.bukkit.org/projects/essentialsx/files) | [Documentation](https://essentialsx.net/wiki/Home.html) |
|
|
||||||
| [DiscordSRV](https://dev.bukkit.org/projects/discordsrv/files) | [Documentation](https://docs.discordsrv.com) |
|
|
||||||
| [Core Protect](https://dev.bukkit.org/projects/coreprotect/files) | [Documentation](https://docs.coreprotect.net) |
|
|
||||||
| [World Guard](https://dev.bukkit.org/projects/worldguard/files) | [Documentation](https://worldguard.enginehub.org/en/latest) |
|
|
||||||
| [World Edit](https://dev.bukkit.org/projects/worldedit/files) | [Documentation](https://worldedit.enginehub.org/en/latest) |
|
|
||||||
| [Holographic Displays](https://dev.bukkit.org/projects/holographic-displays/files) | [Documentation](https://filoghost.me/docs/holographic-displays) |
|
|
||||||
| [Illegal Stack](https://www.spigotmc.org/resources/dupe-fixes-illegal-stack-remover.44411) | [Documentation](https://github.com/dniym/IllegalStack/wiki) |
|
|
||||||
| [Skin Restorer](https://www.spigotmc.org/resources/skinsrestorer.2124) | [Documentation](https://github.com/SkinsRestorer/SkinsRestorerX/wiki) |
|
|
||||||
| [Stack Mob](https://www.spigotmc.org/resources/stackmob-enhance-your-servers-performance-without-the-sacrifice.29999) | |
|
|
||||||
|
|
||||||
## Commands & Scripts
|
|
||||||
|
|
||||||
Create systemd files:
|
|
||||||
|
|
||||||
```
|
|
||||||
./scripts/systemd.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Start/Stop using systemd:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo systemctl <start|stop> <lpmc_waterfall|lpmc_lobby|lpmc_smp>
|
|
||||||
```
|
|
||||||
|
|
||||||
Start server manually (<kbd>ctrl</kbd>+<kbd>C</kbd> to stop)
|
|
||||||
|
|
||||||
```
|
|
||||||
./scripts/start.sh <waterfall|lobby|smp>
|
|
||||||
```
|
|
||||||
|
|
||||||
Update plugins and stuff:
|
|
||||||
|
|
||||||
```
|
|
||||||
./scripts/update.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Tools
|
|
||||||
|
|
||||||
- [Editing chunks](https://github.com/Amulet-Team/Amulet-Map-Editor)
|
|
||||||
- [Editing NBT files](https://marketplace.visualstudio.com/items?itemName=Misodee.vscode-nbt)
|
|
||||||
- [World inspection](https://github.com/toolbox4minecraft/amidst)
|
|
||||||
- [3D model extraction](https://github.com/erich666/Mineways)
|
|
||||||
|
|
||||||
## todo
|
|
||||||
|
|
||||||
- rules
|
|
||||||
- no grief
|
|
||||||
- be responsible
|
|
||||||
- break rule = ban
|
|
||||||
|
|
||||||
## Related projects
|
|
||||||
|
|
||||||
- [LPMC website](https://github.com/developomp/lpmc.developomp.com)
|
|
||||||
|
|
47
docker-compose.yml
Normal file
47
docker-compose.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
# https://github.com/YouHaveTrouble/minecraft-optimization
|
||||||
|
|
||||||
|
services:
|
||||||
|
smp:
|
||||||
|
# Paper needs Java 21+. See https://docs.papermc.io/paper/getting-started
|
||||||
|
# https://docker-minecraft-server.readthedocs.io/en/latest/versions/java/
|
||||||
|
image: "itzg/minecraft-server:java23"
|
||||||
|
environment: # https://docker-minecraft-server.readthedocs.io/en/latest/variables/#server
|
||||||
|
# Server
|
||||||
|
# https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/server-types/paper/
|
||||||
|
# https://papermc.io/downloads/all
|
||||||
|
TYPE: PAPER
|
||||||
|
VERSION: 1.21.4
|
||||||
|
PAPER_BUILD: 225
|
||||||
|
MODS_FILE: "/extras/mods.txt" # https://docker-minecraft-server.readthedocs.io/en/latest/mods-and-plugins/#modplugin-url-listing-file
|
||||||
|
RCON_PASSWORD: password # https://docker-minecraft-server.readthedocs.io/en/latest/variables/#rcon
|
||||||
|
|
||||||
|
# Whitelist
|
||||||
|
# https://docker-minecraft-server.readthedocs.io/en/latest/variables/#whitelist
|
||||||
|
ENABLE_WHITELIST: true
|
||||||
|
WHITELIST_FILE: "/extras/whitelist.json"
|
||||||
|
|
||||||
|
# Info
|
||||||
|
ICON: https://raw.githubusercontent.com/pompydev/LPMC/refs/heads/master/server-icon.png
|
||||||
|
SERVER_NAME: LPMC
|
||||||
|
MOTD: "LP but MC"
|
||||||
|
|
||||||
|
# Performance
|
||||||
|
MEMORY: 8G # https://docker-minecraft-server.readthedocs.io/en/latest/configuration/jvm-options/#memory-limit
|
||||||
|
USE_AIKAR_FLAGS: true # https://docker-minecraft-server.readthedocs.io/en/latest/configuration/jvm-options/#enable-aikars-flags
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
EULA: true
|
||||||
|
GUI: false # https://docker-minecraft-server.readthedocs.io/en/latest/configuration/misc-options/#explicitly-disable-gui
|
||||||
|
ports:
|
||||||
|
- "25565:25565"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
- ./mods.txt:/extras/mods.txt:ro
|
||||||
|
- ./whitelist.json:/extras/whitelist.json:ro
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
["CMD", "/usr/local/bin/mc-monitor", "status", "--host", "localhost"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 15
|
||||||
|
# https://github.com/itzg/docker-mc-backup
|
|
@ -1 +0,0 @@
|
||||||
ssh -i secret/ssh-key.key ubuntu@server.lpmc.developomp.com
|
|
|
@ -1,71 +0,0 @@
|
||||||
# usage: scripts/start.sh <OPTION HERE>
|
|
||||||
|
|
||||||
AVAILABLE_OPTIONS=(
|
|
||||||
waterfall
|
|
||||||
lobby
|
|
||||||
smp
|
|
||||||
)
|
|
||||||
|
|
||||||
# uncomment if you need specific version of java
|
|
||||||
# JAVA=/usr/lib/jvm/java-17-openjdk/bin/java
|
|
||||||
if [ -z ${JAVA+x} ]; then
|
|
||||||
JAVA=java
|
|
||||||
fi
|
|
||||||
|
|
||||||
start_waterfall() {
|
|
||||||
echo "starting waterfall"
|
|
||||||
|
|
||||||
WATERFALL=$(find . -maxdepth 1 -type f -name waterfall*.jar)
|
|
||||||
$JAVA -Xmx128M -Xms128M -jar $WATERFALL
|
|
||||||
}
|
|
||||||
|
|
||||||
start_paper() {
|
|
||||||
# $1: working directory
|
|
||||||
# $2: RAM
|
|
||||||
|
|
||||||
cd $1
|
|
||||||
|
|
||||||
# https://blog.airplane.gg/aikar-flags/#how-to-use-the-flags
|
|
||||||
$JAVA -Xms$2 -Xmx$2 \
|
|
||||||
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch \
|
|
||||||
-XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 \
|
|
||||||
-XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M \
|
|
||||||
-XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true \
|
|
||||||
-jar paper.jar nogui
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
start_lobby() {
|
|
||||||
start_paper "servers/lobby" "1G"
|
|
||||||
}
|
|
||||||
|
|
||||||
start_smp() {
|
|
||||||
start_paper "servers/smp" "3G"
|
|
||||||
}
|
|
||||||
|
|
||||||
# check arguments
|
|
||||||
|
|
||||||
if [[ ! " ${AVAILABLE_OPTIONS[*]} " =~ " ${1} " ]]; then
|
|
||||||
echo "invalid argument: ${1}"
|
|
||||||
echo "available options are:"
|
|
||||||
for i in "${AVAILABLE_OPTIONS[@]}"; do
|
|
||||||
echo " - ${i}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
waterfall)
|
|
||||||
start_waterfall
|
|
||||||
;;
|
|
||||||
|
|
||||||
lobby)
|
|
||||||
start_lobby
|
|
||||||
;;
|
|
||||||
|
|
||||||
smp)
|
|
||||||
start_smp
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unknown option: $1"
|
|
||||||
;;
|
|
||||||
esac
|
|
|
@ -1,2 +0,0 @@
|
||||||
rm /etc/systemd/system/lpmc_*
|
|
||||||
cp services/* /etc/systemd/system
|
|
|
@ -1,117 +0,0 @@
|
||||||
# update plugins and stuff
|
|
||||||
|
|
||||||
BOLD=$(tput bold)
|
|
||||||
NORMAL=$(tput sgr0)
|
|
||||||
|
|
||||||
WORKING_ON="waterfall"
|
|
||||||
PLUGINS_DIR="plugins"
|
|
||||||
|
|
||||||
WATERFALL_PLUGINS=(
|
|
||||||
"SkinsRestorer"
|
|
||||||
)
|
|
||||||
LOBBY_SERVER_PLUGINS=(
|
|
||||||
"CoreProtect"
|
|
||||||
"DiscordSRV"
|
|
||||||
"EssentialsX"
|
|
||||||
"HolographicDisplays"
|
|
||||||
"SkinsRestorer"
|
|
||||||
"worldEdit"
|
|
||||||
"worldGuard"
|
|
||||||
)
|
|
||||||
SMP_SERVER_PLUGINS=(
|
|
||||||
"CoreProtect"
|
|
||||||
"EssentialsX"
|
|
||||||
"IllegalStack"
|
|
||||||
"SkinsRestorer"
|
|
||||||
"StackMob"
|
|
||||||
"worldEdit"
|
|
||||||
"worldGuard"
|
|
||||||
)
|
|
||||||
|
|
||||||
bold() {
|
|
||||||
echo "${BOLD}$@${NORMAL}"
|
|
||||||
}
|
|
||||||
|
|
||||||
updating() {
|
|
||||||
echo " updating $*"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_plugins_dir() {
|
|
||||||
case "$WORKING_ON" in
|
|
||||||
waterfall)
|
|
||||||
PLUGINS_DIR="plugins"
|
|
||||||
;;
|
|
||||||
|
|
||||||
lobby)
|
|
||||||
PLUGINS_DIR="servers/lobby/plugins"
|
|
||||||
;;
|
|
||||||
|
|
||||||
smp)
|
|
||||||
PLUGINS_DIR="servers/smp/plugins"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
### setup functions
|
|
||||||
|
|
||||||
setup_paperMC() {
|
|
||||||
# make paper.jar symlink in each server folder
|
|
||||||
|
|
||||||
# get the first search result for paper-*.jar
|
|
||||||
PAPER_FILE=$(find master -type f -name "paper-*.jar" | head -n 1)
|
|
||||||
|
|
||||||
# get directories in ./servers directory
|
|
||||||
SERVER_DIRS=($(find servers -maxdepth 1 -type d -not -path "servers"))
|
|
||||||
|
|
||||||
# make/replace symbolic link for paperMC
|
|
||||||
for SERVER_DIR in "${SERVER_DIRS[@]}"; do
|
|
||||||
PAPER_SYMLINK_PATH="$SERVER_DIR/paper.jar"
|
|
||||||
|
|
||||||
# check if symlink exists
|
|
||||||
if [ -L $PAPER_SYMLINK_PATH ]; then
|
|
||||||
rm $PAPER_SYMLINK_PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
# copy paper.jar file
|
|
||||||
cp "$PAPER_FILE" $PAPER_SYMLINK_PATH
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_plugin() {
|
|
||||||
updating "$1"
|
|
||||||
|
|
||||||
# find jar file
|
|
||||||
ORIGINAL_JAR=$(find master -iname $1*.jar)
|
|
||||||
get_plugins_dir
|
|
||||||
NEW_JAR="$PLUGINS_DIR/$1.jar"
|
|
||||||
|
|
||||||
# remove existing plugin symlink
|
|
||||||
rm $NEW_JAR >/dev/null 2>&1
|
|
||||||
|
|
||||||
# create (new) symlink
|
|
||||||
cp $ORIGINAL_JAR $NEW_JAR
|
|
||||||
}
|
|
||||||
|
|
||||||
### MAIN
|
|
||||||
|
|
||||||
bold "setting up paperMC"
|
|
||||||
setup_paperMC
|
|
||||||
|
|
||||||
bold "setting up waterfall plugins"
|
|
||||||
for i in "${WATERFALL_PLUGINS[@]}"; do
|
|
||||||
setup_plugin $i
|
|
||||||
done
|
|
||||||
|
|
||||||
WORKING_ON="lobby"
|
|
||||||
bold "setting up lobby plugins"
|
|
||||||
for i in "${LOBBY_SERVER_PLUGINS[@]}"; do
|
|
||||||
setup_plugin $i
|
|
||||||
done
|
|
||||||
|
|
||||||
WORKING_ON="smp"
|
|
||||||
bold "setting up smp plugins"
|
|
||||||
for i in "${SMP_SERVER_PLUGINS[@]}"; do
|
|
||||||
setup_plugin $i
|
|
||||||
done
|
|
|
@ -1,4 +0,0 @@
|
||||||
[Service]
|
|
||||||
ExecStart=bash /home/ubuntu/LPMC/scripts/start.sh lobby
|
|
||||||
Restart=on-failure
|
|
||||||
WorkingDirectory=/home/ubuntu/LPMC
|
|
|
@ -1,4 +0,0 @@
|
||||||
[Service]
|
|
||||||
ExecStart=bash /home/ubuntu/LPMC/scripts/start.sh smp
|
|
||||||
Restart=on-failure
|
|
||||||
WorkingDirectory=/home/ubuntu/LPMC
|
|
|
@ -1,4 +0,0 @@
|
||||||
[Service]
|
|
||||||
ExecStart=bash /home/ubuntu/LPMC/scripts/start.sh waterfall
|
|
||||||
Restart=on-failure
|
|
||||||
WorkingDirectory=/home/ubuntu/LPMC
|
|
|
@ -1,8 +0,0 @@
|
||||||
use_netty_dns_resolver: true
|
|
||||||
disable_modern_tab_limiter: true
|
|
||||||
log_initial_handler_connections: true
|
|
||||||
throttling:
|
|
||||||
tab_complete: 1000
|
|
||||||
game_version: ""
|
|
||||||
disable_tab_list_rewrite: false
|
|
||||||
disable_entity_metadata_rewrite: false
|
|
Loading…
Add table
Add a link
Reference in a new issue