fabric-loom icon indicating copy to clipboard operation
fabric-loom copied to clipboard

0.9 doesn't add refmap key to mixins.json if file is in another subproject

Open AnttiMK opened this issue 2 years ago • 8 comments

Dunno if this was incorrect behaviour with 0.8 (and hence this being an invalid issue), but with 0.8, loom added the "refmap": key to the *.mixins.json file even if the file resided in another subprojects' resources folder.

To clarify: our project has all of its resources in the resources folder of the common subproject (for ease of access), and the fabric subproject doesn't have a resources folder. Loom 0.8 found the file from the other folder and correctly added the refmap key to the file, but loom 0.9.x doesn't -> the server crashes when trying to load the mod.

AnttiMK avatar Aug 08 '21 22:08 AnttiMK

This type of bugs shouldn't happen anymore after #451, but this might be yet another regression.

Although, since you mentioned a "common" and a "fabric" subproject, are you perhaps using Architectury's Loom fork (dev.architectury.loom)? It's still outdated and doesn't include the latest changes on the 0.9 branch.

Juuxel avatar Aug 09 '21 13:08 Juuxel

are you perhaps using Architectury's Loom fork

Negative, we're using fabric's loom. We very recently added support for fabric, so this stuff is pretty new to us 😄

AnttiMK avatar Aug 09 '21 13:08 AnttiMK

Hmm, okay. Do you have a link to the project source code? Loom's refmap adder should pick up all mixin JSON files that are declared in the fabric.mod.json, so I'd like to have a closer look.

Juuxel avatar Aug 09 '21 13:08 Juuxel

Here ya go: https://github.com/plan-player-analytics/Plan/tree/master/Plan/fabric

AnttiMK avatar Aug 09 '21 13:08 AnttiMK

JSON files used to be under https://github.com/plan-player-analytics/Plan/tree/master/Plan/common/src/main/resources, now they reside under the fabric subproject.

AnttiMK avatar Aug 09 '21 13:08 AnttiMK

The Loom's refmap adder will pick all mixin JSON declared in the fabric.mod.json that are actually present in the resource folder of the declared source set. If no source set is declared by hand, by default all sources set within the current project are declared automatically.

LogicFan avatar Aug 09 '21 16:08 LogicFan

The idea behind mentioned behaviour is that people should put the mixin JSON file and mixin class java file in the same resource set.

LogicFan avatar Aug 09 '21 16:08 LogicFan

Is there any sort of updated way to do this. I have a Forge, Fabric and common module in my project. I use Mixins in both forge and fabric so was hoping to have just a single file.

I notice on build the "refmap" section is missing from the mixin json when compiled.

james090500 avatar May 11 '23 15:05 james090500