Skip to content
A00826925Public

About

Immersive Music and Music Packs for Minecraft

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Immersive Music for Minecraft 1.21.1

The 1.21.1 port of the mod, for NeoForge and Fabric. It's a standalone Gradle build; the 1.20.1 build (Forge, NeoForge, Fabric) lives at the repository root. Features, pack format and commands are the same in both.

Building

Requires JDK 21 (Gradle downloads one if it isn't installed). From this folder:

./gradlew build
Loader Jar
NeoForge 21.1 neoforge/build/libs/immersivemusic-neoforge-1.0.0+1.21.1.jar
Fabric (needs Fabric API) fabric/build/libs/immersivemusic-fabric-1.0.0+1.21.1.jar

Neither needs Architectury API installed. JLayer (MP3 decoding) is bundled under the mod's own package, so it can't clash with another mod's copy.

Packs

Music packs work unchanged. The bundled vanilla and Aquamirae packs declare "supported_formats": [15, 34], so the same zip loads on 1.20.1 (format 15) and 1.21.1 (format 34). For your own packs, add the same line to pack.mcmeta, or Minecraft 1.21.1 marks the pack as made for an older version.

Why there's no Forge build

Forge 1.21.1 (52.x) still runs on SRG names. Architectury Loom's remap to them fails on 1.21.1 with "Unfixable conflicts" in Minecraft's own network payload classes, and Architectury dropped Forge support after 1.20.4. A Forge 1.21.1 build would need its own ForgeGradle project.

What differs from the 1.20.1 code

  • new ResourceLocation(...) became ResourceLocation.fromNamespaceAndPath(...) (the constructors are private in 1.21), in 6 places.
  • immersivemusic.mixins.json: Java 21, and no refmap. Loom 1.14 remaps mixins in the jar directly (Fabric) and NeoForge runs on Mojang names.
  • The mod's own pack.mcmeta is format 34.
  • NeoForge: rewritten entrypoint (net.neoforged APIs, mod bus passed to the constructor, dist = Dist.CLIENT), neoforge.mods.toml with a [[mixins]] entry, and PlatformImpl in the integration.neoforge package.
  • Fabric: fabric.mod.json requires Minecraft 1.21.1 and Java 21.
  • Structure sync (see "Servers" in the root README): 1.21 networking is payload-based, so the two messages are records in common/.../net/StructurePayloads.java, registered as optional on NeoForge (NeoForgeNetworking, registrar.optional()) and through PayloadTypeRegistry on Fabric (ImmersiveMusicFabricCommon, FabricClientNetworking). NeoForge splits the entrypoint in two: ImmersiveMusicNeoForge (both sides) and ImmersiveMusicNeoForgeClient (dist = Dist.CLIENT). The message bodies match 1.20.1 (StructureSyncCodec) and so do the two channel ids, as on 1.20.1 Fabric; 1.20.1 Forge and NeoForge carry both messages in one SimpleChannel instead. Versions never connect to each other, so that difference doesn't matter.

Everything else in common/ and fabric/ is a copy of the 1.20.1 code, except the three files listed in PORT_SPECIFIC in check_sync.py. After changing the 1.20.1 code, run

python3 check_sync.py

to list every file the port is missing changes from (it ignores the differences above), and python3 check_sync.py --apply to bring them over, with the ResourceLocation change applied.

The unit tests aren't duplicated here: they cover version-independent code that's identical in both builds, and run in the 1.20.1 build.

About

Immersive Music and Music Packs for Minecraft

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages