Fixed /plugins support for Paper servers

This commit is contained in:
Geoff Bourne 2020-04-04 10:13:51 -05:00
parent 26cc3943ce
commit 4bbc7d142f
5 changed files with 27 additions and 9 deletions

View file

@ -0,0 +1,5 @@
FROM itzg/minecraft-server
ENV TYPE=PAPER
COPY plugins/*.jar /plugins/

View file

@ -0,0 +1,9 @@
version: '3.7'
services:
mc:
build: .
environment:
EULA: "TRUE"
ports:
- 25565:25565

View file

@ -0,0 +1 @@
*.jar

View file

@ -0,0 +1 @@
Download Bukkit/Spigot plugin jars, such as [WorldEdit](https://dev.bukkit.org/projects/worldedit/files) and place them here. At image build time the `COPY` step will place those jars in `/plugins`. At container startup, the contents of `/plugins` are sync'ed into `/data/plugins` for use with Bukkit/Spigot/Paper server types.

View file

@ -64,15 +64,17 @@ do
fi
done
mkdir -p /data/plugins
if [ "$TYPE" = "SPIGOT" ]; then
if [ -d /plugins ]; then
log "Copying any Bukkit plugins over..."
# Copy plugins over using rsync to allow deeply nested updates of plugins
# only updates files if the source file is newer and print updated files
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
fi
fi
case ${TYPE} in
SPIGOT|BUKKIT|PAPER)
mkdir -p /data/plugins
if [ -d /plugins ]; then
log "Copying plugins over..."
# Copy plugins over using rsync to allow deeply nested updates of plugins
# only updates files if the source file is newer and print updated files
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --update /plugins /data
fi
;;
esac
EXTRA_ARGS=""
# Optional disable console