HomeJavaModsAeronautics Display Link Fix
Aeronautics Display Link Fix
ModsJava

Aeronautics Display Link Fix

by FQO3 · on Modrinth

Fixes a bug where Display Link's TargetOffset gets corrupted during physics assembly/disassembly when the display link and its target sign are on the same…

⬇ Download on Modrinth

Aeronautics Display Link Fix [ADLF]

航空学显示链接器修复 [ADLF]

中文 | English


中文

简介

修复 Create: Aeronautics(机械动力航空学)中显示链接器(Display Link)在物理化/反物理化后 TargetOffset 被损坏的问题。覆盖所有场景:无论告示牌在飞行器上、在地面、还是在另一飞行器上。

问题根源

Sable 物理化时通过 saveWithFullMetadata / loadWithComponents 搬运方块实体。 物理化空间中,DisplayLink 的 target() 方法使用物理化空间坐标计算相对偏移:

offset = 告示牌物理化坐标 - DisplayLink物理化坐标
     → 产生巨大异常值(如 -20481038)

这个损坏的偏移被持久化到 NBT 中,反物理化后带回真实世界,导致 DisplayLink 无法正确寻址告示牌。

修复原理

通过 Mixin 注入 Sable 的 SubLevelAssemblyHelper.moveBlocks()

  1. Phase 1loadWithComponents 之前):捕获所有正在移动的 DisplayLink 的原始 TargetOffset, 并预计算正确的旋转结果 correctedOffset = originalOffset.rotate(rot)
  2. Phase 2moveBlocks TAIL):无条件将每个 DisplayLink 的 TargetOffset 恢复为正确值

不再需要 Case 3 检测——任何被物理化的 DisplayLink 都要保护。

特性

版本历史

版本 说明
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

依赖

注意事项


English

Overview

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.

Root Cause

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.

How It Works

A Mixin injects into Sable's SubLevelAssemblyHelper.moveBlocks():

  1. Phase 1 (before loadWithComponents): Captures the original TargetOffset of every moving DisplayLink and pre-computes the correct rotated value: correctedOffset = originalOffset.rotate(rot)
  2. Phase 2 (moveBlocks TAIL): Unconditionally restores each DisplayLink's TargetOffset to the correct value

No more Case 3 detection — every DisplayLink being moved needs protection.

Features

Version History

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

Build

# Prerequisites: JDK 21
git clone <repo>
cd Aeronautics-display-link-fix
./gradlew build
# Output: build/libs/aeronautics_display_link_fix-<version>.jar

Dependencies

Notes

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more