mezz / JustEnoughItems

Item and Recipe viewing mod for Minecraft
https://www.curseforge.com/minecraft/mc-mods/jei
MIT License
778 stars 303 forks source link

[Bug]: Common-API is not published with intermediate mappings (Fabric) #3451

Closed ICY105 closed 4 weeks ago

ICY105 commented 7 months ago

Steps to Reproduce the Bug

Implement JEI in a fabric mod that is not using parchment mappings. The fabric example mod is sufficient.

Expected Behavior

Adding JEI to a project should remap the API to your project's mappings.

Actual Behavior

Remapping works for the fabric-api, however the common-api does not have intermediate mappings and is stuck on parchment. For example, the method getPluginUid(), claims to require the return type net.minecraft.resources.ResourceLocation which doesn't exist, instead of net.minecraft.util.Identifier which is the same class under Yarn mappings.

Mod Pack URL (Optional)

No response

Mod Pack Version (Optional)

No response

Extra Notes (Optional)

No response

latest.log

No response

github-actions[bot] commented 4 months ago

This has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

JongWasTaken commented 3 months ago

This issue is still not resolved on version 15.3.0.7, making it impossible to use this API with yarn mappings (unless there is a way to remap it by myself?).

mezz commented 3 months ago

Thanks for the report! I ran into limitations in the tools I use when trying to publish this jar. I opened an issue with VanillaGradle some time ago here: https://github.com/SpongePowered/VanillaGradle/issues/69 I'll ping them in the issue there to see what the current status is.

sshcrack commented 2 months ago

So the only way to support JEI is to switch to mojmaps?

mezz commented 1 month ago

I might have finally been able to fix this simply, here: https://github.com/mezz/JustEnoughItems/commit/d05376b3e901e918ef1cc51bd864f11e35884995 Please try out JEI version 19.16.4.165 for minecraft 1.21.1 and let me know how it goes.

mezz commented 4 weeks ago

This is still an issue but I think I have a way forward. I have moved off of VanillaGradle and the new toolchain should have a way to support this.

mezz commented 4 weeks ago

This has been fixed in JEI for 1.21.1 (19.17.0+) and 1.20.1 (15.18.0+) Please depend on the fabric api this way:

modImplementation("mezz.jei:jei-${minecraft_version}-fabric-api:${jei_version}")
modRuntimeOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}")

and it will pull in an intermediary mapping version of common-api automatically.

If you have a multi-project and want to depend on the intermediary mapping version of common-api directly, you can do it with

modImplementation("mezz.jei:jei-${minecraft_version}-common-api-intermediary:${jei_version}")

(all this is visible on the maven, for example here's 1.21.1: https://maven.blamejared.com/mezz/jei/jei-1.21.1-common-api-intermediary/)