Skip to content

Adapt 26.1 Fabric metadata and mixin transformations - #2270

Closed
dominicbytes wants to merge 1 commit into
Sinytra:26.1.xfrom
dominicbytes:bytecraft/26.1.2-compat-repairs
Closed

Adapt 26.1 Fabric metadata and mixin transformations#2270
dominicbytes wants to merge 1 commit into
Sinytra:26.1.xfrom
dominicbytes:bytecraft/26.1.2-compat-repairs

Conversation

@dominicbytes

Copy link
Copy Markdown

The Issue

Several Fabric mods targeting Minecraft 26.1.2 fail during transformation or NeoForge startup because their metadata and mixin targets no longer correspond to the NeoForge runtime.

The failures fall into three categories:

  1. Native dependency aliases are applied too late.

    Origins: Legacy depends on the Fabric ID cloth-config2, while native NeoForge Cloth Config provides cloth_config. Connector's existing alias layer operates after Launchpad has converted the Fabric dependencies into NeoForge metadata, so NeoForge mod sorting rejects the dependency before the alias can take effect.

  2. Fabric enum extensions can conflict with NeoForge's extensible-enum mechanism.

    Farmer's Delight Refabricated extends RecipeBookType through a Fabric class tweaker and mixin. NeoForge implements this enum as IExtensibleEnum and requires additions to be declared through enumExtensions metadata instead of direct Mixin extension.

  3. Minecraft and NeoForge have moved or replaced several mixin target operations.

    Origins, Farmer's Delight, and Debugify contain injectors targeting methods, fields, calls, constants, or local ordinals that changed in Minecraft 26.1.2 or NeoForge. These failures can be masked by earlier metadata errors, so they become visible only after the preceding problem is repaired.

The Proposal

This change adds narrowly scoped metadata and mixin adaptations for the affected 26.1.2 artifacts.

Native dependency aliases

  • Determines which configured native mod aliases are active from the NeoForge mods that are actually present.
  • Supplies those active aliases to the transformer before Launchpad creates NeoForge metadata.
  • Rewrites matching IDs in depends, recommends, suggests, breaks, and conflicts.
  • Preserves and combines version predicates when both the Fabric and native IDs are declared.
  • Includes active aliases in the transformed-JAR cache identity.
  • Leaves Fabric dependency IDs unchanged when the corresponding native provider is absent.

Farmer's Delight enum extension

For the exact Farmer's Delight RecipeBookType extension, Connector:

  • Removes the protected RecipeBookType constant from the Fabric class tweaker.
  • Leaves the client-only SearchRecipeBookCategory enum extension intact.
  • Removes only RecipeBookTypeMixin from the mixin configuration.
  • Generates META-INF/connector_enum_extensions.json.
  • Adds a launchpad:enum_extensions custom metadata property referencing that resource.

The accompanying Launchpad change projects this property into NeoForge's enumExtensions mod metadata.

Mixin adaptations

The explicit 26.1.2 method patches cover:

  • Origins' descriptor-less goDownInWater selector.
  • Block friction moving from Block to the NeoForge BlockState extension.
  • Anvil result logic moving into createResultInternal.
  • Sleep-position logic moving into the generated startSleepInBed lambda.
  • Bone-meal consumption moving from growCrop to applyBonemeal.
  • A changed boolean local ordinal in ServerPlayerGameMode.destroyBlock.
  • Phantom player capture moving to ServerPlayer.blockPosition.
  • Farmer's Delight fence-gate sounds moving from WoodType methods to FenceGateBlock fields.
  • Debugify's obsolete blocking-item injection where NeoForge already provides equivalent break handling.
  • Debugify's ranged-bow goal field widening from Monster to Mob.
  • Debugify's corresponding lookAt owner and ordinal change.
  • Debugify's fox carried-item drop moving from dropAllDeathLoot to dropEquipment.

The fox handler is made self-contained by obtaining its ServerLevel from the target Fox instead of capturing a target-method argument that no longer exists at the new location.

