Browse Source

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

odoo_fix_webhook_url
Valentin Lab 12 months 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
minecraft:make-whitelist "$whitelist"
ops=$(options-get ops) || true
minecraft:make-ops "$ops"

15
minecraft/lib/common

@ -48,4 +48,19 @@ minecraft:make-whitelist() {
'to_entries | map({"uuid": .key, "name": .value})'
} > "$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