Browse Source

new: [minecraft] support of ``whitelist`` option

odoo_fix_webhook_url
Valentin Lab 2 years ago
parent
commit
fd651aa3a2
  1. 6
      minecraft/hooks/init
  2. 12
      minecraft/lib/common

6
minecraft/hooks/init

@ -22,4 +22,8 @@ minecraft:init-binary "$version"
threads=$(options-get threads) || exit 1 threads=$(options-get threads) || exit 1
mem=$(options-get mem) || exit 1 mem=$(options-get mem) || exit 1
minecraft:init-command "$threads" "$mem"
minecraft:init-command "$threads" "$mem"
whitelist=$(options-get whitelist) || true
minecraft:make-whitelist "$whitelist"

12
minecraft/lib/common

@ -36,4 +36,16 @@ $SERVICE_NAME:
- nogui - nogui
" "
echo "eula=TRUE" > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/eula.txt" echo "eula=TRUE" > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/eula.txt"
}
minecraft:make-whitelist() {
local whitelist="$1"
{
e "$whitelist" |
yq -o=json \
'to_entries | map({"uuid": .key, "name": .value})'
} > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/whitelist.json"
} }
Loading…
Cancel
Save