Regression tests cover dependency alias behavior, Farmer's Delight enum conversion, and Debugify's shadow-field adaptation.

Possible Side Effects

Active dependency aliases now affect transformed metadata before NeoForge mod sorting. This is limited to aliases whose native provider is present. When no matching native mod is loaded, the original Fabric dependency remains untouched.

Changing active aliases also changes the transformation cache identity. This may cause an additional cold transformation when the installed native-mod set changes, but prevents a transformed JAR produced under one alias configuration from being incorrectly reused under another.

When both an alias and its native target are present in the same dependency section, their predicates are combined into an array. This preserves both constraints but may make the generated metadata more restrictive than either predicate alone.

The Farmer's Delight enum conversion is intentionally artifact-specific. It activates only for the farmersdelight mod containing the expected RecipeBookTypeMixin. Changes to that mod's package names, class tweaker, constant name, or mixin configuration may require this rule to be updated.

The explicit mixin patches match particular target classes, methods, mixin types, constants, and injection points. A different mod using an identical combination could also match a rule, although the signatures are intentionally narrow.

One Debugify injection is disabled because NeoForge's replacement hurtAndBreak path already stops item use when the blocking item breaks. If NeoForge changes that behavior later, this equivalence should be reviewed.

Alternatives

One alternative was to rely on Connector's existing Fabric Loader alias support. This was not sufficient because NeoForge dependency sorting occurs before that alias layer can satisfy Launchpad-generated metadata.

Another option was to require native-mod authors to provide every historical Fabric ID. That would move Connector-specific compatibility requirements into unrelated native mods and would not address existing releases.

Pre-patching the affected mod JARs was also considered. Maintaining separate patched distributions would make updates and provenance harder to manage and would bypass Connector's normal transformation pipeline.

The failing mixins could have been disabled wholesale. This was rejected where the handlers preserve meaningful behavior. Individual injections were disabled only when bytecode inspection showed that they were behavior-neutral or that NeoForge already supplied the same correction.

A generalized automatic conversion of every Fabric enum extension was not selected. Not all Fabric enum targets implement NeoForge's extensible-enum interface, and constructor parameters cannot always be inferred safely. The current conversion therefore handles only the verified Farmer's Delight case.

Additional Notes

This change depends on the accompanying Adapter and Launchpad changes:

  • Adapter branch: bytecraft/connector-26.1.2-mixin-repairs
  • Launchpad branch: bytecraft/enum-extension-metadata

The current dependency pins anticipate:

  • Adapter 2.0.45+26.1.2
  • Launchpad 1.6.3+26.1.2

These version numbers should be adjusted to the actual published versions before merge if the release numbers differ.

Validation completed successfully:

  • Connector transformer suite: 7 tests passed.
  • Adapter unit suite: 31 tests passed.
  • Adapter Minecraft 26.1.2 integration suite: passed.
  • Launchpad suite: 12 tests passed.
  • Origins: Legacy completed a cold transform, reached the dedicated-server ready marker, and shut down cleanly.
  • Farmer's Delight Refabricated completed a cold transform, registered through the NeoForge enum-extension path, reached the ready marker, and shut down cleanly.
  • Debugify enabled all 58 selected fixes, reached the ready marker, and shut down cleanly.
  • Axiom 5.4.2 with native NeoForge WorldEdit 7.4.3 passed dedicated-server initialization and manual client/editor acceptance.

@Su5eD

Su5eD commented Jul 17, 2026

Copy link
Copy Markdown
Member

I'll be closing this PR as it introduces hardcoded mod-specific patches, which should be placed in an addon instead of connector itself. I've added a new Plugin API in Connector 26.1 beta 3 that allows for this, you can find a tutorial on our wiki. If there's anything that can be patched dynamically without hardcoding, please open a PR to Adapter.

@Su5eD Su5eD closed this Jul 17, 2026
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Connector Triage Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants