修复 Create: Aeronautics(机械动力航空学)中显示链接器(Display Link)在物理化/反物理化后 TargetOffset 被损坏的问题。覆盖所有场景:无论告示牌在飞行器上、在地面、还是在另一飞行器上。
Sable 物理化时通过 saveWithFullMetadata / loadWithComponents 搬运方块实体。
物理化空间中,DisplayLink 的 target() 方法使用物理化空间坐标计算相对偏移:
offset = 告示牌物理化坐标 - DisplayLink物理化坐标
→ 产生巨大异常值(如 -20481038)
这个损坏的偏移被持久化到 NBT 中,反物理化后带回真实世界,导致 DisplayLink 无法正确寻址告示牌。
通过 Mixin 注入 Sable 的 SubLevelAssemblyHelper.moveBlocks():
loadWithComponents 之前):捕获所有正在移动的 DisplayLink 的原始 TargetOffset,
并预计算正确的旋转结果 correctedOffset = originalOffset.rotate(rot)moveBlocks TAIL):无条件将每个 DisplayLink 的 TargetOffset 恢复为正确值不再需要 Case 3 检测——任何被物理化的 DisplayLink 都要保护。
adlf-common.toml 中 debug = true 开启详细追踪| 版本 | 说明 |
|---|---|
| v1.3 | 全面保护:移除 Case 3 检测,无条件保护所有 DisplayLink |
| v1.2.3 | 大型结构性能优化(O(n²) → O(n)) |
| v1.2 | 旋转感知偏移修正 + 配置文件 |
| v1.1 | 初始修复:双层 Case 3 判定 |
# 前置条件:JDK 21
git clone <repo>
cd Aeronautics-display-link-fix
./gradlew build
# jar 输出:build/libs/aeronautics_display_link_fix-<version>.jar
Fixes a bug in Create: Aeronautics where the Display Link's TargetOffset gets
corrupted during physics assembly/disassembly. Covers all scenarios: regardless
of whether the target sign is on the same contraption, on the ground, or on a
different contraption.
During physics assembly, Sable moves block entities via
saveWithFullMetadata / loadWithComponents. In the physics sublevel space,
the DisplayLink's target() method computes its relative offset using sublevel
coordinates:
offset = signSublevelPos - DLSublevelPos
→ huge garbage value (e.g. -20481038)
This corrupted offset gets persisted in NBT and carried back to the real world after disassembly, breaking the DisplayLink's targeting.
A Mixin injects into Sable's SubLevelAssemblyHelper.moveBlocks():
loadWithComponents): Captures the original TargetOffset
of every moving DisplayLink and pre-computes the correct rotated value:
correctedOffset = originalOffset.rotate(rot)moveBlocks TAIL): Unconditionally restores each DisplayLink's
TargetOffset to the correct valueNo more Case 3 detection — every DisplayLink being moved needs protection.
debug = true in adlf-common.toml for detailed tracing| Version | Description |
|---|---|
| v1.3 | Universal protection: removed Case 3 detection, protect all DisplayLinks unconditionally |
| v1.2.3 | Large structure performance optimization (O(n²) → O(n)) |
| v1.2 | Rotation-aware offset correction + config file |
| v1.1 | Initial fix: two-layer Case 3 detection |
# Prerequisites: JDK 21
git clone <repo>
cd Aeronautics-display-link-fix
./gradlew build
# Output: build/libs/aeronautics_display_link_fix-<version>.jar