All checks were successful
Build & Release Pack / build (push) Successful in 1m51s
tdwcm 0.2.1 registered ~31 payloads via playBidirectional without .optional() AND registers real blocks/items/entities, so a one-sided install fails login twice (required-channel mismatch, then registry sync). Ship ASM-patched jar (tools/patches/build_patched_tdwcm.sh, TdwcmPatcher.java) that inserts registrar.optional(), and add it to server_pack so negotiation and registry sync pass on both sides. Verified: dedicated server boots clean (Done ~27s), tdwcm:tardis_interior dimension comes up under Sable physics + IPSable portal storage. Audit: no other client-only mod in the pack uses NeoForge's payload API.
55 lines
2.4 KiB
Bash
55 lines
2.4 KiB
Bash
#!/usr/bin/env bash
|
|
# SCICRAFT — rebuild tdwcm with optional network channels.
|
|
#
|
|
# Why: THE Doctor Who Client Mod 0.2.1 registers all its payloads via
|
|
# PayloadRegistrar.playBidirectional WITHOUT .optional(), so clients carrying
|
|
# it are rejected by any server without the mod ("tdwcm:entity_rotation_sync +
|
|
# 30 more channels missing"). The mod is client-side-only in this pack, so we
|
|
# patch NetworkRegistry.register() to call registrar.optional() — absent
|
|
# payloads are then skipped in negotiation instead of failing login.
|
|
#
|
|
# Usage: tools/patches/build_patched_tdwcm.sh (from repo root)
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
TDWCM_URL="https://cdn.modrinth.com/data/96oAiXlp/versions/xpTvgljr/tdwcm-0.2.1.jar"
|
|
OUT_JAR="tdwcm-0.2.1-patched.jar"
|
|
WORK="$(mktemp -d)"
|
|
trap 'rm -rf "$WORK"' EXIT
|
|
|
|
echo "[patch] downloading original..."
|
|
curl -fsSL -o "$WORK/tdwcm.jar" "$TDWCM_URL"
|
|
|
|
if [ ! -f asm.jar ]; then
|
|
echo "[patch] fetching ASM..."
|
|
curl -fsSL -o asm.jar https://repo1.maven.org/maven2/org/ow2/asm/asm/9.7.1/asm-9.7.1.jar
|
|
curl -fsSL -o asm-tree.jar https://repo1.maven.org/maven2/org/ow2/asm/asm-tree/9.7.1/asm-tree-9.7.1.jar
|
|
fi
|
|
|
|
# Neoforge universal jar for COMPUTE_FRAMES hierarchy resolution
|
|
NFG="${NEOFORGE_UNIVERSAL:-$WORK/neoforge-universal.jar}"
|
|
if [ ! -f "$NFG" ]; then
|
|
curl -fsSL -o "$WORK/neoforge-universal.jar" \
|
|
https://maven.neoforged.net/releases/net/neoforged/neoforge/21.1.248/neoforge-21.1.248-universal.jar
|
|
NFG="$WORK/neoforge-universal.jar"
|
|
fi
|
|
|
|
echo "[patch] compiling + running patcher..."
|
|
javac -cp asm.jar:asm-tree.jar TdwcmPatcher.java
|
|
unzip -q "$WORK/tdwcm.jar" "net/dumonde/tdwcm/networking/NetworkRegistry.class" -d "$WORK/x"
|
|
java -cp ".:asm.jar:asm-tree.jar:$WORK/tdwcm.jar:$NFG" TdwcmPatcher \
|
|
"$WORK/x/net/dumonde/tdwcm/networking/NetworkRegistry.class" \
|
|
"$WORK/NetworkRegistry.class"
|
|
|
|
echo "[patch] rebuilding jar..."
|
|
cp "$WORK/tdwcm.jar" "$OUT_JAR"
|
|
mkdir -p "$WORK/stage/net/dumonde/tdwcm/networking"
|
|
cp "$WORK/NetworkRegistry.class" "$WORK/stage/net/dumonde/tdwcm/networking/"
|
|
(cd "$WORK/stage" && jar uf "$OLDPWD/$OUT_JAR" net)
|
|
|
|
echo "[patch] verifying patched class inside jar..."
|
|
unzip -p "$OUT_JAR" net/dumonde/tdwcm/networking/NetworkRegistry.class > "$WORK/after.class"
|
|
cmp -s "$WORK/x/net/dumonde/tdwcm/networking/NetworkRegistry.class" "$WORK/after.class" \
|
|
&& { echo "[patch] ERROR: class unchanged"; exit 1; }
|
|
sha512sum "$OUT_JAR"
|
|
echo "[patch] done → $OUT_JAR"
|