1
0
Fork 0

Some Minecraft changes

This commit is contained in:
Avery 2025-06-28 00:09:06 +02:00
parent 037230706c
commit 49271c6b74
Signed by: Avery
GPG key ID: B684FD451B692E04
2 changed files with 4 additions and 2 deletions

View file

@ -6,13 +6,14 @@ let
packageNameToHumanString = packageName: packageNameToHumanString = packageName:
(let (let
getSections = packageName: getSections = packageName:
# Probably only matches Fabric servers, change as needed
builtins.match builtins.match
"^minecraft-server-([0-9a-zA-Z.]*)-([a-zA-Z-]*)-([0-9a-zA-Z.]*)$" "^minecraft-server-([0-9a-zA-Z.]*)-([a-zA-Z-]*)-([0-9a-zA-Z.]*)$"
packageName; packageName;
sections = (getSections packageName); sections = (getSections packageName);
getSection = idx: getSection = idx:
if sections == null then "Unknown" else builtins.elemAt sections idx; if sections == null then "Unknown" else builtins.elemAt sections idx;
in "Minecraft Server ${getSection 0} with ${ in "Minecraft ${getSection 0} with ${
lib.strings.toSentenceCase (getSection 1) lib.strings.toSentenceCase (getSection 1)
} ${getSection 2}"); } ${getSection 2}");
playersToOps = players: playersToOps = players:
@ -98,7 +99,7 @@ in {
}; };
files = { files = {
"ops.json".value = playersToOps (with players; [ engullejamones ]); "ops.json".value = playersToOps (with players; [ engullejamones ]);
"whitelist.json".value = with players; [ engullejamones ]; "whitelist.json".value = with players; [ engullejamones dankoszz ];
}; };
}; };
}; };

View file

@ -7,4 +7,5 @@ builtins.listToAttrs (map (player: {
}) [ }) [
[ "engullejamones" "b65a1bc3-c6a0-4e8c-99b8-3538cfec0cfc" ] [ "engullejamones" "b65a1bc3-c6a0-4e8c-99b8-3538cfec0cfc" ]
[ "dankoszz" "87b47db0-4dd3-469c-8dfd-c21095dadd93" ]
]) ])