automatic setup off the main thread: the vanilla resource pack is downloaded from mojang when none is present (client jar of the server version, sha1 and size from the manifest, https only, timeouts, size limit) and replaced after a minecraft update (version stamp or vanilla-<version>.zip, old pack keeps rendering until then and goes to backup/), photos refused with a clear message until ready, packs of other versions left out, coverage check of block states and item definitions, entity dump version checked against the server (outdated override ignored), new config options added to existing configs, pack script stamps and verifies
This commit is contained in:
1 parent
be94c33ea6
commit
492bcb3a39
8 files changed
+1025
-123
No files matched your search
@@ -1,11 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Builds the runtime resource pack PixelPics renders from (blockstates, models, textures, items,
|
||||
# atlases, font) straight from Mojang's CLIENT jar — no launcher install needed. The plugin ships no
|
||||
# assets itself; drop the resulting zip into plugins/PixelPics/resourcepack/. Run it once per
|
||||
# Minecraft update. No pack.mcmeta needed (the client jar has none; the loader detects a zip by its
|
||||
# vanilla blockstate files).
|
||||
# assets itself. The plugin does the same on its own (resource-pack.auto-download/auto-update in
|
||||
# config.yml); use this script for servers without internet access, then drop the zip into
|
||||
# plugins/PixelPics/resourcepack/. No pack.mcmeta needed (the client jar has none; the loader detects
|
||||
# a zip by its vanilla blockstate files). The zip carries a pixelpics-pack.json with the version, so
|
||||
# the plugin's auto-update recognises and replaces it after a Minecraft update.
|
||||
#
|
||||
# Needs: curl, jq, unzip, zip.
|
||||
# Needs: curl, jq, unzip, zip, sha1sum.
|
||||
#
|
||||
# Usage: tools/build-vanilla-pack.sh 26.3 # -> ./vanilla-26.3.zip
|
||||
# tools/build-vanilla-pack.sh 26.3 <output-dir> # -> <output-dir>/vanilla-26.3.zip
|
||||
@@ -22,9 +24,14 @@ META="$(curl -fsS https://piston-meta.mojang.com/mc/game/version_manifest_v2.jso
|
||||
[[ -n "$META" ]] || { echo "Minecraft version $VER not found in Mojang's version manifest"; exit 1; }
|
||||
|
||||
echo "Downloading client jar for $VER ..."
|
||||
curl -fsS -o "$WORK/client.jar" "$(curl -fsS "$META" | jq -r .downloads.client.url)"
|
||||
curl -fsS -o "$WORK/version.json" "$META"
|
||||
SHA1="$(jq -r .downloads.client.sha1 "$WORK/version.json")"
|
||||
curl -fsS -o "$WORK/client.jar" "$(jq -r .downloads.client.url "$WORK/version.json")"
|
||||
echo "$SHA1 $WORK/client.jar" | sha1sum -c --quiet - || { echo "sha1 mismatch for the client jar"; exit 1; }
|
||||
|
||||
unzip -q "$WORK/client.jar" 'assets/minecraft/'{blockstates,models,textures,items,atlases,font}'/*' -d "$WORK/pack"
|
||||
jq -n --arg v "$VER" --arg s "$SHA1" --arg t "$(date -u +%FT%TZ)" \
|
||||
'{version: $v, client_sha1: $s, created: $t, source: "tools/build-vanilla-pack.sh"}' > "$WORK/pack/pixelpics-pack.json"
|
||||
rm -f "$OUT"
|
||||
(cd "$WORK/pack" && zip -qr "$OUT" .)
|
||||
echo "Wrote $OUT ($(unzip -Z1 "$OUT" | grep -vc '/$') files)"
|
||||
Reference in new issue
Block a user