diff --git a/minecraft/hooks/init b/minecraft/hooks/init index ef7f2a5..8612831 100755 --- a/minecraft/hooks/init +++ b/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" diff --git a/minecraft/lib/common b/minecraft/lib/common index b66a318..d9f7102 100644 --- a/minecraft/lib/common +++ b/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" } \ No newline at end of file