mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 13:52:27 +00:00
Fixed /plugins support for Paper servers
This commit is contained in:
parent
26cc3943ce
commit
4bbc7d142f
5 changed files with 27 additions and 9 deletions
5
examples/paper-build-plugins/Dockerfile
Normal file
5
examples/paper-build-plugins/Dockerfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
FROM itzg/minecraft-server
|
||||
|
||||
ENV TYPE=PAPER
|
||||
|
||||
COPY plugins/*.jar /plugins/
|
9
examples/paper-build-plugins/docker-compose.yml
Normal file
9
examples/paper-build-plugins/docker-compose.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
mc:
|
||||
build: .
|
||||
environment:
|
||||
EULA: "TRUE"
|
||||
ports:
|
||||
- 25565:25565
|
1
examples/paper-build-plugins/plugins/.gitignore
vendored
Normal file
1
examples/paper-build-plugins/plugins/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.jar
|
1
examples/paper-build-plugins/plugins/README.md
Normal file
1
examples/paper-build-plugins/plugins/README.md
Normal 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.
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue