@ -23,3 +23,7 @@ threads=$(options-get threads) || exit 1
mem=$(options-get mem) || exit 1
minecraft:init-command "$threads" "$mem"
whitelist=$(options-get whitelist) || true
minecraft:make-whitelist "$whitelist"
@ -37,3 +37,15 @@ $SERVICE_NAME:
"
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"