- dump entity models straight from the unobfuscated client jar (tools/VanillaModelDump.java, tools/update-vanilla-models.sh): models posed by vanilla setupAnim, baby/variant/layer models, renderer transforms, default textures, pose variants (sitting, holding items, illager arms) and all layer definitions; the old CEM template is only a fallback now - fix adult zombies captured as babies, zero-thickness planes (wings, fins) and back faces in the entity intersector - held items, head items (pumpkins, skulls), shields, elytra, saddles and body equipment for every mount, armor following the pose - block/item/text display entities, dropped items, falling blocks, primed TNT, minecart contents, block entities inside displays, leash ropes - item models resolved from the 26.x item definitions with display transforms; generated items extruded like vanilla - bundle the vanilla font definitions as fallback so sign/text rendering works with packs that lack font/*.json - one failing entity no longer aborts the whole photo - edge-case test plugin (tools/edgecase-plugin) and offline harnesses
47 lines
1.7 KiB
Bash
Executable File
47 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Updates the bundled CEM entity-model set (the only asset PixelPics vendors itself).
|
|
#
|
|
# Source: the CEM Template Loader data (Ewan Howell / wynem) — vanilla Java entity models as JSON,
|
|
# already correctly posed. These ultimately mirror Mojang's hardcoded Java EntityModel classes.
|
|
#
|
|
# NOTE: this set is now only the FALLBACK (rest-pose geometry) + the block-entity models (chests, signs,
|
|
# heads, banners, armor_layer_*). Mob models come from the vanilla client dump — regenerate that with
|
|
# tools/update-vanilla-models.sh <version> on every Minecraft update.
|
|
#
|
|
# Usage: tools/update-cem-models.sh # update if newer
|
|
# tools/update-cem-models.sh --force # always overwrite
|
|
set -euo pipefail
|
|
|
|
URL="https://wynem.com/assets/json/cem_template_models.json"
|
|
DEST="$(cd "$(dirname "$0")/.." && pwd)/src/main/resources/cem/cem_template_models.json"
|
|
TMP="$(mktemp)"
|
|
trap 'rm -f "$TMP"' EXIT
|
|
|
|
echo "Fetching $URL ..."
|
|
curl -fsSL "$URL" -o "$TMP"
|
|
|
|
# Validate + read versions/counts.
|
|
read -r NEW_VER NEW_COUNT < <(python3 -c "
|
|
import json,sys
|
|
d=json.load(open('$TMP'))
|
|
assert 'models' in d and len(d['models'])>50, 'unexpected structure'
|
|
print(d.get('version','?'), len(d['models']))
|
|
")
|
|
|
|
CUR_VER="(none)"
|
|
if [ -f "$DEST" ]; then
|
|
CUR_VER="$(python3 -c "import json;print(json.load(open('$DEST')).get('version','?'))" 2>/dev/null || echo '?')"
|
|
fi
|
|
|
|
echo "Current: $CUR_VER Remote: $NEW_VER ($NEW_COUNT models)"
|
|
|
|
if [ "${1:-}" != "--force" ] && [ "$CUR_VER" = "$NEW_VER" ]; then
|
|
echo "Already up to date. (use --force to overwrite)"
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p "$(dirname "$DEST")"
|
|
cp "$TMP" "$DEST"
|
|
echo "Updated -> $DEST (version $NEW_VER, $NEW_COUNT models)"
|
|
echo "Rebuild/redeploy the plugin to apply."
|