From 7e34cf5ac9616d621b34a4c60f91a842ecd69c1e Mon Sep 17 00:00:00 2001 From: Alexander Grein Date: Fri, 28 Dec 2018 09:56:28 +0100 Subject: [PATCH 1/2] Add JVM_DD_OPTS to add -D Params to JVM_OPTS Fix for #177 --- minecraft-server/start-minecraftFinalSetup | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/minecraft-server/start-minecraftFinalSetup b/minecraft-server/start-minecraftFinalSetup index cfe52dd7..f0466650 100755 --- a/minecraft-server/start-minecraftFinalSetup +++ b/minecraft-server/start-minecraftFinalSetup @@ -99,6 +99,13 @@ else if [ -f /data/bootstrap.txt ]; then bootstrapArgs="--bootstrap /data/bootstrap.txt" fi + + if [ -n "$JVM_DD_OPTS" ]; then + for dopt in $JVM_DD_OPTS + do + JVM_OPTS="${JVM_OPTS} -D${dopt/:/=}" + done + fi JVM_OPTS="-Xms${INIT_MEMORY} -Xmx${MAX_MEMORY} ${JVM_OPTS}" exec mc-server-runner ${bootstrapArgs} java $JVM_XX_OPTS $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS From ddbd88c601b9c6a2fa7aba379323c2ee28dfbc05 Mon Sep 17 00:00:00 2001 From: Alexander Grein Date: Fri, 28 Dec 2018 10:16:15 +0100 Subject: [PATCH 2/2] Add documentation for the new JVM_DD_OPTS parameter Fix for #177 --- minecraft-server/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/minecraft-server/README.md b/minecraft-server/README.md index 183d8e06..e9da676e 100644 --- a/minecraft-server/README.md +++ b/minecraft-server/README.md @@ -769,6 +769,9 @@ General JVM options can be passed to the Minecraft Server invocation by passing environment variable. Options like `-X` that need to proceed general JVM options can be passed via a `JVM_XX_OPTS` environment variable. +For some cases, if e.g. after removing mods, it could be necessary to startup minecraft with an additional `-D` parameter like `-Dfml.queryResult=confirm`. To address this you can use the environment variable `JVM_DD_OPTS`, which builds the params from a given list of values separated by space, but without the `-D` prefix. To make things running under systems (e.g. Plesk), which doesn't allow `=` inside values, a `:` (colon) could be used instead. The upper example would look like this: +`JVM_DD_OPTS=fml.queryResult:confirm`, and will be converted to `-Dfml.queryResult=confirm`. + ### HTTP Proxy You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`