Browse Source

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

odoo_fix_webhook_url
Valentin Lab 2 years ago
parent
commit
9afff9f304
  1. 3
      minecraft/hooks/init
  2. 15
      minecraft/lib/common

3
minecraft/hooks/init

@ -27,3 +27,6 @@ minecraft:init-command "$threads" "$mem"
whitelist=$(options-get whitelist) || true whitelist=$(options-get whitelist) || true
minecraft:make-whitelist "$whitelist" minecraft:make-whitelist "$whitelist"
ops=$(options-get ops) || true
minecraft:make-ops "$ops"

15
minecraft/lib/common

@ -49,3 +49,18 @@ minecraft:make-whitelist() {
} > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/whitelist.json" } > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/whitelist.json"
} }
minecraft:make-ops() {
local ops="$1"
{
e "$ops" |
yq -o=json \
'to_entries | map({
"uuid": .value.uuid,
"name": .key,
"level": .value.level,
"bypassesPlayerLimit": .value.bypassesPlayerLimit
})'
} > "$SERVICE_DATASTORE/${MINECRAFT_DATA}/ops.json"
}
Loading…
Cancel
Save