Rohan Verma



Tree


.gitignorecommits | blame
README.mdcommits | blame
build.gradlecommits | blame
gradle/
gradle.propertiescommits | blame
gradlew*commits | blame
gradlew.batcommits | blame
libs/
settings.gradlecommits | blame
src/

README.md

# AeronauticsCompat 1.0.0

A compatibility-patch mod for [Create: Aeronautics](https://github.com/Creators-of-Aeronautics/Simulated-Project) / [Sable](https://github.com/ryanhcode/sable) sub-levels (NeoForge 1.21.1).

All patches are **soft dependencies** — each one applies only when its target mod is installed. Uninstalling any of the target mods is safe; AeronauticsCompat stays loaded and continues to patch whatever else is present.

## Patches

### Etched × Sable: music discs on contraptions stop correctly
**Problem.** On a moving Sable contraption (e.g., Create: Aeronautics ship), music discs never stop playing after the disc is ejected. Affects **every** disc — vanilla, datapack, and Etched YouTube discs — as long as Etched is installed.

**Cause.** Etched's `LevelRendererMixin.modifySoundInstance` wraps every jukebox sound in `StopListeningSound`, which doesn't extend `AbstractSoundInstance`, so Sable's `AbstractSoundInstanceMixin` (which implements `SoundInstanceDelegated`) doesn't apply. On stop, Sable can't unwrap the sound to the `MovingSoundInstanceDelegate` keyed in OpenAL; the stop lookup misses and the sound plays forever.

**Fix.** Mixin `StopListeningSound implements SoundInstanceDelegated`, holding a `MovingSoundInstanceDelegate` back-reference. Sable's constructor now stores the wrapper on us at play-time and reads it back at stop-time. OpenAL's channel key matches on both ends.

*Activates when: Etched + Sable are both installed.*

### WaterFrames × Sable: TV audio on contraptions is audible
**Problem.** On a moving Sable contraption, WaterFrames TVs/projectors are silent, even at point-blank range. Video plays fine.

**Cause.** WaterFrames attenuates audio by the Euclidean distance from the block to the player. On a Sable contraption, the block's logical position is in a sub-level at coordinates millions of blocks from the player's world-space position, so the computed distance is astronomical and the volume is clamped to zero.

**Fix.** Mixin `@Inject` at HEAD of `WaterFrames.getDistance(Level, BlockPos, Position)`; when Sable is present, short-circuit to `Math.sqrt(SableCompanion.distanceSquaredWithSubLevels(level, Vec3.atCenterOf(pos), playerPos))`. This mirrors WaterFrames' existing Valkyrien Skies compat path exactly.

*Activates when: WaterFrames + Sable are both installed.*

## Optional: YouTube source for Etched

Also includes the legacy Etchtube YouTube-via-yt-dlp source, gated on Etched being installed. Configure the proxy URL and bearer token under `YoutubeProxy.URL` / `YoutubeProxy.Token` in `config/aeronauticscompat-client.toml`. Leave empty to disable. Not required for the patches above.

## Dependencies

- **Required**: NeoForge 1.21.1
- **Optional** (each enables one or more patches): Sable, Etched, WaterFrames

No target mod is a hard dependency. The mod loads and logs which patches are active on startup.

## Building

```
./gradlew build
```

No external jars required in `libs/`. Compile-time stubs for Sable and WaterFrames live in `src/stubs/java/` and are excluded from the output jar. If you want to cross-compile against a real Etched jar (e.g., to rebuild the YouTube source), drop `etched.jar` in `libs/`.

## License

GPLv3.